Skip Menu |

This queue is for tickets about the re-engine-GNU CPAN distribution.

Report information
The Basics
Id: 120498
Status: resolved
Priority: 0/
Queue: re-engine-GNU

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc: ANDK [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.021
Fixed in: 0.024



CC: ANDK [...] cpan.org
Subject: t/thread.t fails (perl >= 5.25.6)
t/thread.t segfaults with threaded bleadperls, since about perl 5.25.6. Sample fail reports are visible at http://matrix.cpantesters.org/?dist=re-engine-GNU+0.021 @Andreas: a bisect candidate?
http://www.cpantesters.org/cpan/report/36d2f7cc-952d-11e6-9d8c-fd3fe822d6a9 seems to indicate this is the case since 5.24 maybe (?). It is saying: perl: sv.c:4836: Perl_sv_setsv_cow: Assertion `((sstr)->sv_flags & (0x00000400|0x00000800|0x00004000|0x01000000| 0x02000000|0x04000000|0x08000000|0x00010000)) == (0x00004000|0x00000400)' failed. Could any perl guru help me in here... ? Thanks. On Sat Mar 04 08:39:48 2017, SREZIC wrote: Show quoted text
> t/thread.t segfaults with threaded bleadperls, since about perl > 5.25.6. > Sample fail reports are visible at > http://matrix.cpantesters.org/?dist=re-engine-GNU+0.021 > > @Andreas: a bisect candidate?
Now also reported as https://rt.perl.org/Public/Bug/Display.html?id=130921 With my bleadperl v5.25.5-100-g2b5e7bc2e6 the SEGV is like this: Program terminated with signal SIGSEGV, Segmentation fault. #0 Perl_save_pushptr (my_perl=my_perl@entry=0x55a43454a110, ptr=ptr@entry=0x55a43533c280, type=type@entry=10) at scope.c:571 571 SS_ADD_PTR(ptr); (gdb) bt #0 Perl_save_pushptr (my_perl=my_perl@entry=0x55a43454a110, ptr=ptr@entry=0x55a43533c280, type=type@entry=10) at scope.c:571 #1 0x000055a432a22683 in Perl_utf8n_to_uvchr (my_perl=0x55a43454a110, s=0x7ffcb0cb1108 "", s@entry=0x7ffcb0cb1107 "\300", curlen=1, retlen=retlen@entry=0x7ffcb0cb10b0, flags=flags@entry=16384) at utf8.c:1054 #2 0x00007f555fd0deb4 in rpl_Perl_mbrtowc (my_perl=<optimized out>, pwc=0x7ffcb0cb10f8, s=0x7ffcb0cb1107 "\300", n=<optimized out>, ps=<optimized out>) at regex_internal.h:1355 #3 0x00007f555fd0e150 in rpl_Perl_mbtowc (my_perl=<optimized out>, pwc=<optimized out>, s=<optimized out>, n=<optimized out>) at regex_internal.h:1393 #4 0x00007f555fd0e1aa in rpl_Perl_btowc (my_perl=<optimized out>, c=<optimized out>) at regex_internal.h:1414 #5 0x00007f555fd18cfe in init_dfa (is_utf8=<optimized out>, pat_len=<optimized out>, dfa=0x55a43532ae40, my_perl=0x55a43454a110) at regcomp.c:937 #6 re_compile_internal (my_perl=my_perl@entry=0x55a43454a110, preg=preg@entry=0x55a43532add8, pattern=pattern@entry=0x55a43532ae20 "\\([^x]\\)\\(x\\)", length=<optimized out>, syntax=<optimized out>, is_utf8=<optimized out>) at regcomp.c:781 #7 0x00007f555fd19652 in GNU_dupe (my_perl=0x55a43454a110, rx=0x55a43531b7f0, param=<optimized out>) at GNU.xs:1021 #8 0x000055a432965770 in Perl_re_dup_guts (my_perl=my_perl@entry=0x55a43454a110, sstr=sstr@entry=0x55a434ec19b8, dstr=dstr@entry=0x55a43531b7f0, param=param@entry=0x7ffcb0cb1450) at regcomp.c:19611 #9 0x000055a4329be891 in S_sv_dup_common (my_perl=my_perl@entry=0x55a43454a110, sstr=0x55a434ec19b8, param=param@entry=0x7ffcb0cb1450) at sv.c:13815 #10 0x000055a4329bf228 in Perl_sv_dup_inc (param=0x7ffcb0cb1450, sstr=<optimized out>, my_perl=0x55a43454a110) at sv.c:14049 #11 S_sv_dup_inc_multiple (my_perl=my_perl@entry=0x55a43454a110, source=0x55a434d3c5c0, source@entry=0x55a434d3be30, dest=0x55a4352f5170, dest@entry=0x55a4352f49e0, items=0, items@entry=242, param=param@entry=0x7ffcb0cb1450) at sv.c:13618 #12 0x000055a4329bf08d in S_sv_dup_common (my_perl=my_perl@entry=0x55a43454a110, sstr=0x55a434522b68, param=param@entry=0x7ffcb0cb1450) at sv.c:13884 #13 0x000055a4329c9419 in Perl_sv_dup_inc (param=0x7ffcb0cb1450, sstr=<optimized out>, my_perl=0x55a43454a110) at sv.c:14049 #14 perl_clone (proto_perl=proto_perl@entry=0x55a434520010, flags=flags@entry=2) at sv.c:15058 #15 0x00007f556118872e in S_ithread_create (num_params=1, params_start=8, exit_opt=0, gimme=<optimized out>, stack_size=0, init_function=0x55a434541018, my_pool=0x55a4345d51d0, parent_perl=0x55a434520010) at threads.xs:829 #16 XS_threads_create (my_perl=0x55a434520010, cv=<optimized out>) at threads.xs:1148 #17 0x000055a4329ad380 in Perl_pp_entersub (my_perl=0x55a434520010) at pp_hot.c:3983 #18 0x000055a4329a56b6 in Perl_runops_standard (my_perl=0x55a434520010) at run.c:41 #19 0x000055a43292bba9 in S_run_body (oldscope=1, my_perl=0x55a434520010) at perl.c:2526 #20 perl_run (my_perl=0x55a434520010) at perl.c:2449 #21 0x000055a43290443d in main (argc=<optimized out>, argv=<optimized out>, env=<optimized out>) at perlmain.c:123
Before v5.25.5-100-g2b5e7bc2e6 I see reproducable fails with a few perls but most perls pass the test. Here is a 5.25.5 stacktrace after an assert failure: Core was generated by `/home/sand/src/perl/repoperls/installed-perls/host/k93msid/v5.25.5/276a/bin/per'. Program terminated with signal SIGABRT, Aborted. #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58 58 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. [Current thread is 1 (Thread 0x7f7fbd4eb700 (LWP 17983))] (gdb) bt #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58 #1 0x00007f7fbf15540a in __GI_abort () at abort.c:89 #2 0x00007f7fbf14ce47 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x55fa6fae7ef8 "(SvFLAGS(sstr) & CAN_COW_MASK) == CAN_COW_FLAGS", file=file@entry=0x55fa6fae2290 "sv.c", line=line@entry=4832, function=function@entry=0x55fa6faf0510 <__PRETTY_FUNCTION__.19330> "Perl_sv_setsv_cow") at assert.c:92 #3 0x00007f7fbf14cef2 in __GI___assert_fail ( assertion=assertion@entry=0x55fa6fae7ef8 "(SvFLAGS(sstr) & CAN_COW_MASK) == CAN_COW_FLAGS", file=file@entry=0x55fa6fae2290 "sv.c", line=line@entry=4832, function=function@entry=0x55fa6faf0510 <__PRETTY_FUNCTION__.19330> "Perl_sv_setsv_cow") at assert.c:101 #4 0x000055fa6f992288 in Perl_sv_setsv_cow (my_perl=my_perl@entry=0x55fa704ec700, dstr=0x55fa70f4c758, sstr=sstr@entry=0x55fa71333970) at sv.c:4832 #5 0x00007f7fbd501995 in GNU_exec_set_capture_string (utf8_target=1, flags=97, sv=0x55fa71333970, strend=0x55fa7133a402 "", strbeg=<optimized out>, rx=0x55fa70f4c770, my_perl=0x55fa704ec700) at GNU.xs:526 #6 GNU_exec (my_perl=0x55fa704ec700, rx=0x55fa70f4c770, stringarg=<optimized out>, strend=0x55fa7133a402 "", strbeg=<optimized out>, minend=<optimized out>, sv=0x55fa71333970, data=0x0, flags=97) at GNU.xs:777 #7 0x000055fa6f969882 in Perl_pp_match (my_perl=0x55fa704ec700) at pp_hot.c:1836 #8 0x000055fa6f934c3a in Perl_runops_debug (my_perl=0x55fa704ec700) at dump.c:2239 #9 0x000055fa6f88fefe in Perl_call_sv (my_perl=my_perl@entry=0x55fa704ec700, sv=<optimized out>, flags=flags@entry=11) at perl.c:2850 #10 0x00007f7fbe99e77e in S_jmpenv_run (my_perl=my_perl@entry=0x55fa704ec700, action=action@entry=0, thread=thread@entry=0x55fa704d9d80, len_p=len_p@entry=0x7f7fbd4eaf14, exit_app_p=exit_app_p@entry=0x7f7fbd4eaf0c, exit_code_p=exit_code_p@entry=0x7f7fbd4eaf10) at threads.xs:497 #11 0x00007f7fbe99ea9f in S_ithread_run (arg=0x55fa704d9d80) at threads.xs:591 #12 0x00007f7fc0021464 in start_thread (arg=0x7f7fbd4eb700) at pthread_create.c:333 #13 0x00007f7fbf2099df in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105
The pattern in the test failures before v5.25.5-100-g2b5e7bc2e6 is apparently that those failing with the assertion failure were compiled with -DDEBUGGING.
From: davem [...] iabyn.com
On Sun Mar 05 01:24:19 2017, ANDK wrote: Show quoted text
> The pattern in the test failures before v5.25.5-100-g2b5e7bc2e6 is > apparently that those failing with the assertion failure were compiled > with -DDEBUGGING.
More particularly, the bug occurs in threaded builds and then triggers an assertion if DEBUGGING has been enabled. The #130921 rt.perl.org ticket mentioned above contains a diagnosis of this second issue: re-engine-GNU is treating a string as COWable (using a non-API function) when it hasn't first checked that the string is COWable. So in summary: the initial issue was caused by a bug introduced in bleadperl, and is now also fixed in bleadperl. The secondary issue has been present in threaded builds for a while, and is a bug in re-engine-GNU.