Skip to content

Conversation

@anumukul
Copy link

Adds a check for glibc version at Besu startup. If the detected version is below 2.28, startup is aborted with a clear error message instead of failing later with confusing native library load errors.

Related to #9506 where users with older glibc versions experience cryptic failures when native libraries try to load.

Fixes #9551

@anumukul anumukul force-pushed the fix-9551-glibc-version-check branch from f99eb02 to a9597b2 Compare December 10, 2025 20:32
Copy link
Contributor

@fab-10 fab-10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks, just small suggestions

Comment on lines 587 to 590
logger.error("Insufficient glibc version detected.");
logger.error("Required: {} or higher", minVersion);
logger.error("Found: {}", glibcVersion);
logger.error("Please upgrade your system's glibc to version {} or higher.", minVersion);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

collapse everything on a single log line

return false;
}
}
return true; // Versions are equal
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this also happens if there are no . in the version

return;
}

final String minVersion = "2.28";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to introduce a constant for this value

@anumukul
Copy link
Author

@fab-10 Updated. Consolidated the error messages, added the constant, and fixed the version comparison to handle edge cases.

@fab-10
Copy link
Contributor

fab-10 commented Dec 12, 2025

you need to fix the DCO on the last commit

@anumukul anumukul force-pushed the fix-9551-glibc-version-check branch 2 times, most recently from d009186 to 7483e0f Compare December 12, 2025 10:18
Copy link
Contributor

@fab-10 fab-10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, now just update your branch with main

@fab-10 fab-10 enabled auto-merge (squash) December 12, 2025 10:19
@fab-10
Copy link
Contributor

fab-10 commented Dec 12, 2025

there are failures in the CI, have not you tried to build and test locally?

@fab-10 fab-10 disabled auto-merge December 12, 2025 10:34
Copy link
Contributor

@fab-10 fab-10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the failires in the CI, and please use a real email for the DCO

@anumukul anumukul force-pushed the fix-9551-glibc-version-check branch from 7483e0f to 0914fa6 Compare December 12, 2025 11:12
Fixes hyperledger#9551

Signed-off-by: Anubhav Singh <anubhavsingh@Anubhavs-MacBook-Air.local>
Signed-off-by: Anubhav <anumukul009@gmail.com>
- Consolidate error logging into single line
- Add MINIMUM_GLIBC_VERSION constant
- Handle version strings without dots in comparison logic

Signed-off-by: Anubhav Singh <anubhavsingh@Anubhavs-MacBook-Air.local>
Signed-off-by: Anubhav <anumukul009@gmail.com>
@anumukul anumukul force-pushed the fix-9551-glibc-version-check branch from 0914fa6 to 624b495 Compare December 12, 2025 11:15
Copy link
Contributor

@garyschulte garyschulte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

Comment on lines +513 to +515

checkGlibcVersion(glibcVersion);

Copy link
Contributor

@garyschulte garyschulte Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR - I hadn't seen it until just now.

besu-native is not required for non-mainnet uses of besu, and that is the root of the glibc requirement. Bouncycastle provides a pure-java implementation of most of the crypto libraries necessary. We should not make a specific version glibc a hard requirement for startup. This could break alpine linux for example, which uses musl rather than glibc.

Ideally, we would make the glibc check in the besu startup script, that way it can be trivially bypassed for non-standard but otherwise valid configurations. Also, it should be only required for ethereum mainnet configurations that have a hard requirement of the besu-native implementation. see NativeRequirement.java

If we want to keep the loading checks in besu java, perhaps we can move this into the ValidateConfigSubcommand and call it from the startup script to assert loading is successful.

It is going to be a bit tricky to make and keep up-to-date the assertion about glibc version, since it is dependent on the platform building besu-native, which at the time of writing is ubuntu-22.04. But I think moving the startup check into a subcommand and modifying the besu startup script to execute the subcommand would be a great place to add this safety/clarity - it is flexible enough to be useful and bypassable, and is open to extension in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

assert glibc min version at besu startup

3 participants