powerman / perl-Crypt-MatrixSSL3

Perl module: Crypt::MatrixSSL3 - Perl extension for SSL and TLS using MatrixSSL.org
https://metacpan.org/release/Crypt-MatrixSSL3
Other
1 stars 1 forks source link

Fails on perls compiled with -DDEBUGGING #42

Open andk opened 5 years ago

andk commented 5 years ago

As per subject. Sample fail report: http://www.cpantesters.org/cpan/report/100710519

All reports by categories: http://analysis.cpantesters.org/reports_by_field?SUBMIT_xxx=Submit&distv=Crypt-MatrixSSL3-v3.9.2&field=conf%3Accflags%7E-DDEBUGGING&field=conf%3Accflags%7E-DDEBUGGING&field=meta%3Adate&field=meta%3Afrom&field=meta%3Aperl

powerman commented 5 years ago

TBH I've no idea about this. I don't use Perl in last years, and while I'm ready to spend some time maintaining my Perl modules this issue doesn't looks like something I understand and can quickly fix. So, PR is welcome. Or, at least, some hints about possible usual reasons for this issue and/or example of usual fix.

andk commented 2 years ago

These days this issue caught my attention again. My C-level skills are very low, so I'm not able to provide a PR. But some hints that may help others.

A More Recent Report

http://www.cpantesters.org/cpan/report/b2e9e990-b699-11ec-b926-22d9aadf4e95

A Zoom In On The Error Message

perl: sv.c:4834: Perl_sv_setpvn_mg: Assertion `ptr' failed.

A Stack Trace

% gdb /home/sand/src/perl/repoperls/installed-perls/host/k93focal/v5.35.10/e463/bin/perl                               [CPANSHELL]
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.1) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/sand/src/perl/repoperls/installed-perls/host/k93focal/v5.35.10/e463/bin/perl...
(gdb) set args -Mblib t/06.client_server.t
(gdb) run
Starting program: /home/sand/src/perl/repoperls/installed-perls/host/k93focal/v5.35.10/e463/bin/perl -Mblib t/06.client_server.t
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
1..72
ok 1 - Keys->new (server)
ok 2 - $Server_Keys->load_rsa
ok 3 - Server->new
ok 4 - Keys->new (client)
ok 5 - $Client_Keys->load_rsa
ok 6 - Client->new
perl: sv.c:4834: Perl_sv_setpvn_mg: Assertion `ptr' failed.

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff7c31859 in __GI_abort () at abort.c:79
#2  0x00007ffff7c31729 in __assert_fail_base (fmt=0x7ffff7dc7588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x555555842a82 "ptr", file=0x5555559d0b08 "sv.c", line=4834, 
    function=<optimized out>) at assert.c:92
#3  0x00007ffff7c43006 in __GI___assert_fail (assertion=assertion@entry=0x555555842a82 "ptr", file=file@entry=0x5555559d0b08 "sv.c", line=line@entry=4834, 
    function=function@entry=0x5555559e2ae0 <__PRETTY_FUNCTION__.24555> "Perl_sv_setpvn_mg") at assert.c:101
#4  0x000055555571ed00 in Perl_sv_setpvn_mg (my_perl=<optimized out>, sv=sv@entry=0x555556611510, ptr=ptr@entry=0x0, len=len@entry=0) at sv.c:4837
#5  0x00007ffff7609102 in XS_Crypt__MatrixSSL3__SessPtr_received_data (my_perl=<optimized out>, cv=<optimized out>) at MatrixSSL3.xs:2004
#6  0x00005555556ecedd in Perl_pp_entersub (my_perl=0x555555a712a0) at pp_hot.c:5352
#7  0x000055555569ca42 in Perl_runops_debug (my_perl=0x555555a712a0) at dump.c:2634
#8  0x00005555555e3cf3 in S_run_body (oldscope=1, my_perl=0x555555a712a0) at perl.c:2705
#9  perl_run (my_perl=0x555555a712a0) at perl.c:2628
#10 0x00005555555a14ce in main (argc=<optimized out>, argv=<optimized out>, env=<optimized out>) at perlmain.c:110
(gdb) 

A Bisect

This failing test is related to a perl commit that introduced the assertion. git bisect leads us to:

  6ba07ce12b615587e55caf4477539992d4b3e79b is the first bad commit
  commit 6ba07ce12b615587e55caf4477539992d4b3e79b
  Author: Jarkko Hietaniemi <jhi@iki.fi>
  Date:   Fri Aug 7 22:14:55 2015 -0400