Summary: | >=dev-lang/perl-5.16 causes module Carp.pm to crash, when started from Pidgin with Perl plugin support. - #0 0x00007fffe5368a25 in Perl__invlist_union_maybe_complement_2nd () from /usr/lib64/libperl.so.5.16 | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Andrei Mihăilă <andrei.mihaila> |
Component: | [OLD] Development | Assignee: | Gentoo Perl team <perl> |
Status: | RESOLVED TEST-REQUEST | ||
Severity: | normal | CC: | net-im |
Priority: | Normal | ||
Version: | 10.1 | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
Pidgin backtrace when it crashes with the Perl plugin
Log of emerge -1 pidgin List of packages emerged by perl-cleaner Full backtrace info log of pidgin under OpenSuse 12.3 |
Description
Andrei Mihăilă
2013-07-01 19:55:52 UTC
Created attachment 352422 [details]
Pidgin backtrace when it crashes with the Perl plugin
You probably need to run perl-cleaner... *** This bug has been marked as a duplicate of bug 247315 *** (In reply to Jeroen Roovers from comment #2) > You probably need to run perl-cleaner... > > *** This bug has been marked as a duplicate of bug 247315 *** Did run perl-cleaner (sorry, only mentioned it in the forum post - did a perl-cleaner --reallyall) with no result, the issue is still there. 23:23:06) plugins: /usr/lib64/purple-2/libjabber.so is not usable because the 'purple_init_plugin' symbol could not be found ^ suggests its a compile time issue. So try recompiling/reinstalling pidgin, and if that still fails, please attach a copy of your pidgin build log. If recompiling pidgin solves the issue, then its a case of why perlcleaner didn't detect it needing reinstalled. Created attachment 352546 [details]
Log of emerge -1 pidgin
Compiled perl 5.16.3 and then ran something like perl-cleaner --reallyall -- --keep-going -v > perl-cleaner.log 2>&1. Pidgin still crashes with roughly the same backtrace. The perl-cleaner.log is 4.4M ... won't attach all of that - just the list of packages it emerged (pidgin was included). Re-emerged pidgin, attached the log of that.
Created attachment 352548 [details]
List of packages emerged by perl-cleaner
Okay, thank you for running those commands and confirming; assigned to Perl herd. Searching has dug up this: http://mail-archives.apache.org/mod_mbox/perl-modperl/201208.mbox/%3Calpine.DEB.2.02.1208211101080.7649@localhost6.localdomain6%3E Suggesting it could be a specific regular expression in Carp ( at least, that is what causes a similar problem on mod_perl ) If you can reduce the test code to something that fails the same way without 'use Purple', that would be incredibly helpful, because I'm a little short on knowing how to diagnose this sort of problem. Yes, I found that page too - the suggestion might be correct. The problem is I can't make the perl interpreter crash when run from a command line (the issue only appears when starting Pidgin with a perl module activated). The problem seems to be in /usr/lib64/purple-2/perl/Purple.pm - a module that exports some functions from purple.so (really don't know anything about the way that is done). I tried modifying it - removed the 'use Carp;' line and replaced the 'croak' invocations with 'die'. I'm getting roughly the same backtrace. If I remove more of the code there I get an assertion_failed, but I don't think that helps. Also compiled perl with USE="debug" (and ran perl-cleaner afterwards as instructed by the perl ebuild) - nothing helpful unfortunately. Have you been able to reproduce the bug based on my instructions? Yeah, it doesn't even require you load Purple to make it crash. You can make it crash with as little as: --- use strict; use Carp; --- Fails pretty hard :/ I don't know where to go from here, looks like upstreams problem. We might be lucky and find its fixed in 5.18. As a reductionist set, this also fails under Pidgin, but not natively: ---- #!/usr/bin/env perl use strict; use warnings; use utf8; BEGIN { package Carp; sub croak { } $INC{'Carp.pm'} = 1; } our %PLUGIN_INFO = ( perl_api_version => 2, name => "test", load => "test" ); sub IWillNeverRun() { my $arg; utf8::is_utf8($arg) or $arg =~ s/([[:cntrl:]]|[[:^ascii:]])/sprintf("\\x{%x}",ord($1))/eg; } sub test() { } --- The important part to note is this is not a /runtime/ failure within perl, but a /compile/ time failure, ie: it crashes as soon as a file with that regular expression it it is sourced ( for some reason ) Finally reproduced! Thank you! I remember I tested on OpenSuse with Perl 5.16 and my Pidgin plugin worked so it could be that they somehow fixed that there. Will try again when I have the chance and confirm this. Created attachment 353168 [details]
Full backtrace info
Recompiled perl and pidgin with FEATURES="splitdebug compressdebug installsources keepwork" CFLAGS+="-O1 -ggdb3"
Attached is full debug backtrace given. Though, it doesn't make more sense to me than it already did.
The exact source in C where the segv is comming from:
PERL_STATIC_INLINE SV*
S_invlist_clone(pTHX_ SV* const invlist)
{
/* Return a new inversion list that is a copy of the input one, which is
* unchanged */
/* Need to allocate extra space to accommodate Perl's addition of a
* trailing NUL to SvPV's, since it thinks they are always strings */
SV* new_invlist = _new_invlist(invlist_len(invlist) + 1); ########## <----
STRLEN length = SvCUR(invlist);
PERL_ARGS_ASSERT_INVLIST_CLONE;
SvCUR_set(new_invlist, length); /* This isn't done automatically */
Copy(SvPVX(invlist), SvPVX(new_invlist), length, char);
return new_invlist;
}
If you want a copy of my builds with debug for pidgin and perl, here are some quickpkgs https://mega.co.nz/#F!B5gXjbLa!WE-UTkoJhhFDT7ziNYOg9A Created attachment 353394 [details] log of pidgin under OpenSuse 12.3 I can confirm the plugin works on Open Suse 12.3 Live KDE DVD (http://software.opensuse.org/123/en). It has perl 5.16.2 and pidgin 2.10.7. There were some issues on the first run (had to restart Pidgin) but my plugin and the code above that crash Pidgin in Gentoo worked (log of the issues before restarting Pidgin attached). Also did perl test.pl where test.pl contains --- use strict; use Carp; --- ... no problems. linux@linux:~> perl -V Summary of my perl5 (revision 5 version 16 subversion 2) configuration: Platform: osname=linux, osvers=3.4.6-2.10-default, archname=x86_64-linux-thread-multi uname='linux build35 3.4.6-2.10-default #1 smp thu jul 26 09:36:26 utc 2012 (641c197) x86_64 x86_64 x86_64 gnulinux ' config_args='-ds -e -Dprefix=/usr -Dvendorprefix=/usr -Dinstallusrbinperl -Dusethreads -Di_db -Di_dbm -Di_ndbm -Di_gdbm -Dd_dbm_open -Duseshrplib=true -Doptimize=-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -Wall -pipe -Accflags=-DPERL_USE_SAFE_PUTENV -Dotherlibdirs=/usr/lib/perl5/site_perl' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -Wall -pipe', cppflags='-D_REENTRANT -D_GNU_SOURCE -DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -fstack-protector' ccversion='', gccversion='4.7.2 20130108 [gcc-4_7-branch revision 195012]', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib64 -fstack-protector' libpth=/lib64 /usr/lib64 /usr/local/lib64 libs=-lm -ldl -lcrypt -lpthread perllibs=-lm -ldl -lcrypt -lpthread libc=/lib64/libc-2.17.so, so=so, useshrplib=true, libperl=libperl.so gnulibc_version='2.17' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/lib/perl5/5.16.2/x86_64-linux-thread-multi/CORE' cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib64 -fstack-protector' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP PERL_PRESERVE_IVUV PERL_USE_SAFE_PUTENV USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API Built under linux Compiled at Jan 26 2013 22:01:51 @INC: /usr/lib/perl5/site_perl/5.16.2/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.16.2 /usr/lib/perl5/vendor_perl/5.16.2/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.16.2 /usr/lib/perl5/5.16.2/x86_64-linux-thread-multi /usr/lib/perl5/5.16.2 /usr/lib/perl5/site_perl/5.16.2/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.16.2 /usr/lib/perl5/site_perl . Pidgin 2.10.7 (libpurple 2.10.7) unknown Build Information Arguments to ./configure: '--host=x86_64-suse-linux-gnu' '--build=x86_64-suse-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/lib' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-dependency-tracking' '--disable-static' '--disable-schemas-install' '--enable-plugins' '--enable-cyrus-sasl' '--disable-mono' '--enable-gstreamer' '--enable-nm' '--enable-dbus' '--enable-devhelp' '--disable-vv' '--with-tclconfig=/usr/lib64' '--with-tkconfig=/usr/lib64' '--with-system-ssl-certs=/etc/ssl/certs' 'build_alias=x86_64-suse-linux-gnu' 'host_alias=x86_64-suse-linux-gnu' 'CFLAGS=-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -fstack-protector -fPIC' 'LDFLAGS=-pie' Print debugging messages: No Plugins: Enabled SSL: SSL support is present. Library Support Cyrus SASL: Enabled D-Bus: Enabled Evolution Addressbook: Disabled Gadu-Gadu library (libgadu): Enabled GtkSpell: Enabled GnuTLS: Enabled GStreamer: Enabled Mono: Disabled NetworkManager: Enabled Network Security Services (NSS): Enabled Perl: Enabled Tcl: Enabled Tk: Enabled UTF-8 DNS (IDN): Enabled Voice and Video: Disabled X Session Management: Enabled XScreenSaver: Enabled Zephyr library (libzephyr): Internal Zephyr uses Kerberos: No Also I must say that the version of Perl that I have installed in Gentoo (5.16.3) doesn't crash with --- use strict; use Carp; --- However the Pidgin plugin with the code provided by Kent Fredric does crash it. Try with dev-lang/perl-5.18.2 please. And reopen if problem still present (just can't check it). Unfortunately the bug is still there (for me at least). Installed perl 5.18.2 then ran perl-cleaner --reallyall (that didn't rebuild Pidgin but I did it manually). The code provided by Kent Frederic behaves the same as before ("fails under Pidgin, but not natively"). Here is the (truncated) backtrace: --- (22:52:25) plugins: probing /home/mad/.purple/plugins/test.pl pidgin: regcomp.c:7577: Perl__invlist_union_maybe_complement_2nd: Assertion `a != b' failed. Program received signal SIGABRT, Aborted. 0x00007ffff476f249 in raise () from /lib64/libc.so.6 (gdb) bt #0 0x00007ffff476f249 in raise () from /lib64/libc.so.6 #1 0x00007ffff47705a8 in abort () from /lib64/libc.so.6 #2 0x00007ffff4768386 in ?? () from /lib64/libc.so.6 #3 0x00007ffff4768432 in __assert_fail () from /lib64/libc.so.6 #4 0x00007fffe7bb2d95 in Perl__invlist_union_maybe_complement_2nd () from /usr/lib64/libperl.so.5.18 #12 0x00007fffe7bd2bfc in Perl_re_op_compile () from /usr/lib64/libperl.so.5.18 #13 0x00007fffe7b57bf7 in Perl_pmruntime () from /usr/lib64/libperl.so.5.18 #14 0x00007fffe7b9fa3d in Perl_yyparse () from /usr/lib64/libperl.so.5.18 (gdb) --- With my plugin the (truncated) backtrace is: --- (22:46:40) plugins: probing /home/mad/.purple/plugins/libpurple_kwallet_plugin.pl (22:46:43) perl: Loading perl script pidgin: inline_invlist.c:60: S__invlist_len: Assertion `invlist' failed. Program received signal SIGABRT, Aborted. 0x00007ffff476f249 in raise () from /lib64/libc.so.6 (gdb) bt #0 0x00007ffff476f249 in raise () from /lib64/libc.so.6 #1 0x00007ffff47705a8 in abort () from /lib64/libc.so.6 #2 0x00007ffff4768386 in ?? () from /lib64/libc.so.6 #3 0x00007ffff4768432 in __assert_fail () from /lib64/libc.so.6 #4 0x00007fffe7b3b962 in ?? () from /usr/lib64/libperl.so.5.18 #5 0x00007fffe7bb1762 in Perl__invlist_intersection_maybe_complement_2nd () from /usr/lib64/libperl.so.5.18 #16 0x00007fffe7bd2bfc in Perl_re_op_compile () from /usr/lib64/libperl.so.5.18 #17 0x00007fffe7b57bf7 in Perl_pmruntime () from /usr/lib64/libperl.so.5.18 #18 0x00007fffe7b9fa3d in Perl_yyparse () from /usr/lib64/libperl.so.5.18 --- Finally :D try 5.20 Just not sure about the bug It works :-), thank you (and sorry for then long delay)! Will test on some other machines in the next few days (when I get to them). But it should be fine. |