Skip Menu |
Report information
Id: 126350
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: shoichikaji [at]

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)

Subject: [BUG] segmentation fault with precompile + add_method
To: rakudobug [...]
Date: Wed, 14 Oct 2015 01:20:37 +0900
From: Shoichi Kaji <shoichikaji [...]>
Download (untitled) / with headers
text/plain 765b
The following script exits with segmentation fault. (code is also available at ``` #!/bin/bash set -xu rm -rf lib mkdir lib cat >lib/A.pm6 <<'EOF'; class B {} class A { sub foo($b, *@) {} BEGIN { B.^add_method: 'bar', method () { foo(self) }; } } EOF perl6-m --target=mbc --output=lib/A.pm6.moarvm lib/A.pm6 perl6-m -Ilib -MA -e '' ``` ``` $ bash + rm -rf lib + mkdir lib + cat + perl6-m --target=mbc --output=lib/A.pm6.moarvm lib/A.pm6 + perl6-m -Ilib -MA -e line 19: 31493 Segmentation fault perl6-m -Ilib -MA -e '' ``` My perl version is: $ perl6-m -v This is perl6 version 2015.09-360-g154f44b built on MoarVM version 2015.09-79-gee9fc2b
RT-Send-CC: perl6-compiler [...]
Download (untitled) / with headers
text/plain 268b
It seems to segfault in the op getlex when trying to locate &foo. Moving sub foo to within the BEGIN block helps and moving it outside of A gives: Cannot invoke this object in method <anon> at lib/A.pm6:5 Neither the rakudo optimizer nor spesh seem to be to blame.
To clarify: f in getlex after the while loop is null.
To: perl6-compiler [...]
From: Nicholas Clark <nick [...]>
Date: Wed, 14 Oct 2015 10:14:29 +0100
Subject: Re: [perl #126350] [BUG] segmentation fault with precompile + add_method
Download (untitled) / with headers
text/plain 946b
On Tue, Oct 13, 2015 at 09:20:54AM -0700, Shoichi Kaji wrote: Show quoted text
> + perl6-m -Ilib -MA -e > line 19: 31493 Segmentation fault perl6-m -Ilib -MA -e '' > ```
$ ./perl6-m -Ilib -MA -e '' ASAN:SIGSEGV ================================================================= ==27416==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000008 (pc 0x7f78d5719316 sp 0x7fffff5a7640 bp 0x7fffff5a8ff0 T0) #0 0x7f78d5719315 in MVM_interp_run src/core/interp.c:196 #1 0x7f78d59e757e in MVM_vm_run_file src/moar.c:243 #2 0x401a4f in main src/main.c:191 #3 0x7f78d4f7ad5c in __libc_start_main (/lib64/ #4 0x401058 (/home/nicholas/Sandpit/moar-san/bin/moar+0x401058) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV src/core/interp.c:196 MVM_interp_run ==27416==ABORTING So there's nothing wrong happening before a NULL pointer dereference. Nicholas Clark

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

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at