Skip Menu |

This queue is for tickets about the Syntax-Keyword-Try CPAN distribution.

Report information
The Basics
Id: 123547
Status: resolved
Priority: 0/
Queue: Syntax-Keyword-Try

Owner: Nobody in particular
Requestors: bash [...]

Bug Information
Severity: (no value)
Broken in: 0.08
Fixed in: 0.09

Subject: Syntax::Keyword::Try crash (core dump) under threads
Download (untitled) / with headers
text/plain 686b
The problem rise if package that uses Syntax::Keyword::Try is not loaded before threads starts. gdb: [New LWP 233017] [New LWP 233016] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/". Core was generated by `perl bin/'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007f3a50f68a20 in my_keyword_plugin (my_perl=<optimized out>, kw=kw@entry=0x7f3a4c2ccdf8 "use", kwlen=kwlen@entry=3, op=op@entry=0x7f3a525abc28) at lib/Syntax/Keyword/Try.xs:445 445 if(PL_parser && PL_parser->error_count) [Current thread is 1 (Thread 0x7f3a525ae700 (LWP 233017))] OS: Ubuntu 16.04 Perl: 5.22.1
Download (untitled) / with headers
text/plain 928b
This turns out to be a fundamental design limitation in how the perl core custom keyword hook mechanism works. It's not really thread-safe :( Other syntax-providing modules are also affected by this. E.g. mauke's Functional::Parameters had to fix it similarly: I've applied the same hack of a fix, which is to borrow the OP_CHECK_MUTEX for a locking structure here, until the custom keyword plugin hook gets its own. This does have a slight limitation that it doesn't work on 5.14, because that mutex was only added on 5.16. For perl 5.14, this race condition remains, and will have to be solved by use Syntax::Keyword::Try; before starting up any additional threads that might dynamically load code later on. -- Paul Evans
Download (untitled) / with headers
text/plain 246b
I'm going to close this one because it's effectively resolved. Perl 5.16 and above are fine; and 5.14 is fundamentally unresolveable due to its lack of a locking mutex, but a workaround is documented concerning module load order. -- Paul Evans

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to