-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix java 1.8 detection #28
Comments
I can't find any java exclusions in your code so in my opinion we should see it for all javas.
|
Hello, is this still an issue, or did you manage to find a workaround? I haven't been able to replicate it, and if the issue was with any java app, I would expect more people to report... |
Yes it's still a problem. All Java versions have missing libs. There are a number of bugs depending on expected behavior. jre11 is not reported. The executable bit is clear on *.so. checkrebuild seems to skip these. Is not reporting *.so without executable bit intentional? Not showing a needed rebuild because it's 0644 doesn't seem safe to me. I have 75 .so files without executable that wouldn't be checked.
jre8 jdk8 is reported. If not scanning non executable *.so is expected behavior, this is a bug I can fix by clearing the executable bit on *.so. Your package should have executable *.so. Not reporting on your system is a bug. jre17 is not reported. The executable bit is set. Unless specifically excluded, not reporting is a bug. |
Looks like checking only executable files was intentional indeed, we need a good heuristic to call "ldd" only on relevant files, I'm not sure if we should include all files with so extension 🤔 Line 76 in 0fbc329
|
Clearing the execute bit is the solution. Here's a patch for the executable filter. It's faster than forking diff -ur a/checkrebuild b/checkrebuild
--- a/checkrebuild 2023-08-29 20:17:06.108897659 -0400
+++ b/checkrebuild 2023-08-29 20:22:42.462668375 -0400
@@ -54,10 +54,70 @@
}
filter_executable() {
- LANG=C xargs -r0 stat --printf "%F %a\t%n\0" |
- grep -ozP "^regular file \d?[1357]\d\d\t\K.*" |
- xargs -r0 file -N |
- grep -oP ".*(?=: ELF )"
+ local pl='#!/usr/bin/perl
+
+use strict;
+use warnings;
+use integer;
+use bytes;
+no utf8;
+no overloading;
+no locale;
+
+use Data::Dumper;
+use File::stat;
+use Fcntl ":mode";
+
+$/="\0";
+my $test=0;
+my $ELF=chr(127)."ELF";
+
+#print Dumper(\$ELF); exit(1);
+
+sub _iself {
+ my $fname=shift();
+ my $rv=0;
+ my $fh;
+ if (open($fh,"<",$fname)) {
+ binmode($fh);
+ my $text;
+ if (read($fh,$text,4)) {
+ #print Dumper(\$text);
+ if ($text eq $ELF) {
+ $rv=1;
+ }
+ }
+ close($fh);
+ }
+ return($rv);
+}
+
+my $line;
+my $st;
+foreach $line (<STDIN>) {
+ chomp($line);
+ $st=stat($line);
+ if ($st) {
+ if ($test) {
+ if (S_ISDIR($st->mode)) {
+ printf("DIR 0%03o %s\n",$st->mode&0777,$line);
+ } elsif (not ($st->mode & 0111)) {
+ printf("NEX 0%03o %s\n",$st->mode&0777,$line);
+ } elsif (not _iself($line)) {
+ printf("NEL 0%03o %s\n",$st->mode&0777,$line);
+ } else {
+ printf("EXE 0%03o %s\n",$st->mode&0777,$line);
+ }
+ } else {
+ if (not S_ISDIR($st->mode) and ($st->mode & 0111) && _iself($line)) {
+ print($line,"\n");
+ }
+ }
+ }
+}
+exit(0);
+'
+ perl -e "${pl}"
}
check_broken_ldd() { |
Wow thanks, how much of a perf difference do you get with it? The downside is of course the increased complexity of this, as I'm not quite experienced with perl. |
Java 1.8 jre8 jdk8 and apps bundled with jre8 constantly report as needing an update due to missing
libjvm.so
and others. They are missing library dependencies by design which are resolved by the running jvm. Java 11 and 17 are missing many of the same files but do not show in the listing.Example apps are: cyberduck, mirth-connect-administrator-launcher, jre8, jdk8.
The text was updated successfully, but these errors were encountered: