Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash (abort or segfault) when using 'but' in a loop #2943

Closed
p6rt opened this issue Oct 21, 2012 · 9 comments
Closed

Crash (abort or segfault) when using 'but' in a loop #2943

p6rt opened this issue Oct 21, 2012 · 9 comments

Comments

@p6rt
Copy link

p6rt commented Oct 21, 2012

Migrated from rt.perl.org#115390 (status was 'resolved')

Searchable as RT115390$

@p6rt
Copy link
Author

p6rt commented Oct 21, 2012

From @japhb

I see a segfault or backtrace crash after a few iterations of​:

  perl6 -e 'for 1..100 -> $i { say $i; run "true"; 1; }'

See https://gist.github.com/3925501 for example output. It crashes in
about half the iterations if the run() is not in sink context, as in​:

  perl6 -e 'for 1..100 -> $i { say $i; my $error = run "true"; 1; }'

However, if the run() is the last statement in the loop block, it
survives even 1000 iterations​:

  perl6 -e 'for 1..1000 -> $i { say $i; my $error = run "true"; }'

-'f

@p6rt
Copy link
Author

p6rt commented Jul 30, 2013

From @timo

i was able to golf the "run" out of this​:

perl6 -e 'for 1..1000 -> $i { say $i; my $error = (my $val =
(^10).pick(3).min but !$val); 1 }' # crashes

perl6 -e 'for 1..1000 -> $i { say $i; my $error = (my $val =
(^10).pick(3).min but !$val) }' # runs no-prob.

@p6rt
Copy link
Author

p6rt commented Jul 30, 2013

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Oct 10, 2014

From @usev6

These error reports are difficult to assess from one or two years later. I'm inclined to say the bugs are fixed -- though there seems to exists another bug regarding the use of "but" in a for loop. But one at a time​:

$ perl6-m -e 'for 1..100 -> $i { say $i; run "true"; 1; }'
1
[ ... output shortended ]
100
$ perl6-p -e 'for 1..100 -> $i { say $i; run "true"; 1; }'
1
[ ... output shortended ]
100
$ perl6-j -e 'for 1..100 -> $i { say $i; run "true"; 1; }'
1
[ ... output shortended ]
100

$ perl6-m -e 'for 1..100 -> $i { say $i; my $error = run "true"; 1; }'
1
[ ... output shortended ]
100
$ perl6-p -e 'for 1..100 -> $i { say $i; my $error = run "true"; 1; }'
1
[ ... output shortended ]
100
$ perl6-j -e 'for 1..100 -> $i { say $i; my $error = run "true"; 1; }'
1
[ ... output shortended ]
100

All these commands from the original bug report run fine now. Should both tests be added to roast? (It doesn't make it faster ;-)

$ perl6-m -e 'for 1..1000 -> $i { say $i; my $error = (my $val = (^10).pick(3).min but !$val); 1 }'
1
[ ... output shortended ]
1000
$ perl6-p -e 'for 1..1000 -> $i { say $i; my $error = (my $val = (^10).pick(3).min but !$val); 1 }'
## dies with segfault or "double free or corruption (out)" or "free()​: invalid next size (fast)" or "free()​: invalid pointer"
$ perl6-j -e 'for 1..1000 -> $i { say $i; my $error = (my $val = (^10).pick(3).min but !$val); 1 }'
1
[ ... output shortended ]
1000

$ perl6-m -e 'for 1..1000 -> $i { say $i; my $error = (my $val = (^10).pick(3).min but !$val) }'
1
[ ... output shortended ]
1000
$ perl6-p -e 'for 1..1000 -> $i { say $i; my $error = (my $val = (^10).pick(3).min but !$val) }'
1
## dies with segfault or "double free or corruption (out)" or "free()​: invalid next size (fast)" or "free()​: invalid pointer"
$ perl6-j -e 'for 1..1000 -> $i { say $i; my $error = (my $val = (^10).pick(3).min but !$val) }'
1
[ ... output shortended ]
1000

So, both commands from Timo Paulssens comment fail on Parrot (but run fine on Moar or JVM). Last year only the first command crashed.

That makes me think that I'm seeing a different bug​: The following command also crashes on Parrot -- for me around iteration 270). It runs fine on Moar and JVM​:

$ perl6-p -e 'for 1..500 { 0 but True }'
## dies with segfault or "free()​: invalid next size (fast)" -- see attached backtrace

There is also Ticket 116933 (https://rt-archive.perl.org/perl6/Ticket/Display.html?id=116933) which reports consistent crashes with "(0 but Bool​::True)" in a for loop. (Though in that ticket the crashes happen earlier -- after about 6 to 13 iterations. So maybe even that's not the same thing. But on the other hand that was in 2013-02.)

If the last crash could be fixed, maybe the commands from Timo Paulssens comment run fine now as well?

@p6rt
Copy link
Author

p6rt commented Oct 10, 2014

From @usev6

christian@​cus​:~/my_files/computer/Perl6/tmp/rakudo_work_9$ ./perl6-p -v
This is perl6 version 2014.09-140-g32aa365 built on parrot 6.8.0 revision RELEASE_6_8_0
*** glibc detected *** ./perl6-p​: free()​: invalid next size (fast)​: 0x00000000133a4620 ***
======= Backtrace​: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x76aa6)[0x7f6ff38e3aa6]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x6c)[0x7f6ff38e884c]
/home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/nqp_ops.so(+0x339ef)[0x7f6ff1f019ef]
/home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/libparrot.so.6.8.0(+0x8e0fd)[0x7f6ff5f9b0fd]
/home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/libparrot.so.6.8.0(+0x8e467)[0x7f6ff5f9b467]
/home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/libparrot.so.6.8.0(Parrot_gc_new_pmc_header+0x1b)[0x7f6ff5f963fb]
/home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/libparrot.so.6.8.0(+0xae16e)[0x7f6ff5fbb16e]
/home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/libparrot.so.6.8.0(Parrot_pmc_new+0x3c)[0x7f6ff5fbb41c]
/home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/libparrot.so.6.8.0(Parrot_pcc_reuse_continuation+0x70)[0x7f6ff5fa5660]
/home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/libparrot.so.6.8.0(+0x67bbc)[0x7f6ff5f74bbc]
/home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/libparrot.so.6.8.0(+0xaf695)[0x7f6ff5fbc695]
/home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/libparrot.so.6.8.0(+0xaf2ed)[0x7f6ff5fbc2ed]
/home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/libparrot.so.6.8.0(+0x97eae)[0x7f6ff5fa4eae]
/home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/libparrot.so.6.8.0(Parrot_pcc_invoke_from_sig_object+0xde)[0x7f6ff5fa0d2e]
/home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/libparrot.so.6.8.0(Parrot_ext_call+0xcc)[0x7f6ff5f94cdc]
/home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/libparrot.so.6.8.0(+0x16c3b6)[0x7f6ff60793b6]
/home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/libparrot.so.6.8.0(Parrot_pcc_invoke_from_sig_object+0x8a)[0x7f6ff5fa0cda]
/home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/libparrot.so.6.8.0(Parrot_ext_call+0xcc)[0x7f6ff5f94cdc]
/home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/libparrot.so.6.8.0(+0xb372f)[0x7f6ff5fc072f]
/home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/libparrot.so.6.8.0(Parrot_cx_begin_execution+0x6c)[0x7f6ff5fc083c]
/home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/libparrot.so.6.8.0(Parrot_pf_execute_bytecode_program+0xdb)[0x7f6ff5fc91cb]
/home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/libparrot.so.6.8.0(Parrot_api_run_bytecode+0xd1)[0x7f6ff5f90b51]
./perl6-p(main+0x1d3)[0x4013e3]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd)[0x7f6ff388beed]
./perl6-p[0x401495]
======= Memory map​: ========
00400000-0040f000 r-xp 00000000 08​:13 1197123 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/perl6-p
0060e000-0060f000 rw-p 0000e000 08​:13 1197123 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/perl6-p
0108f000-13ada000 rw-p 00000000 00​:00 0 [heap]
7f6fe4000000-7f6fe4021000 rw-p 00000000 00​:00 0
7f6fe4021000-7f6fe8000000 ---p 00000000 00​:00 0
7f6febfe3000-7f6fec7ca000 rw-p 00000000 00​:00 0
7f6fec7ca000-7f6fec7dc000 r-xp 00000000 08​:13 1197095 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/nqp_dyncall_ops.so
7f6fec7dc000-7f6fec9db000 ---p 00012000 08​:13 1197095 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/nqp_dyncall_ops.so
7f6fec9db000-7f6fec9dd000 rw-p 00011000 08​:13 1197095 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/nqp_dyncall_ops.so
7f6fec9dd000-7f6fec9e0000 r-xp 00000000 08​:13 1197041 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/sys_ops.so
7f6fec9e0000-7f6fecbe0000 ---p 00003000 08​:13 1197041 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/sys_ops.so
7f6fecbe0000-7f6fecbe1000 rw-p 00003000 08​:13 1197041 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/sys_ops.so
7f6fecbe1000-7f6fecbe5000 r-xp 00000000 08​:13 1197037 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/math_ops.so
7f6fecbe5000-7f6fecde5000 ---p 00004000 08​:13 1197037 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/math_ops.so
7f6fecde5000-7f6fecde7000 rw-p 00004000 08​:13 1197037 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/math_ops.so
7f6fecde7000-7f6fecdf0000 r-xp 00000000 08​:13 1197039 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/bit_ops.so
7f6fecdf0000-7f6fecff0000 ---p 00009000 08​:13 1197039 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/bit_ops.so
7f6fecff0000-7f6fecff4000 rw-p 00009000 08​:13 1197039 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/bit_ops.so
7f6fecff4000-7f6fecff7000 r-xp 00000000 08​:13 1197036 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/obscure_ops.so
7f6fecff7000-7f6fed1f7000 ---p 00003000 08​:13 1197036 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/obscure_ops.so
7f6fed1f7000-7f6fed1f9000 rw-p 00003000 08​:13 1197036 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/obscure_ops.so
7f6fed1f9000-7f6fed1fc000 r-xp 00000000 08​:13 1197021 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/file.so
7f6fed1fc000-7f6fed3fb000 ---p 00003000 08​:13 1197021 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/file.so
7f6fed3fb000-7f6fed3fc000 rw-p 00002000 08​:13 1197021 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/file.so
7f6fed3fc000-7f6fed3fe000 r-xp 00000000 08​:13 1197022 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/os.so
7f6fed3fe000-7f6fed5fd000 ---p 00002000 08​:13 1197022 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/os.so
7f6fed5fd000-7f6fed5fe000 rw-p 00001000 08​:13 1197022 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/os.so
7f6fed5fe000-7f6ff1305000 rw-p 00000000 00​:00 0
7f6ff1305000-7f6ff130c000 r-xp 00000000 08​:13 1197038 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/trans_ops.so
7f6ff130c000-7f6ff150b000 ---p 00007000 08​:13 1197038 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/trans_ops.so
7f6ff150b000-7f6ff150e000 rw-p 00006000 08​:13 1197038 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/trans_ops.so
7f6ff150e000-7f6ff1aa7000 rw-p 00000000 00​:00 0
7f6ff1aa7000-7f6ff1aad000 r-xp 00000000 08​:13 1197042 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/io_ops.so
7f6ff1aad000-7f6ff1cad000 ---p 00006000 08​:13 1197042 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/io_ops.so
7f6ff1cad000-7f6ff1cb0000 rw-p 00006000 08​:13 1197042 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/io_ops.so
7f6ff1cb0000-7f6ff1ccb000 r-xp 00000000 08​:13 1197094 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/nqp_bigint_ops.so
7f6ff1ccb000-7f6ff1eca000 ---p 0001b000 08​:13 1197094 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/nqp_bigint_ops.so
7f6ff1eca000-7f6ff1ece000 rw-p 0001a000 08​:13 1197094 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/nqp_bigint_ops.so
7f6ff1ece000-7f6ff1f1f000 r-xp 00000000 08​:13 1197093 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/nqp_ops.so
7f6ff1f1f000-7f6ff211e000 ---p 00051000 08​:13 1197093 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/nqp_ops.so
7f6ff211e000-7f6ff212f000 rw-p 00050000 08​:13 1197093 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/nqp_ops.so
7f6ff212f000-7f6ff2149000 r-xp 00000000 08​:13 1324555 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/dynext/perl6_ops.so
7f6ff2149000-7f6ff2348000 ---p 0001a000 08​:13 1324555 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/dynext/perl6_ops.so
7f6ff2348000-7f6ff234f000 rw-p 00019000 08​:13 1324555 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/dynext/perl6_ops.so
7f6ff234f000-7f6ff2366000 r-xp 00000000 08​:13 1197092 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/nqp_group.so
7f6ff2366000-7f6ff2566000 ---p 00017000 08​:13 1197092 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/nqp_group.so
7f6ff2566000-7f6ff2567000 rw-p 00017000 08​:13 1197092 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/parrot/6.8.0-devel/dynext/nqp_group.so
7f6ff2567000-7f6ff2568000 ---p 00000000 00​:00 0
7f6ff2568000-7f6ff2d68000 rwxp 00000000 00​:00 0
7f6ff2d68000-7f6ff3127000 r--p 00000000 08​:13 2924092 /usr/lib/locale/locale-archive
7f6ff3127000-7f6ff313c000 r-xp 00000000 08​:13 1572868 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f6ff313c000-7f6ff333c000 ---p 00015000 08​:13 1572868 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f6ff333c000-7f6ff333d000 rw-p 00015000 08​:13 1572868 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f6ff333d000-7f6ff3425000 r-xp 00000000 08​:13 2887460 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.17
7f6ff3425000-7f6ff3625000 ---p 000e8000 08​:13 2887460 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.17
7f6ff3625000-7f6ff362d000 r--p 000e8000 08​:13 2887460 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.17
7f6ff362d000-7f6ff362f000 rw-p 000f0000 08​:13 2887460 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.17
7f6ff362f000-7f6ff3644000 rw-p 00000000 00​:00 0
7f6ff3644000-7f6ff3669000 r-xp 00000000 08​:13 1572904 /lib/x86_64-linux-gnu/libtinfo.so.5.9
7f6ff3669000-7f6ff3868000 ---p 00025000 08​:13 1572904 /lib/x86_64-linux-gnu/libtinfo.so.5.9
7f6ff3868000-7f6ff386c000 r--p 00024000 08​:13 1572904 /lib/x86_64-linux-gnu/libtinfo.so.5.9
7f6ff386c000-7f6ff386d000 rw-p 00028000 08​:13 1572904 /lib/x86_64-linux-gnu/libtinfo.so.5.9
7f6ff386d000-7f6ff39ee000 r-xp 00000000 08​:13 1576587 /lib/x86_64-linux-gnu/libc-2.13.so
7f6ff39ee000-7f6ff3bee000 ---p 00181000 08​:13 1576587 /lib/x86_64-linux-gnu/libc-2.13.so
7f6ff3bee000-7f6ff3bf2000 r--p 00181000 08​:13 1576587 /lib/x86_64-linux-gnu/libc-2.13.so
7f6ff3bf2000-7f6ff3bf3000 rw-p 00185000 08​:13 1576587 /lib/x86_64-linux-gnu/libc-2.13.so
7f6ff3bf3000-7f6ff3bf8000 rw-p 00000000 00​:00 0
7f6ff3bf8000-7f6ff4d67000 r-xp 00000000 08​:13 2896932 /usr/lib/x86_64-linux-gnu/libicudata.so.48.1.1
7f6ff4d67000-7f6ff4d68000 r--p 0116e000 08​:13 2896932 /usr/lib/x86_64-linux-gnu/libicudata.so.48.1.1
7f6ff4d68000-7f6ff4d69000 rw-p 0116f000 08​:13 2896932 /usr/lib/x86_64-linux-gnu/libicudata.so.48.1.1
7f6ff4d69000-7f6ff4d75000 r-xp 00000000 08​:13 2891258 /usr/lib/x86_64-linux-gnu/libffi.so.5.0.10
7f6ff4d75000-7f6ff4f75000 ---p 0000c000 08​:13 2891258 /usr/lib/x86_64-linux-gnu/libffi.so.5.0.10
7f6ff4f75000-7f6ff4f76000 rw-p 0000c000 08​:13 2891258 /usr/lib/x86_64-linux-gnu/libffi.so.5.0.10
7f6ff4f76000-7f6ff4fb3000 r-xp 00000000 08​:13 1573002 /lib/x86_64-linux-gnu/libreadline.so.6.2
7f6ff4fb3000-7f6ff51b3000 ---p 0003d000 08​:13 1573002 /lib/x86_64-linux-gnu/libreadline.so.6.2
7f6ff51b3000-7f6ff51b5000 r--p 0003d000 08​:13 1573002 /lib/x86_64-linux-gnu/libreadline.so.6.2
7f6ff51b5000-7f6ff51bb000 rw-p 0003f000 08​:13 1573002 /lib/x86_64-linux-gnu/libreadline.so.6.2
7f6ff51bb000-7f6ff51bd000 rw-p 00000000 00​:00 0
7f6ff51bd000-7f6ff5224000 r-xp 00000000 08​:13 2896297 /usr/lib/x86_64-linux-gnu/libgmp.so.10.0.5
7f6ff5224000-7f6ff5424000 ---p 00067000 08​:13 2896297 /usr/lib/x86_64-linux-gnu/libgmp.so.10.0.5
7f6ff5424000-7f6ff542c000 rw-p 00067000 08​:13 2896297 /usr/lib/x86_64-linux-gnu/libgmp.so.10.0.5
7f6ff542c000-7f6ff5433000 r-xp 00000000 08​:13 1576603 /lib/x86_64-linux-gnu/librt-2.13.so
7f6ff5433000-7f6ff5632000 ---p 00007000 08​:13 1576603 /lib/x86_64-linux-gnu/librt-2.13.so
7f6ff5632000-7f6ff5633000 r--p 00006000 08​:13 1576603 /lib/x86_64-linux-gnu/librt-2.13.so
7f6ff5633000-7f6ff5634000 rw-p 00007000 08​:13 1576603 /lib/x86_64-linux-gnu/librt-2.13.so
7f6ff5634000-7f6ff563c000 r-xp 00000000 08​:13 1576589 /lib/x86_64-linux-gnu/libcrypt-2.13.so
7f6ff563c000-7f6ff583b000 ---p 00008000 08​:13 1576589 /lib/x86_64-linux-gnu/libcrypt-2.13.so
7f6ff583b000-7f6ff583c000 r--p 00007000 08​:13 1576589 /lib/x86_64-linux-gnu/libcrypt-2.13.so
7f6ff583c000-7f6ff583d000 rw-p 00008000 08​:13 1576589 /lib/x86_64-linux-gnu/libcrypt-2.13.so
7f6ff583d000-7f6ff586b000 rw-p 00000000 00​:00 0
7f6ff586b000-7f6ff5882000 r-xp 00000000 08​:13 1576601 /lib/x86_64-linux-gnu/libpthread-2.13.so
7f6ff5882000-7f6ff5a81000 ---p 00017000 08​:13 1576601 /lib/x86_64-linux-gnu/libpthread-2.13.so
7f6ff5a81000-7f6ff5a82000 r--p 00016000 08​:13 1576601 /lib/x86_64-linux-gnu/libpthread-2.13.so
7f6ff5a82000-7f6ff5a83000 rw-p 00017000 08​:13 1576601 /lib/x86_64-linux-gnu/libpthread-2.13.so
7f6ff5a83000-7f6ff5a87000 rw-p 00000000 00​:00 0
7f6ff5a87000-7f6ff5b08000 r-xp 00000000 08​:13 1576591 /lib/x86_64-linux-gnu/libm-2.13.so
7f6ff5b08000-7f6ff5d07000 ---p 00081000 08​:13 1576591 /lib/x86_64-linux-gnu/libm-2.13.so
7f6ff5d07000-7f6ff5d08000 r--p 00080000 08​:13 1576591 /lib/x86_64-linux-gnu/libm-2.13.so
7f6ff5d08000-7f6ff5d09000 rw-p 00081000 08​:13 1576591 /lib/x86_64-linux-gnu/libm-2.13.so
7f6ff5d09000-7f6ff5d0b000 r-xp 00000000 08​:13 1576590 /lib/x86_64-linux-gnu/libdl-2.13.so
7f6ff5d0b000-7f6ff5f0b000 ---p 00002000 08​:13 1576590 /lib/x86_64-linux-gnu/libdl-2.13.so
7f6ff5f0b000-7f6ff5f0c000 r--p 00002000 08​:13 1576590 /lib/x86_64-linux-gnu/libdl-2.13.so
7f6ff5f0c000-7f6ff5f0d000 rw-p 00003000 08​:13 1576590 /lib/x86_64-linux-gnu/libdl-2.13.so
7f6ff5f0d000-7f6ff6108000 r-xp 00000000 08​:13 1196988 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/libparrot.so.6.8.0
7f6ff6108000-7f6ff6307000 ---p 001fb000 08​:13 1196988 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/libparrot.so.6.8.0
7f6ff6307000-7f6ff6346000 rw-p 001fa000 08​:13 1196988 /home/christian/my_files/computer/Perl6/tmp/rakudo_work_9/install/lib/libparrot.so.6.8.0
7f6ff6346000-7f6ff6366000 r-xp 00000000 08​:13 1576584 /lib/x86_64-linux-gnu/ld-2.13.so
7f6ff636c000-7f6ff63d6000 rw-p 00000000 00​:00 0
7f6ff63d6000-7f6ff6530000 r-xp 00000000 08​:13 2896931 /usr/lib/x86_64-linux-gnu/libicuuc.so.48.1.1
7f6ff6530000-7f6ff6531000 ---p 0015a000 08​:13 2896931 /usr/lib/x86_64-linux-gnu/libicuuc.so.48.1.1
7f6ff6531000-7f6ff6542000 r--p 0015a000 08​:13 2896931 /usr/lib/x86_64-linux-gnu/libicuuc.so.48.1.1
7f6ff6542000-7f6ff6543000 rw-p 0016b000 08​:13 2896931 /usr/lib/x86_64-linux-gnu/libicuuc.so.48.1.1
7f6ff6543000-7f6ff654a000 rw-p 00000000 00​:00 0
7f6ff6563000-7f6ff6565000 rw-p 00000000 00​:00 0
7f6ff6565000-7f6ff6566000 r--p 0001f000 08​:13 1576584 /lib/x86_64-linux-gnu/ld-2.13.so
7f6ff6566000-7f6ff6567000 rw-p 00020000 08​:13 1576584 /lib/x86_64-linux-gnu/ld-2.13.so
7f6ff6567000-7f6ff6568000 rw-p 00000000 00​:00 0
7fffe6501000-7fffe6520000 rwxp 00000000 00​:00 0 [stack]
7fffe6520000-7fffe6522000 rw-p 00000000 00​:00 0
7fffe65ff000-7fffe6600000 r-xp 00000000 00​:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00​:00 0 [vsyscall]
Aborted

@p6rt
Copy link
Author

p6rt commented Oct 10, 2014

From @usev6

These error reports are difficult to assess from one or two years later. I'm inclined to say the bugs are fixed -- though there seems to exists another bug regarding the use of "but" in a for loop. But one at a time​:

$ perl6-m -e 'for 1..100 -> $i { say $i; run "true"; 1; }'
1
[ ... output shortended ]
100
$ perl6-p -e 'for 1..100 -> $i { say $i; run "true"; 1; }'
1
[ ... output shortended ]
100
$ perl6-j -e 'for 1..100 -> $i { say $i; run "true"; 1; }'
1
[ ... output shortended ]
100

$ perl6-m -e 'for 1..100 -> $i { say $i; my $error = run "true"; 1; }'
1
[ ... output shortended ]
100
$ perl6-p -e 'for 1..100 -> $i { say $i; my $error = run "true"; 1; }'
1
[ ... output shortended ]
100
$ perl6-j -e 'for 1..100 -> $i { say $i; my $error = run "true"; 1; }'
1
[ ... output shortended ]
100

All these commands from the original bug report run fine now. Should both tests be added to roast? (It doesn't make it faster ;-)

$ perl6-m -e 'for 1..1000 -> $i { say $i; my $error = (my $val = (^10).pick(3).min but !$val); 1 }'
1
[ ... output shortended ]
1000
$ perl6-p -e 'for 1..1000 -> $i { say $i; my $error = (my $val = (^10).pick(3).min but !$val); 1 }'
## dies with segfault or "double free or corruption (out)" or "free()​: invalid next size (fast)" or "free()​: invalid pointer"
$ perl6-j -e 'for 1..1000 -> $i { say $i; my $error = (my $val = (^10).pick(3).min but !$val); 1 }'
1
[ ... output shortended ]
1000

$ perl6-m -e 'for 1..1000 -> $i { say $i; my $error = (my $val = (^10).pick(3).min but !$val) }'
1
[ ... output shortended ]
1000
$ perl6-p -e 'for 1..1000 -> $i { say $i; my $error = (my $val = (^10).pick(3).min but !$val) }'
1
## dies with segfault or "double free or corruption (out)" or "free()​: invalid next size (fast)" or "free()​: invalid pointer"
$ perl6-j -e 'for 1..1000 -> $i { say $i; my $error = (my $val = (^10).pick(3).min but !$val) }'
1
[ ... output shortended ]
1000

So, both commands from Timo Paulssens comment fail on Parrot (but run fine on Moar or JVM). Last year only the first command crashed.

That makes me think that I'm seeing a different bug​: The following command also crashes on Parrot -- for me around iteration 270). It runs fine on Moar and JVM​:

$ perl6-p -e 'for 1..500 { 0 but True }'
## dies with segfault or "free()​: invalid next size (fast)" -- see attached backtrace

There is also Ticket 116933 (https://rt-archive.perl.org/perl6/Ticket/Display.html?id=116933) which reports consistent crashes with "(0 but Bool​::True)" in a for loop. (Though in that ticket the crashes happen earlier -- after about 6 to 13 iterations. So maybe even that's not the same thing. But on the other hand that was in 2013-02.)

If the last crash could be fixed, maybe the commands from Timo Paulssens comment run fine now as well?

@p6rt
Copy link
Author

p6rt commented Jul 5, 2015

From @usev6

None of the above evaluations results in a crash/segfault. I tested with current Moar and JVM and Parrot from Rakudo Star 2015.02.

I added three tests with commit Raku/roast@3957fed267

I'm closing this ticket as resolved.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Jul 5, 2015

From @usev6

None of the above evaluations results in a crash/segfault. I tested with current Moar and JVM and Parrot from Rakudo Star 2015.02.

I added three tests with commit Raku/roast@3957fed267

I'm closing this ticket as resolved.

@p6rt p6rt closed this as completed Jul 5, 2015
@p6rt
Copy link
Author

p6rt commented Jul 5, 2015

@usev6 - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant