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

Owner: Nobody
Requestors: carlin <cb [at] viennan.net>
Cc:
AdminCc:

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



To: rakudobug [...] perl.org
From: Carlin Bingham <cb [...] viennan.net>
Subject: [bug] filehandle read in a thead causes a segfault when the thread ends
Date: Fri, 09 Oct 2015 01:42:58 +1300
Download (untitled) / with headers
text/plain 387b
Doesn't seem to happen if the main program thread is still running when the thread exits. use v6; Thread.start({ my $fh = open('/dev/urandom'); say $fh.read(16); say "alive"; }); say "main program ending"; main program ending Buf[uint8]:0x<ae c0 d2 b1 fa c9 63 29 1a fb 5c de 56 a2 6a 07> alive Segmentation fault (core dumped) -- Carlin
Date: Thu, 8 Oct 2015 15:04:08 +0200
Subject: Re: [perl #126297] [bug] filehandle read in a thead causes a segfault when the thread ends
To: "Carlin Bingham (via RT)" <perl6-bugs-followup [...] perl.org>
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
Download (untitled) / with headers
text/plain 834b
Show quoted text
> On 08 Oct 2015, at 14:43, Carlin Bingham (via RT) <perl6-bugs-followup@perl.org> wrote: > > # New Ticket Created by Carlin Bingham > # Please include the string: [perl #126297] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=126297 > > > > Doesn't seem to happen if the main program thread is still running when > the thread exits. > > > use v6; > > Thread.start({ > my $fh = open('/dev/urandom'); > say $fh.read(16); > say "alive"; > }); > > say "main program ending"; > > > main program ending > Buf[uint8]:0x<ae c0 d2 b1 fa c9 63 29 1a fb 5c de 56 a2 6a 07> > alive > Segmentation fault (core dumped)
I wonder if this is another symptom of: $ cat /dev/urandom | perl6 Show quoted text
> ===SORRY!===
Malformed UTF-8 Liz
Subject: Re: [perl #126297] [bug] filehandle read in a thead causes a segfault when the thread ends
Date: Fri, 09 Oct 2015 02:28:36 +1300
From: Carlin Bingham <cb [...] viennan.net>
To: Elizabeth Mattijsen via RT <perl6-bugs-followup [...] perl.org>
Download (untitled) / with headers
text/plain 870b
On Fri, 9 Oct 2015, at 02:04 AM, Elizabeth Mattijsen via RT wrote: Show quoted text
> > I wonder if this is another symptom of: > > $ cat /dev/urandom | perl6
> > ===SORRY!===
> Malformed UTF-8 > > > Liz >
It's not specific to /dev/urandom, it happens with a filehandle for a file with plain ASCII chars: use v6; Thread.start({ my $fh = open('/tmp/blah'); say $fh.read(16); say "alive"; }); say "main program ending"; $ cat /tmp/blah The quick brown fox jumped over the lazy dogs. $ perl6 bug.pl6 main program ending Buf[uint8]:0x<54 68 65 20 71 75 69 63 6b 20 62 72 6f 77 6e 20> alive Segmentation fault (core dumped) $ cat /tmp/blah | perl6 Show quoted text
> ===SORRY!=== Error while compiling <unknown file>
Missing required term after infix at <unknown file>:3 ------> <BOL>?<EOL> expecting any of: dotty method or postfix -- Carlin
Date: Sat, 10 Oct 2015 14:03:20 +0100
Subject: Re: [perl #126297] [bug] filehandle read in a thead causes a segfault when the thread ends
To: perl6-compiler [...] perl.org
From: Nicholas Clark <nick [...] ccl4.org>
Download (untitled) / with headers
text/plain 1.5k
On Thu, Oct 08, 2015 at 05:43:11AM -0700, Carlin Bingham wrote: Show quoted text
> Doesn't seem to happen if the main program thread is still running when > the thread exits. > > > use v6; > > Thread.start({ > my $fh = open('/dev/urandom'); > say $fh.read(16); > say "alive"; > }); > > say "main program ending";
ASAN suggests that it's a "regular" SEGV - ie there are no bad memory accesses leading up to the crash: $ ./perl6-m -Ilib 126297 main program ending Buf[uint8]:0x<76 35 16 81 97 9f 8c 3f 77 f7 d4 02 00 ff bb 47> alive ASAN:SIGSEGV ================================================================= ==17783==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fc605dfa929 sp 0x7fff1a3952e0 bp 0x7fff1a395310 T0) #0 0x7fc605dfa928 in MVM_gc_root_add_temps_to_worklist src/gc/roots.c:171 #1 0x7fc605dff068 in MVM_gc_collect src/gc/collect.c:103 #2 0x7fc605df36fa in run_gc src/gc/orchestrate.c:292 #3 0x7fc605df404f in MVM_gc_enter_from_allocator src/gc/orchestrate.c:427 #4 0x7fc605da9ab7 in try_join src/core/threads.c:156 #5 0x7fc605daa136 in MVM_thread_join_foreground src/core/threads.c:243 #6 0x7fc605fd01e9 in MVM_vm_exit src/moar.c:263 #7 0x401a82 in main src/main.c:198 #8 0x7fc605563d5c in __libc_start_main (/lib64/libc.so.6+0x1ed5c) #9 0x401058 (/home/nicholas/Sandpit/moar-san/bin/moar+0x401058) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV src/gc/roots.c:171 MVM_gc_root_add_temps_to_worklist ==17783==ABORTING Nicholas Clark
Download (untitled) / with headers
text/plain 1.9k
On Sat, 10 Oct 2015 06:03:52 -0700, nicholas wrote: Show quoted text
> On Thu, Oct 08, 2015 at 05:43:11AM -0700, Carlin Bingham wrote: >
> > Doesn't seem to happen if the main program thread is still running > > when > > the thread exits. > > > > > > use v6; > > > > Thread.start({ > > my $fh = open('/dev/urandom'); > > say $fh.read(16); > > say "alive"; > > }); > > > > say "main program ending";
> > ASAN suggests that it's a "regular" SEGV - ie there are no bad memory > accesses > leading up to the crash: > > $ ./perl6-m -Ilib 126297 > main program ending > Buf[uint8]:0x<76 35 16 81 97 9f 8c 3f 77 f7 d4 02 00 ff bb 47> > alive > ASAN:SIGSEGV > ================================================================= > ==17783==ERROR: AddressSanitizer: SEGV on unknown address > 0x000000000000 (pc 0x7fc605dfa929 sp 0x7fff1a3952e0 bp 0x7fff1a395310 > T0) > #0 0x7fc605dfa928 in MVM_gc_root_add_temps_to_worklist > src/gc/roots.c:171 > #1 0x7fc605dff068 in MVM_gc_collect src/gc/collect.c:103 > #2 0x7fc605df36fa in run_gc src/gc/orchestrate.c:292 > #3 0x7fc605df404f in MVM_gc_enter_from_allocator > src/gc/orchestrate.c:427 > #4 0x7fc605da9ab7 in try_join src/core/threads.c:156 > #5 0x7fc605daa136 in MVM_thread_join_foreground > src/core/threads.c:243 > #6 0x7fc605fd01e9 in MVM_vm_exit src/moar.c:263 > #7 0x401a82 in main src/main.c:198 > #8 0x7fc605563d5c in __libc_start_main (/lib64/libc.so.6+0x1ed5c) > #9 0x401058 (/home/nicholas/Sandpit/moar-san/bin/moar+0x401058) > > AddressSanitizer can not provide additional info. > SUMMARY: AddressSanitizer: SEGV src/gc/roots.c:171 > MVM_gc_root_add_temps_to_worklist > ==17783==ABORTING > > Nicholas Clark
Fixed as part of jnthn's reframe work in May 2016. Relevant commits are, AlexDaniel++, 743e7a3dc9a46a2599663e0d448267071831c62c 925336ab25a2e6cd1b6865ce6bbdec97c5be85b8 cebcdd5031c6b6c6e866beee4b52a6a2fd23fcaa 260d5bd2ddd453c31a9e4f2cc9dc0c53bbdd5eea 8b6a4f1fc85846d8d017686a79257b88b165943e 1100877064943356599966c0a241a09b73c99b16


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

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