Bug 1269168
Summary: | perl segfaults in Perl_mg_get() | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Jindrich Novy <jindrich.novy> | ||||
Component: | perl | Assignee: | perl-maint-list | ||||
Status: | CLOSED INSUFFICIENT_DATA | QA Contact: | BaseOS QE - Apps <qe-baseos-apps> | ||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 7.2 | CC: | mkyral, ppisar, sohnythomas | ||||
Target Milestone: | rc | ||||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
URL: | https://rt.perl.org/Public/Bug/Display.html?id=107480 | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Release Note | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2019-02-26 11:25:57 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Bug Depends On: | |||||||
Bug Blocks: | 1298243, 1473612 | ||||||
Attachments: |
|
Description
Jindrich Novy
2015-10-06 13:46:46 UTC
I'm happy to troubleshoot as you obviously don't have access to our internal code. Feel free to let me know if I can help. It's easily reproducible every time within our environment. Please contact Red Hat support to help you with debugging the code. I cannot do much without a reproducer. I've already filed a support case: https://access.redhat.com/support/cases/#/case/01518741 Just making sure Perl devels know about this bug so that I can help investigating/testing. The bug looks like a corruptions of a variable's internal metadata representation when cloning it into a new variable. Very probably the original variable was clobbered somewhere else before reaching this code. Therefore it's impossible to debug it without a reproducer. Moreover it involves some hairy interpreter code that changes each perl version that even the authors do not understand as you could read in the upstream bug report. So I don't believe in fixing this issue any soon. I can give you only a generic piece of advice: Minimize the reproducer, especially avoid non-core XS modules (the modules thas has a DSO counterpart and are not listed in `corelist -v v5.16.3' output). This allows you to test the reproducer against different perl builds. Then download upstream perl sources <git://perl5.git.perl.org/perl.git>, checkout v5.16.3 tag, build it, you can use this long command that works with old perls on old RHELs: $ sh Configure -des -Dusedevel \ -Dusethreads -Duseithreads -Dldflags="-lm -lpthread" \ -Accflags="-I/usr/src/kernels/$(uname -r)/arch/x86/include" && \ perl -ni -we 'print unless /<(?:built-in|command)/' makefile x2p/makefile && \ ( make -j5 test_prep || make -j5 ) and try the reproducer again executing like `./perl -Ilib ...'. If you can reproduce it with this upstream version, then try v5.16.0 tag which is on the `blead' git branch that contains all the major perl version (v5.12.0 etc.) in linear history (this is important for fluent git bisect), find a first working major version (e.g. the v5.12.0 is mentioed in the upstream report) and then bisect the history to find first commit leading to the bug. Don't forget to prune the git tree (git clean -dxf; git checkout -f) before building each new commit as the build script does not count dependencies properly. Good luck. Thanks. The segfault seems to be related to tainting warnings machinery in Perl. Without -t option the code runs as expected without segfaults. Created attachment 1086819 [details]
Attaching core file in case you want to have a look.
What perl did you run when generating the core dump? my gdb states /usr/lib/debug/.build-id/d7/34b2d4aaf3ad9581268cac0f1e498a914822ff, but the perl-debuginfo-5.16.3-286.el7.x86_64 delivers /usr/lib/debug/.build-id/f4/4bbae67a26208e2c4c6b3fd29af70c068f2ccc.1.debug. The hashes do not match. The version is perl-5.16.3-285.el7.x86_64 (latest RHEL7). It crashed after nested module loading at /usr/share/perl5/feature.pm:10 (defining "our %feature"). I cannot get the Perl call stack trace from a core dump. Putting "Carp::cluck()" before the line could help you to figure out how perl got there. Also I noticed a /lib64/bash_ld_preload.so library in use that is unknown to me. I am getting a crash at the following when running an internal perl installation script (/opt/ulticom/snr/swinstall/nsi/bin/../lib/IO/Pty.pm:20): 20: my ($class) = $_[0] || "IO::Pty"; DB<3> n IO::Pty::new(/opt/ulticom/snr/swinstall/nsi/bin/../lib/IO/Pty.pm:21): 21: $class = ref($class) if ref($class); DB<3> IO::Pty::new(/opt/ulticom/snr/swinstall/nsi/bin/../lib/IO/Pty.pm:22): 22: @_ <= 1 or croak 'usage: new $class'; DB<3> IO::Pty::new(/opt/ulticom/snr/swinstall/nsi/bin/../lib/IO/Pty.pm:24): 24: my ($ptyfd, $ttyfd, $ttyname) = pty_allocate(); DB<3> s IO::Pty::pty_allocate(/usr/share/perl5/vendor_perl/Carp.pm:79): 79: my $cgc = _cgc(); DB<3> nn DB<4> n IO::Pty::pty_allocate(/usr/share/perl5/vendor_perl/Carp.pm:80): 80: my $call_pack = $cgc ? $cgc->() : caller(); DB<4> IO::Pty::pty_allocate(/usr/share/perl5/vendor_perl/Carp.pm:81): 81: if ( $Internal{$call_pack} or $CarpInternal{$call_pack} ) { DB<4> IO::Pty::pty_allocate(/usr/share/perl5/vendor_perl/Carp.pm:85): 85: local $CarpLevel = $CarpLevel + 1; DB<4> IO::Pty::pty_allocate(/usr/share/perl5/vendor_perl/Carp.pm:86): 86: return longmess_heavy(@_); DB<4> Signal SEGV at /opt/ulticom/snr/swinstall/nsi/bin/../lib/Expect.pm line 81. Expect::new('Expect') called at /opt/ulticom/snr/swinstall/nsi/bin/../lib/Ulcm/SHELL/Expect.pm line 76 Ulcm::SHELL::Expect::run_shell('Ulcm::SHELL::Expect=HASH(0x3b051c8)') called at /opt/ulticom/snr/swinstall/nsi/bin/../lib/Ulcm/SHELL/Expect.pm line 101 Ulcm::SHELL::Expect::start('Ulcm::SHELL::Expect=HASH(0x3b051c8)') called at /opt/ulticom/snr/swinstall/nsi/bin/../lib/Ulcm/Utils.pm line 619 eval {...} called at /opt/ulticom/snr/swinstall/nsi/bin/../lib/Ulcm/Utils.pm line 616 Ulcm::Utils::utl_cmd('/bin/sync;/bin/sync') called at /opt/ulticom/snr/swinstall/nsi/bin/../lib/Ulcm/Utils.pm line 1644 Ulcm::Utils::utl_write_xml('/opt/ulticom/snr/Logs/swnsiupg.xml', 'HASH(0x3ae4b00)') called at /opt/ulticom/snr/swinstall/nsi/bin/../lib/Ulcm/SwUpgrade.pm line 147 Ulcm::SwUpgrade::write_state('Ulcm::PkgUpg=HASH(0x3abdce0)') called at /opt/ulticom/snr/swinstall/nsi/bin/../lib/Ulcm/PkgUpg.pm line 659 Ulcm::PkgUpg::upgrade_first_group('Ulcm::PkgUpg=HASH(0x3abdce0)') called at /opt/ulticom/snr/swinstall/nsi/bin/swnsiupg line 258 eval {...} called at /opt/ulticom/snr/swinstall/nsi/bin/swnsiupg line 149 Aborted (core dumped) (In reply to sohny thomas from comment #12) > I am getting a crash at the following when running an internal perl > installation script > It would be great if you could provide a reproducer. Please ask the /opt/ulticom software vendor for a help. The trace says the Expect cannot create a PTY using IO::Pty::pty_allocate(), thus raises an exception using Carp::longmess(). This call involves long jumps with stack unwinding. And something goes wrong and the program crashes. Without any details I even cannot conclude if the crash is similar to the original one reported by Jindrich Novy. (In reply to Petr Pisar from comment #13) > (In reply to sohny thomas from comment #12) > > I am getting a crash at the following when running an internal perl > > installation script > > > It would be great if you could provide a reproducer. Please ask the > /opt/ulticom software vendor for a help. Oh , I am part of ulticom , I can reproduce this on redhat 7 but on redhat 6 it just works flawlessly. I have this perl install file which makes use of the perl-IO-Tty package , from the top down view , i just see that only the perl version has changed from 5.10 to 5.16 . Let me know if I missed something or I need to provide anything more. I will try to create a repoducer perl script Maybe a related bug <https://rt.perl.org/Public/Bug/Display.html?id=130320>. No reproducer has been provided. |