Skip to content
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

Use of uninitialized value $sdev in right bitshift #296

Open
heapdavid opened this issue Feb 9, 2024 · 1 comment
Open

Use of uninitialized value $sdev in right bitshift #296

heapdavid opened this issue Feb 9, 2024 · 1 comment
Labels

Comments

@heapdavid
Copy link

Hi, we run needrestart -b on a cron and occasionally see the following output to stderr on some of our busier servers. We're struggling to reproduce reliably as it's pretty rare and intermittent.

Use of uninitialized value $sdev in right bitshift (>>) at /usr/sbin/needrestart line 532, <HMAP> line 2.
Use of uninitialized value $sdev in right bitshift (>>) at /usr/sbin/needrestart line 532, <HMAP> line 2.
Use of uninitialized value $sdev in bitwise and (&) at /usr/sbin/needrestart line 532, <HMAP> line 2.
Use of uninitialized value $sdev in right bitshift (>>) at /usr/sbin/needrestart line 532, <HMAP> line 2.
Use of uninitialized value $sdev in right bitshift (>>) at /usr/sbin/needrestart line 532, <HMAP> line 2.
Use of uninitialized value $sdev in bitwise and (&) at /usr/sbin/needrestart line 532, <HMAP> line 2.
Use of uninitialized value $sdev in right bitshift (>>) at /usr/sbin/needrestart line 544, <HMAP> line 2.
Use of uninitialized value $sdev in right bitshift (>>) at /usr/sbin/needrestart line 544, <HMAP> line 2.
Use of uninitialized value $sinode in string eq at /usr/sbin/needrestart line 549, <HMAP> line 2

Have seen there was a similar issue a while ago but that looked to be fixed at the time.

We're running Debian 12 (Bookworm)

$ apt list needrestart
Listing... Done
needrestart/stable,now 3.6-4 all [installed]

Please let me know if you need any further information

Thanks

@liske
Copy link
Owner

liske commented Mar 3, 2024

Needrestart tries to compares the inode information from /proc/$PID/maps with the corresponding files in the filesystem. For some reasons the stat call seems to fail for some reasons:

my ($sdev, $sinode) = stat($testp);

The path is the first available: at

needrestart/needrestart

Lines 543 to 544 in c62b152

my @paths = ("/proc/$pid/map_files/$maddr", "/proc/$pid/root/$path");
my ($testp) = grep { -e $_; } @paths;

Do you have any special filesystem setup? This might also happen if the process terminates while needrestart is investigating the procfs. 🤔

@liske liske added the bug label Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants