Package: needrestart
Version: 3.5-4+deb11u2
Severity: normal

Dear Maintainer,

When running 'needrestart -b' on an AMD system, I get the following
uninitialized variable warning.  It also does not report the expected
microcode version (NEEDRESTART-UCEXP).  See output: section below for
example output of needrestart -b.

Use of uninitialized value $ucode_vars{"AVAIL"} in concatenation (.) or string 
at /usr/sbin/needrestart line 904.

This perl warning disappears when adding the -v option (needrestart -b -v),
and the correct value is reported for NEEDRESTART-UCEXP.

The processor, in this system, is:

    vendor_id       : AuthenticAMD
    cpu family      : 18
    model           : 1
    model name      : AMD A4-3400 APU with Radeon(tm) HD Graphics
    stepping        : 0
    microcode       : 0x3000027



It looks to me like the problem is that line 182 of
/usr/share/perl5/NeedRestart/uCode/AMD.pm ends in a comma (,) instead
of a semicolon (;).  This means that assignment is subsumed into the
next line which is under if ($debug).

See the attached patch.

It also looks to me like this is similar symptoms with a different
root cause from bug #973050.


Thanks,
George Robbert


-- Package-specific info:
needrestart output:



-- System Information:
Debian Release: 11.1
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-20-amd64 (SMP w/2 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=ANSI_X3.4-1968) 
(ignored: LC_ALL set to C), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages needrestart depends on:
ii  binutils                   2.35.2-2
ii  dpkg                       1.20.12
ii  gettext-base               0.21-4
ii  libintl-perl               1.26-3+deb11u1
ii  libmodule-find-perl        0.15-1
ii  libmodule-scandeps-perl    1.30-1
ii  libproc-processtable-perl  0.59-2+b1
ii  libsort-naturally-perl     1.03-2
ii  libterm-readkey-perl       2.38-1+b2
ii  perl                       5.32.1-4+deb11u2
ii  xz-utils                   5.2.5-2.1~deb11u1

Versions of packages needrestart recommends:
ii  libpam-elogind [libpam-systemd]  246.10-2
ii  sysvinit-core                    2.96-7+devuan2

Versions of packages needrestart suggests:
pn  iucode-tool                          <none>
pn  needrestart-session | libnotify-bin  <none>

-- Configuration Files:
/etc/apt/apt.conf.d/99needrestart changed:
DPkg::Post-Invoke {"test -x /usr/lib/needrestart/apt-pinvoke && 
/usr/lib/needrestart/apt-pinvoke -b || true"; };

/etc/needrestart/hook.d/20-rpm [Errno 2] No such file or directory: 
'/etc/needrestart/hook.d/20-rpm'

-- no debconf information
--- /tmp/AMD.pm 2022-12-22 11:00:14.589106185 -0700
+++ /usr/share/perl5/NeedRestart/uCode/AMD.pm   2022-12-22 11:00:24.329046436 
-0700
@@ -179,7 +179,7 @@
     if ( exists( $_ucodes->{cpuid}->{$cpuid} ) ) {
         my $prid = $_ucodes->{cpuid}->{$cpuid};
         if ( exists( $_ucodes->{prid}->{$prid} ) ) {
-            $vars{AVAIL} = sprintf( "0x%08x", $_ucodes->{prid}->{$prid} ),
+            $vars{AVAIL} = sprintf( "0x%08x", $_ucodes->{prid}->{$prid} );
 
               print STDERR "$LOGPREF #$info->{processor} found ucode 
$vars{AVAIL}\n" if ($debug);
             if ( $_ucodes->{prid}->{$prid} > $ucode ) {

Reply via email to