Bug#860908: perl 5.24 segfaults during a dpkg -i of cmanager (and other packages)

Brad Barnett debian-bugs at l8r.net
Fri Apr 21 19:15:08 UTC 2017



> Could you perhaps include the following information:
> 
>  * Which architecture are you using?  If you have multi-arch enabled,
>    please list the architecture of the perl packages (e.g. in the form
>    of "dpkg -l" if you don't mind including a list of all packages
>    installed)

amd64, nothing else.

> 
>  * Does perl segfault in general or does it "only" happen when you run
>    dpkg/apt?

So far, only when running apt/dpkg.  And, only at specific times (more to
follow, as per Gregor's request)

>    - e.g. try running "dpkg-architecture" (if you have dpkg-dev
>      installed)
> 
>  * If you can reproduce the segfault directly, can you provide a
>    backtrace with symbols? NB: you will probably need to download some
>     of the debug symbols from the new debug archive (see [1])

I can't directly, and strace wasn't very helpful in tracing perl via
dpkg -- even with -f.

EG:

strace -s10024 -f -i -y  -o /tmp/bah dpkg -D10000 -i cgmanager_0.41-2_amd64.deb

4848  read(4, "package strict;\n\n$strict::VERSION = \"1.11\";\n\nmy ( %bitmask, %explicit_bitmask );\n\nBEGIN {\n
  # Verify that we're called correctly so that strictures will work.\n    # Can't use Carp, since Carp uses us!\n
 # see also warnings.pm.\n    die sprintf \"Incorrect use of pragma '%s' at %s line %d.\\n\", __PACKAGE__, +(caller)[1,2]\n        if __FILE__ !~ ( '(?x) \\b     '.__PACKAGE__.'  \\.pmc? \\z' )\n        && __FILE__ =~ ( '(?x) \\b (?
i:'.__PACKAGE__.') \\.pmc? \\z' );\n\n    %bitmask = (\n        refs => 0x00000002,\n        subs => 0x00000200,\n
      vars => 0x00000400,\n    );\n\n    %explicit_bitmask = (\n        refs => 0x00000020,\n        subs => 0x00000
040,\n        vars => 0x00000080,\n    );\n\n    my $bits = 0;\n    $bits |= $_ for values %bitmask;\n\n    my $inline_all_bits = $bits;\n    *all_bits = sub () { $inline_all_bits };\n\n    $bits = 0;\n    $bits |= $_ for values %ex
plicit_bitmask;\n\n    my $inline_all_explicit_bits = $bits;\n    *all_explicit_bits = sub () { $inline_all_explicit_bits };\n}\n\nsub bits {\n    my $bits = 0;\n    my @wrong;\n    foreach my $s (@_) {\n        if (exists $bitmask{
$s}) {\n            $^H |= $explicit_bitmask{$s};\n\n            $bits |= $bitmask{$s};\n        }\n        else {\n            push @wrong, $s;\n        }\n    }\n    if (@wrong) {\n        require Carp;\n        Carp::croak(\"Unkn
own 'strict' tag(s) '@wrong'\");\n    }\n    $bits;\n}\n\nsub import {\n    shift;\n    $^H |= @_ ? &bits : all_bits | all_explicit_bits;\n}\n\nsub unimport {\n    shift;\n\n    if (@_) {\n        $^H &= ~&bits;\n    }\n    else {\n
        $^H &= ~all_bits;\n        $^H |= all_explicit_bits;\n    }\n}\n\n1;\n__END__\n\n", 8192) = 1606
4848  --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_ACCERR, si_addr=0x564e95e7d010} ---
4848  +++ killed by SIGSEGV +++
4847  <... wait4 resumed> [{WIFSIGNALED(s) && WTERMSIG(s) == SIGS


---------

As per Gregor's request, here's what happened:

- installed a fresh copy of stretch on an older generation (fully amd64 capable) AMD box

- install went fine.  Installed it today, using V3 of the installer

- tasksel was ONLY 'ssh' and below it 'standard system utilities'

- post boot, modified /etc/network/interfaces, then:

- apt-get installed vim lsof

- installed moreutils

- installed inetutils-tools

- purged inetutils-tools

- installed net-tools

- created /etc/apt/preferences.d/systemd, with contents:

Package: systemd
Pin: release *
Pin-Priority: -1


Package: *systemd*
Pin: release *
Pin-Priority: -1

Package: systemd:i386
Pin: release *
Pin-Priority: -1

Package: systemd:amd64
Pin: release *
Pin-Priority: -1

- apt-get install sysvinit-core

This also did:

Install: startpar:amd64 (0.59-3.1, automatic), insserv:amd64
(1.14.0-5.4+b1, automatic), psmisc:amd64 (22.21-2.1+b2, automatic),
sysvinit-core:amd64 (2.88dsf-59.9), initscripts:amd64 (2.88dsf-59.9,
automatic), sysv-rc:amd64 (2.88dsf-59.9, automatic)

Remove: systemd-sysv:amd64 (232-22), libpam-systemd:amd64 (232-22)

During install:


# apt-get install sysvinit-utils sysvinit-core
Reading package lists... Done
Building dependency tree
Reading state information... Done
sysvinit-utils is already the newest version (2.88dsf-59.9).
The following additional packages will be installed:
  cgmanager initscripts insserv libcgmanager0 libglib2.0-0 libglib2.0-data libnih-dbus1 libnih1 psmisc
  shared-mime-info startpar systemd-shim sysv-rc xdg-user-dirs
Suggested packages:
  bootchart2 pm-utils bum bootlogd
The following packages will be REMOVED:
  systemd-sysv
The following NEW packages will be installed:
  cgmanager initscripts insserv libcgmanager0 libglib2.0-0 libglib2.0-data libnih-dbus1 libnih1 psmisc
  shared-mime-info startpar systemd-shim sysv-rc sysvinit-core xdg-user-dirs
0 upgraded, 15 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 6,358 kB/6,851 kB of archives.
After this operation, 22.2 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://ftp.us.debian.org/debian stretch/main amd64 systemd-shim amd64 10-3 [20.0 kB]
Get:2 http://ftp.us.debian.org/debian stretch/main amd64 libglib2.0-0 amd64 2.50.3-2 [2,691 kB]
Get:3 http://ftp.us.debian.org/debian stretch/main amd64 libnih1 amd64 1.0.3-8 [125 kB]
Get:4 http://ftp.us.debian.org/debian stretch/main amd64 libnih-dbus1 amd64 1.0.3-8 [96.8 kB]
Get:5 http://ftp.us.debian.org/debian stretch/main amd64 libcgmanager0 amd64 0.41-2 [41.1 kB]
Get:6 http://ftp.us.debian.org/debian stretch/main amd64 cgmanager amd64 0.41-2 [84.0 kB]
Get:7 http://ftp.us.debian.org/debian stretch/main amd64 libglib2.0-data all 2.50.3-2 [2,517 kB]
Get:8 http://ftp.us.debian.org/debian stretch/main amd64 shared-mime-info amd64 1.8-1 [731 kB]
Get:9 http://ftp.us.debian.org/debian stretch/main amd64 xdg-user-dirs amd64 0.15-2+b1 [52.2 kB]
Fetched 6,358 kB in 1s (3,521 kB/s)
Segmentation fault
Selecting previously unselected package insserv.
(Reading database ... 28220 files and directories currently installed.)
Preparing to unpack .../insserv_1.14.0-5.4+b1_amd64.deb ...
Unpacking insserv (1.14.0-5.4+b1) ...
Selecting previously unselected package startpar.
Preparing to unpack .../startpar_0.59-3.1_amd64.deb ...
Unpacking startpar (0.59-3.1) ...
Selecting previously unselected package sysv-rc.
Preparing to unpack .../sysv-rc_2.88dsf-59.9_all.deb ...
Unpacking sysv-rc (2.88dsf-59.9) ...
Selecting previously unselected package initscripts.
Preparing to unpack .../initscripts_2.88dsf-59.9_amd64.deb ...
Unpacking initscripts (2.88dsf-59.9) ...
dpkg: systemd-sysv: dependency problems, but removing anyway as you requested:
 init depends on systemd-sysv | sysvinit-core; however:
  Package systemd-sysv is to be removed.
  Package sysvinit-core is not installed.
 libpam-systemd:amd64 depends on systemd-shim (>= 10-3~) | systemd-sysv; however:
  Package systemd-shim is not installed.
  Package systemd-sysv is to be removed.

(Reading database ... 28320 files and directories currently installed.)
Removing systemd-sysv (232-22) ...
Selecting previously unselected package systemd-shim.
(Reading database ... 28303 files and directories currently installed.)
Preparing to unpack .../00-systemd-shim_10-3_amd64.deb ...
Adding 'diversion of /usr/share/dbus-1/system-services/org.freedesktop.systemd1.service to /usr/share/dbus-1/system-services/org.freedesktop.systemd1.service.systemd by systemd-shim'
Unpacking systemd-shim (10-3) ...
Selecting previously unselected package sysvinit-core.
Preparing to unpack .../01-sysvinit-core_2.88dsf-59.9_amd64.deb ...
Unpacking sysvinit-core (2.88dsf-59.9) ...
Selecting previously unselected package libglib2.0-0:amd64.
Preparing to unpack .../02-libglib2.0-0_2.50.3-2_amd64.deb ...
Unpacking libglib2.0-0:amd64 (2.50.3-2) ...
Selecting previously unselected package libnih1.
Preparing to unpack .../03-libnih1_1.0.3-8_amd64.deb ...
Unpacking libnih1 (1.0.3-8) ...
Selecting previously unselected package libnih-dbus1.
Preparing to unpack .../04-libnih-dbus1_1.0.3-8_amd64.deb ...
Unpacking libnih-dbus1 (1.0.3-8) ...
Selecting previously unselected package libcgmanager0:amd64.
Preparing to unpack .../05-libcgmanager0_0.41-2_amd64.deb ...
Unpacking libcgmanager0:amd64 (0.41-2) ...
Selecting previously unselected package cgmanager.
Preparing to unpack .../06-cgmanager_0.41-2_amd64.deb ...
Unpacking cgmanager (0.41-2) ...
Selecting previously unselected package libglib2.0-data.
Preparing to unpack .../07-libglib2.0-data_2.50.3-2_all.deb ...
Unpacking libglib2.0-data (2.50.3-2) ...
Selecting previously unselected package psmisc.
Preparing to unpack .../08-psmisc_22.21-2.1+b2_amd64.deb ...
Unpacking psmisc (22.21-2.1+b2) ...
Selecting previously unselected package shared-mime-info.
Preparing to unpack .../09-shared-mime-info_1.8-1_amd64.deb ...
Unpacking shared-mime-info (1.8-1) ...
Selecting previously unselected package xdg-user-dirs.
Preparing to unpack .../10-xdg-user-dirs_0.15-2+b1_amd64.deb ...
Unpacking xdg-user-dirs (0.15-2+b1) ...
Setting up psmisc (22.21-2.1+b2) ...
Setting up libglib2.0-0:amd64 (2.50.3-2) ...
No schema files found: doing nothing.
Setting up startpar (0.59-3.1) ...
Setting up libglib2.0-data (2.50.3-2) ...
Processing triggers for libc-bin (2.24-9) ...
Processing triggers for systemd (232-22) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up shared-mime-info (1.8-1) ...
Setting up insserv (1.14.0-5.4+b1) ...
Processing triggers for dbus (1.10.18-1) ...
Setting up xdg-user-dirs (0.15-2+b1) ...
Setting up libnih1 (1.0.3-8) ...
Setting up libnih-dbus1 (1.0.3-8) ...
Setting up libcgmanager0:amd64 (0.41-2) ...
Setting up cgmanager (0.41-2) ...
Segmentation fault
Segmentation fault
Segmentation fault
Segmentation fault
Segmentation fault
Segmentation fault
Segmentation fault
Segmentation fault
Segmentation fault
Segmentation fault
dpkg: error processing package cgmanager (--configure):
 subprocess installed post-installation script returned error exit status 139
Setting up sysv-rc (2.88dsf-59.9) ...
Setting up initscripts (2.88dsf-59.9) ...
Segmentation fault
dpkg: error processing package initscripts (--configure):
 subprocess installed post-installation script returned error exit status 139
dpkg: dependency problems prevent configuration of systemd-shim:
 systemd-shim depends on cgmanager (>= 0.32); however:
  Package cgmanager is not configured yet.

dpkg: error processing package systemd-shim (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libpam-systemd:amd64:
 libpam-systemd:amd64 depends on systemd-shim (>= 10-3~) | systemd-sysv; however:
  Package systemd-shim is not configured yet.
  Package systemd-sysv is not installed.

dpkg: error processing package libpam-systemd:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of sysvinit-core:
 sysvinit-core depends on initscripts (>= 2.88dsf-13.3); however:
  Package initscripts is not configured yet.

dpkg: error processing package sysvinit-core (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.24-9) ...
Processing triggers for systemd (232-22) ...
Errors were encountered while processing:
 cgmanager
 initscripts
 systemd-shim
 libpam-systemd:amd64
 sysvinit-core
E: Sub-process /usr/bin/dpkg returned an error code (1)


- at this point, I "did a few things".  EG, dmesg, looked at logs, did an apt-get update...

- tried apt-get -u upgrade, Segfault on cmanager (and others) again.

- after more mucking about, did: mv /etc/apt/preferences.d/systemd /
  (just some place to stash it for temp)

- after?  

# apt-get install sysvinit-utils sysvinit-core
Reading package lists... Done
Building dependency tree
Reading state information... Done
sysvinit-utils is already the newest version (2.88dsf-59.9).
The following additional packages will be installed:
  cgmanager initscripts insserv libcgmanager0 libglib2.0-0 libglib2.0-data libnih-dbus1 libnih1 psmisc
  shared-mime-info startpar systemd-shim sysv-rc xdg-user-dirs
Suggested packages:
  bootchart2 pm-utils bum bootlogd
The following packages will be REMOVED:
  systemd-sysv
The following NEW packages will be installed:
  cgmanager initscripts insserv libcgmanager0 libglib2.0-0 libglib2.0-data libnih-dbus1 libnih1 psmisc
  shared-mime-info startpar systemd-shim sysv-rc sysvinit-core xdg-user-dirs
0 upgraded, 15 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 6,358 kB/6,851 kB of archives.
After this operation, 22.2 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://ftp.us.debian.org/debian stretch/main amd64 systemd-shim amd64 10-3 [20.0 kB]
Get:2 http://ftp.us.debian.org/debian stretch/main amd64 libglib2.0-0 amd64 2.50.3-2 [2,691 kB]
Get:3 http://ftp.us.debian.org/debian stretch/main amd64 libnih1 amd64 1.0.3-8 [125 kB]
Get:4 http://ftp.us.debian.org/debian stretch/main amd64 libnih-dbus1 amd64 1.0.3-8 [96.8 kB]
Get:5 http://ftp.us.debian.org/debian stretch/main amd64 libcgmanager0 amd64 0.41-2 [41.1 kB]
Get:6 http://ftp.us.debian.org/debian stretch/main amd64 cgmanager amd64 0.41-2 [84.0 kB]
Get:7 http://ftp.us.debian.org/debian stretch/main amd64 libglib2.0-data all 2.50.3-2 [2,517 kB]
Get:8 http://ftp.us.debian.org/debian stretch/main amd64 shared-mime-info amd64 1.8-1 [731 kB]
Get:9 http://ftp.us.debian.org/debian stretch/main amd64 xdg-user-dirs amd64 0.15-2+b1 [52.2 kB]
Fetched 6,358 kB in 1s (3,521 kB/s)
Segmentation fault
Selecting previously unselected package insserv.
(Reading database ... 28220 files and directories currently installed.)
Preparing to unpack .../insserv_1.14.0-5.4+b1_amd64.deb ...
Unpacking insserv (1.14.0-5.4+b1) ...
Selecting previously unselected package startpar.
Preparing to unpack .../startpar_0.59-3.1_amd64.deb ...
Unpacking startpar (0.59-3.1) ...
Selecting previously unselected package sysv-rc.
Preparing to unpack .../sysv-rc_2.88dsf-59.9_all.deb ...
Unpacking sysv-rc (2.88dsf-59.9) ...
Selecting previously unselected package initscripts.
Preparing to unpack .../initscripts_2.88dsf-59.9_amd64.deb ...
Unpacking initscripts (2.88dsf-59.9) ...
dpkg: systemd-sysv: dependency problems, but removing anyway as you requested:
 init depends on systemd-sysv | sysvinit-core; however:
  Package systemd-sysv is to be removed.
  Package sysvinit-core is not installed.
 libpam-systemd:amd64 depends on systemd-shim (>= 10-3~) | systemd-sysv; however:
  Package systemd-shim is not installed.
  Package systemd-sysv is to be removed.

(Reading database ... 28320 files and directories currently installed.)
Removing systemd-sysv (232-22) ...
Selecting previously unselected package systemd-shim.
(Reading database ... 28303 files and directories currently installed.)
Preparing to unpack .../00-systemd-shim_10-3_amd64.deb ...
Adding 'diversion of /usr/share/dbus-1/system-services/org.freedesktop.systemd1.service to /usr/share/dbus-1/system-services/org.freedesktop.systemd1.service.systemd by systemd-shim'
Unpacking systemd-shim (10-3) ...
Selecting previously unselected package sysvinit-core.
Preparing to unpack .../01-sysvinit-core_2.88dsf-59.9_amd64.deb ...
Unpacking sysvinit-core (2.88dsf-59.9) ...
Selecting previously unselected package libglib2.0-0:amd64.
Preparing to unpack .../02-libglib2.0-0_2.50.3-2_amd64.deb ...
Unpacking libglib2.0-0:amd64 (2.50.3-2) ...
Selecting previously unselected package libnih1.
Preparing to unpack .../03-libnih1_1.0.3-8_amd64.deb ...
Unpacking libnih1 (1.0.3-8) ...
Selecting previously unselected package libnih-dbus1.
Preparing to unpack .../04-libnih-dbus1_1.0.3-8_amd64.deb ...
Unpacking libnih-dbus1 (1.0.3-8) ...
Selecting previously unselected package libcgmanager0:amd64.
Preparing to unpack .../05-libcgmanager0_0.41-2_amd64.deb ...
Unpacking libcgmanager0:amd64 (0.41-2) ...
Selecting previously unselected package cgmanager.
Preparing to unpack .../06-cgmanager_0.41-2_amd64.deb ...
Unpacking cgmanager (0.41-2) ...
Selecting previously unselected package libglib2.0-data.
Preparing to unpack .../07-libglib2.0-data_2.50.3-2_all.deb ...
Unpacking libglib2.0-data (2.50.3-2) ...
Selecting previously unselected package psmisc.
Preparing to unpack .../08-psmisc_22.21-2.1+b2_amd64.deb ...
Unpacking psmisc (22.21-2.1+b2) ...
Selecting previously unselected package shared-mime-info.
Preparing to unpack .../09-shared-mime-info_1.8-1_amd64.deb ...
Unpacking shared-mime-info (1.8-1) ...
Selecting previously unselected package xdg-user-dirs.
Preparing to unpack .../10-xdg-user-dirs_0.15-2+b1_amd64.deb ...
Unpacking xdg-user-dirs (0.15-2+b1) ...
Setting up psmisc (22.21-2.1+b2) ...
Setting up libglib2.0-0:amd64 (2.50.3-2) ...
No schema files found: doing nothing.
Setting up startpar (0.59-3.1) ...
Setting up libglib2.0-data (2.50.3-2) ...
Processing triggers for libc-bin (2.24-9) ...
Processing triggers for systemd (232-22) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up shared-mime-info (1.8-1) ...
Setting up insserv (1.14.0-5.4+b1) ...
Processing triggers for dbus (1.10.18-1) ...
Setting up xdg-user-dirs (0.15-2+b1) ...
Setting up libnih1 (1.0.3-8) ...
Setting up libnih-dbus1 (1.0.3-8) ...
Setting up libcgmanager0:amd64 (0.41-2) ...
Setting up cgmanager (0.41-2) ...
Segmentation fault
Segmentation fault
Segmentation fault
Segmentation fault
Segmentation fault
Segmentation fault
Segmentation fault
Segmentation fault
Segmentation fault
Segmentation fault
dpkg: error processing package cgmanager (--configure):
 subprocess installed post-installation script returned error exit status 139
Setting up sysv-rc (2.88dsf-59.9) ...
Setting up initscripts (2.88dsf-59.9) ...
Segmentation fault
dpkg: error processing package initscripts (--configure):
 subprocess installed post-installation script returned error exit status 139
dpkg: dependency problems prevent configuration of systemd-shim:
 systemd-shim depends on cgmanager (>= 0.32); however:
  Package cgmanager is not configured yet.

dpkg: error processing package systemd-shim (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libpam-systemd:amd64:
 libpam-systemd:amd64 depends on systemd-shim (>= 10-3~) | systemd-sysv; however:
  Package systemd-shim is not configured yet.
  Package systemd-sysv is not installed.

dpkg: error processing package libpam-systemd:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of sysvinit-core:
 sysvinit-core depends on initscripts (>= 2.88dsf-13.3); however:
  Package initscripts is not configured yet.

dpkg: error processing package sysvinit-core (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.24-9) ...
Processing triggers for systemd (232-22) ...
Errors were encountered while processing:
 cgmanager
 initscripts
 systemd-shim
 libpam-systemd:amd64
 sysvinit-core
E: Sub-process /usr/bin/dpkg returned an error code (1)

(EG, quite a few more packages were pulled in)

- did dpkg --force-all -i perl_5.20.2-3+deb8u6_amd64.deb, still segfault

- did dpkg -i --force-all perl-base_5.20.2-3+deb8u6_amd64.deb, segfault gone, as:

strace -s10024 -f -i -y  -o /tmp/bah dpkg -D10000 -i cgmanager_0.41-2_amd64.deb

succeeded.



Just now, as per your request, I restored 5.24 of both packages.

*Everything is fine now*.

Since I have just installed this system, I can very easily to a
re-install.  I can also do some tests, but before I do, I'll see of the
above kicks any ideas into mind.

If we do more tests, I'll try to get a list of files -- see if 5.20 ->
5.24 left anything extra behind, etc....

Thanks




> 
> Thanks,
> ~Niels
> 
> PS: Please keep me CC'ed in replies.
> 
> [1]
> https://www.debian.org/releases/stretch/amd64/release-notes/ch-whats-new.en.html#debug-archive




More information about the Perl-maintainers mailing list