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

problems when run()ning two procs and passing the :out of one to the :in of the other #5678

Closed
p6rt opened this issue Sep 17, 2016 · 12 comments

Comments

@p6rt
Copy link

p6rt commented Sep 17, 2016

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

Searchable as RT129291$

@p6rt
Copy link
Author

p6rt commented Sep 17, 2016

From @MasterDuke17

This happens sometime in the whateverable bots when passing the output of decompressing an archive to tar (below are the error messages).

tar​: /tmp/whateverable/rakudo-moar/27b1ab6bf964b8e3c183109c1a385af49e31e2fb/lib​: Cannot utime​: No such file or directory
The spawned process exited unsuccessfully (exit code​: 2) in method run-snippet at /home/bisectable/git/bisectable/Whateverable.pm6 (Whateverable) line 136

Here's the relevant section of Whateverable.pm6

135​: my $proc = run(​:out, :bin, ‘zstd’, ‘-dqc’, ‘--’, “{ARCHIVES-LOCATION}/$full-commit-hash.zst”);
136​: run(​:in($proc.out), :bin, ‘tar’, ‘x’, ‘--absolute-names’);

We tried adding a sleep(.1) between those two lines, but it still happens.

I then tried golfing with valgrind and a rakudo that had MoarVM built with --debug

I ran this​: valgrind perl6-valgrind-m -e 'for ^100 {my $proc = run(​:out, :bin, "ls"); run(​:in($proc.out), :bin, "false");}'

and get this output​:

This is Rakudo Perl 6 running in valgrind, a tool for debugging and profiling programs.
Running a program in valgrind usually takes *a lot* more time than running it directly,
so please be patient.
This Rakudo version is 2016.08.1.202.g.78393.dd built on MoarVM version 2016.08.47.g.2.eedba.8,
running on arch (4.7.3.1.arch) / linux (4.7.2.1.ARCH)


==12496== Memcheck, a memory error detector
==12496== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==12496== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==12496== Command​: /home/dan/Source/perl6/install/bin/moar --execname=/home/dan/Source/perl6/install/bin/perl6-valgrind-m --libpath=/home/dan/Source/perl6/install/share/nqp/lib --libpath=/home/dan/Source/perl6/install/share/perl6/lib --libpath=/home/dan/Source/perl6/install/share/perl6/runtime /home/dan/Source/perl6/install/share/perl6/runtime/perl6.moarvm -e for\ ^100\ {my\ $proc\ =\ run(​:out,\ :bin,\ "ls");\ run(​:in($proc.out),\ :bin,\ "false");}
==12496==
==12496== Invalid free() / delete / delete[] / realloc()
==12496== at 0x4C2AD90​: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12496== by 0x4FC6CA3​: MVM_free (alloc.h​:29)
==12496== by 0x4FC6CA3​: do_close (syncpipe.c​:37)
==12496== by 0x4FC6CA3​: closefh (syncpipe.c​:52)
==12496== by 0x4FC38BA​: MVM_io_close (io.c​:28)
==12496== by 0x4F8F2E0​: MVM_interp_run (interp.c​:4361)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496== Address 0xffefffe30 is on thread 1's stack
==12496==
==12496== Conditional jump or move depends on uninitialised value(s)
==12496== at 0x4FB7B88​: MVM_intcache_get (intcache.c​:40)
==12496== by 0x4F85C65​: MVM_args_slurpy_positional (args.c​:574)
==12496== by 0x4F9B6DB​: MVM_interp_run (interp.c​:1046)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Conditional jump or move depends on uninitialised value(s)
==12496== at 0x4FEB430​: set_int (P6bigint.c​:73)
==12496== by 0x4F85E31​: MVM_args_slurpy_positional (args.c​:574)
==12496== by 0x4F9B6DB​: MVM_interp_run (interp.c​:1046)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Conditional jump or move depends on uninitialised value(s)
==12496== at 0x4FB7B88​: MVM_intcache_get (intcache.c​:40)
==12496== by 0x4F842C8​: MVM_args_get_pos_obj (args.c​:297)
==12496== by 0x4F913C3​: MVM_interp_run (interp.c​:917)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Conditional jump or move depends on uninitialised value(s)
==12496== at 0x4FEB430​: set_int (P6bigint.c​:73)
==12496== by 0x4F8434C​: MVM_args_get_pos_obj (args.c​:297)
==12496== by 0x4F913C3​: MVM_interp_run (interp.c​:917)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Conditional jump or move depends on uninitialised value(s)
==12496== at 0x5048E6C​: MVM_bigint_cmp (bigintops.c​:479)
==12496== by 0xCBD50CB​: ???
==12496== by 0x5029F28​: MVM_jit_enter_code (compile.c​:136)
==12496== by 0x4F90181​: MVM_interp_run (interp.c​:5535)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Conditional jump or move depends on uninitialised value(s)
==12496== at 0x4F94EDE​: MVM_interp_run (interp.c​:2858)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Use of uninitialised value of size 8
==12496== at 0x4F94EE4​: MVM_interp_run (interp.c​:2858)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Use of uninitialised value of size 8
==12496== at 0x4F94EEE​: MVM_interp_run (interp.c​:2858)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Conditional jump or move depends on uninitialised value(s)
==12496== at 0x4FAEA2A​: MVM_is_null (MVMNull.h​:11)
==12496== by 0x4FAEA2A​: MVM_coerce_istrue (coerce.c​:31)
==12496== by 0x4F9BCF0​: MVM_interp_run (interp.c​:242)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Conditional jump or move depends on uninitialised value(s)
==12496== at 0x4FAEA3D​: MVM_is_null (MVMNull.h​:11)
==12496== by 0x4FAEA3D​: MVM_coerce_istrue (coerce.c​:31)
==12496== by 0x4F9BCF0​: MVM_interp_run (interp.c​:242)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Use of uninitialised value of size 8
==12496== at 0x4FAEA3F​: MVM_coerce_istrue (coerce.c​:32)
==12496== by 0x4F9BCF0​: MVM_interp_run (interp.c​:242)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Use of uninitialised value of size 8
==12496== at 0x4FAEBD2​: MVM_coerce_istrue (coerce.c​:65)
==12496== by 0x4F9BCF0​: MVM_interp_run (interp.c​:242)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Use of uninitialised value of size 8
==12496== at 0x4FDFB50​: MVM_p6opaque_real_data (P6opaque.h​:108)
==12496== by 0x4FDFB50​: get_int (P6opaque.c​:452)
==12496== by 0x4FAEBF5​: MVM_coerce_istrue (coerce.c​:65)
==12496== by 0x4F9BCF0​: MVM_interp_run (interp.c​:242)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496==
==12496== HEAP SUMMARY​:
==12496== in use at exit​: 63,559,757 bytes in 231,703 blocks
==12496== total heap usage​: 313,406 allocs, 81,741 frees, 87,015,274 bytes allocated
==12496==
==12496== LEAK SUMMARY​:
==12496== definitely lost​: 22,486 bytes in 344 blocks
==12496== indirectly lost​: 36,640 bytes in 836 blocks
==12496== possibly lost​: 378,880 bytes in 6,745 blocks
==12496== still reachable​: 63,121,751 bytes in 223,778 blocks
==12496== suppressed​: 0 bytes in 0 blocks
==12496== Rerun with --leak-check=full to see details of leaked memory
==12496==
==12496== For counts of detected and suppressed errors, rerun with​: -v
==12496== Use --track-origins=yes to see where uninitialised values come from
==12496== ERROR SUMMARY​: 466 errors from 14 contexts (suppressed​: 0 from 0)
==12492==
==12492== HEAP SUMMARY​:
==12492== in use at exit​: 27,914 bytes in 728 blocks
==12492== total heap usage​: 4,019 allocs, 3,291 frees, 191,374 bytes allocated
==12492==
==12492== LEAK SUMMARY​:
==12492== definitely lost​: 12 bytes in 1 blocks
==12492== indirectly lost​: 0 bytes in 0 blocks
==12492== possibly lost​: 0 bytes in 0 blocks
==12492== still reachable​: 27,902 bytes in 727 blocks
==12492== suppressed​: 0 bytes in 0 blocks
==12492== Rerun with --leak-check=full to see details of leaked memory
==12492==
==12492== For counts of detected and suppressed errors, rerun with​: -v
==12492== ERROR SUMMARY​: 0 errors from 0 contexts (suppressed​: 0 from 0)

@p6rt
Copy link
Author

p6rt commented Sep 17, 2016

From @MasterDuke17

On Sat Sep 17 05​:29​:22 2016, ddgreen@​gmail.com wrote​:

This happens sometime in the whateverable bots when passing the output
of decompressing an archive to tar (below are the error messages).

tar​: /tmp/whateverable/rakudo-
moar/27b1ab6bf964b8e3c183109c1a385af49e31e2fb/lib​: Cannot utime​: No
such file or directory
The spawned process exited unsuccessfully (exit code​: 2) in method
run-snippet at /home/bisectable/git/bisectable/Whateverable.pm6
(Whateverable) line 136

Here's the relevant section of Whateverable.pm6

135​: my $proc = run(​:out, :bin, ‘zstd’, ‘-dqc’, ‘--’, “{ARCHIVES-
LOCATION}/$full-commit-hash.zst”);
136​: run(​:in($proc.out), :bin, ‘tar’, ‘x’, ‘--absolute-names’);

We tried adding a sleep(.1) between those two lines, but it still
happens.

I then tried golfing with valgrind and a rakudo that had MoarVM built
with --debug

I ran this​: valgrind perl6-valgrind-m -e 'for ^100 {my $proc =
run(​:out, :bin, "ls"); run(​:in($proc.out), :bin, "false");}'

and get this output​:

This is Rakudo Perl 6 running in valgrind, a tool for debugging and
profiling programs.
Running a program in valgrind usually takes *a lot* more time than
running it directly,
so please be patient.
This Rakudo version is 2016.08.1.202.g.78393.dd built on MoarVM
version 2016.08.47.g.2.eedba.8,
running on arch (4.7.3.1.arch) / linux (4.7.2.1.ARCH)
------------------------------------------------------------------------------------------------
==12496== Memcheck, a memory error detector
==12496== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et
al.
==12496== Using Valgrind-3.11.0 and LibVEX; rerun with -h for
copyright info
==12496== Command​: /home/dan/Source/perl6/install/bin/moar
--execname=/home/dan/Source/perl6/install/bin/perl6-valgrind-m
--libpath=/home/dan/Source/perl6/install/share/nqp/lib
--libpath=/home/dan/Source/perl6/install/share/perl6/lib
--libpath=/home/dan/Source/perl6/install/share/perl6/runtime
/home/dan/Source/perl6/install/share/perl6/runtime/perl6.moarvm -e
for\ ^100\ {my\ $proc\ =\ run(​:out,\ :bin,\ "ls");\
run(​:in($proc.out),\ :bin,\ "false");}
==12496==
==12496== Invalid free() / delete / delete[] / realloc()
==12496== at 0x4C2AD90​: free (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12496== by 0x4FC6CA3​: MVM_free (alloc.h​:29)
==12496== by 0x4FC6CA3​: do_close (syncpipe.c​:37)
==12496== by 0x4FC6CA3​: closefh (syncpipe.c​:52)
==12496== by 0x4FC38BA​: MVM_io_close (io.c​:28)
==12496== by 0x4F8F2E0​: MVM_interp_run (interp.c​:4361)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496== Address 0xffefffe30 is on thread 1's stack
==12496==
==12496== Conditional jump or move depends on uninitialised value(s)
==12496== at 0x4FB7B88​: MVM_intcache_get (intcache.c​:40)
==12496== by 0x4F85C65​: MVM_args_slurpy_positional (args.c​:574)
==12496== by 0x4F9B6DB​: MVM_interp_run (interp.c​:1046)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Conditional jump or move depends on uninitialised value(s)
==12496== at 0x4FEB430​: set_int (P6bigint.c​:73)
==12496== by 0x4F85E31​: MVM_args_slurpy_positional (args.c​:574)
==12496== by 0x4F9B6DB​: MVM_interp_run (interp.c​:1046)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Conditional jump or move depends on uninitialised value(s)
==12496== at 0x4FB7B88​: MVM_intcache_get (intcache.c​:40)
==12496== by 0x4F842C8​: MVM_args_get_pos_obj (args.c​:297)
==12496== by 0x4F913C3​: MVM_interp_run (interp.c​:917)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Conditional jump or move depends on uninitialised value(s)
==12496== at 0x4FEB430​: set_int (P6bigint.c​:73)
==12496== by 0x4F8434C​: MVM_args_get_pos_obj (args.c​:297)
==12496== by 0x4F913C3​: MVM_interp_run (interp.c​:917)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Conditional jump or move depends on uninitialised value(s)
==12496== at 0x5048E6C​: MVM_bigint_cmp (bigintops.c​:479)
==12496== by 0xCBD50CB​: ???
==12496== by 0x5029F28​: MVM_jit_enter_code (compile.c​:136)
==12496== by 0x4F90181​: MVM_interp_run (interp.c​:5535)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Conditional jump or move depends on uninitialised value(s)
==12496== at 0x4F94EDE​: MVM_interp_run (interp.c​:2858)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Use of uninitialised value of size 8
==12496== at 0x4F94EE4​: MVM_interp_run (interp.c​:2858)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Use of uninitialised value of size 8
==12496== at 0x4F94EEE​: MVM_interp_run (interp.c​:2858)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Conditional jump or move depends on uninitialised value(s)
==12496== at 0x4FAEA2A​: MVM_is_null (MVMNull.h​:11)
==12496== by 0x4FAEA2A​: MVM_coerce_istrue (coerce.c​:31)
==12496== by 0x4F9BCF0​: MVM_interp_run (interp.c​:242)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Conditional jump or move depends on uninitialised value(s)
==12496== at 0x4FAEA3D​: MVM_is_null (MVMNull.h​:11)
==12496== by 0x4FAEA3D​: MVM_coerce_istrue (coerce.c​:31)
==12496== by 0x4F9BCF0​: MVM_interp_run (interp.c​:242)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Use of uninitialised value of size 8
==12496== at 0x4FAEA3F​: MVM_coerce_istrue (coerce.c​:32)
==12496== by 0x4F9BCF0​: MVM_interp_run (interp.c​:242)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Use of uninitialised value of size 8
==12496== at 0x4FAEBD2​: MVM_coerce_istrue (coerce.c​:65)
==12496== by 0x4F9BCF0​: MVM_interp_run (interp.c​:242)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Use of uninitialised value of size 8
==12496== at 0x4FDFB50​: MVM_p6opaque_real_data (P6opaque.h​:108)
==12496== by 0x4FDFB50​: get_int (P6opaque.c​:452)
==12496== by 0x4FAEBF5​: MVM_coerce_istrue (coerce.c​:65)
==12496== by 0x4F9BCF0​: MVM_interp_run (interp.c​:242)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496==
==12496== HEAP SUMMARY​:
==12496== in use at exit​: 63,559,757 bytes in 231,703 blocks
==12496== total heap usage​: 313,406 allocs, 81,741 frees, 87,015,274
bytes allocated
==12496==
==12496== LEAK SUMMARY​:
==12496== definitely lost​: 22,486 bytes in 344 blocks
==12496== indirectly lost​: 36,640 bytes in 836 blocks
==12496== possibly lost​: 378,880 bytes in 6,745 blocks
==12496== still reachable​: 63,121,751 bytes in 223,778 blocks
==12496== suppressed​: 0 bytes in 0 blocks
==12496== Rerun with --leak-check=full to see details of leaked memory
==12496==
==12496== For counts of detected and suppressed errors, rerun with​: -v
==12496== Use --track-origins=yes to see where uninitialised values
come from
==12496== ERROR SUMMARY​: 466 errors from 14 contexts (suppressed​: 0
from 0)
==12492==
==12492== HEAP SUMMARY​:
==12492== in use at exit​: 27,914 bytes in 728 blocks
==12492== total heap usage​: 4,019 allocs, 3,291 frees, 191,374 bytes
allocated
==12492==
==12492== LEAK SUMMARY​:
==12492== definitely lost​: 12 bytes in 1 blocks
==12492== indirectly lost​: 0 bytes in 0 blocks
==12492== possibly lost​: 0 bytes in 0 blocks
==12492== still reachable​: 27,902 bytes in 727 blocks
==12492== suppressed​: 0 bytes in 0 blocks
==12492== Rerun with --leak-check=full to see details of leaked memory
==12492==
==12492== For counts of detected and suppressed errors, rerun with​: -v
==12492== ERROR SUMMARY​: 0 errors from 0 contexts (suppressed​: 0 from
0)

If I edit MoarVM/src/io/syncpipe.c and disable the if block on line 35, the segfault goes away, but to no surprise, rakudo starts leaking memory and doesn't pass spectest. Most of the errors are in S32-io/pipe.t because the Proc​::Status.exitcode isn't the correct value (it's always 0).

@p6rt
Copy link
Author

p6rt commented Sep 17, 2016

From @MasterDuke17

On Sat Sep 17 06​:28​:42 2016, ddgreen@​gmail.com wrote​:

On Sat Sep 17 05​:29​:22 2016, ddgreen@​gmail.com wrote​:

This happens sometime in the whateverable bots when passing the
output
of decompressing an archive to tar (below are the error messages).

tar​: /tmp/whateverable/rakudo-
moar/27b1ab6bf964b8e3c183109c1a385af49e31e2fb/lib​: Cannot utime​: No
such file or directory
The spawned process exited unsuccessfully (exit code​: 2) in method
run-snippet at /home/bisectable/git/bisectable/Whateverable.pm6
(Whateverable) line 136

Here's the relevant section of Whateverable.pm6

135​: my $proc = run(​:out, :bin, ‘zstd’, ‘-dqc’, ‘--’, “{ARCHIVES-
LOCATION}/$full-commit-hash.zst”);
136​: run(​:in($proc.out), :bin, ‘tar’, ‘x’, ‘--absolute-names’);

We tried adding a sleep(.1) between those two lines, but it still
happens.

I then tried golfing with valgrind and a rakudo that had MoarVM built
with --debug

I ran this​: valgrind perl6-valgrind-m -e 'for ^100 {my $proc =
run(​:out, :bin, "ls"); run(​:in($proc.out), :bin, "false");}'

and get this output​:

This is Rakudo Perl 6 running in valgrind, a tool for debugging and
profiling programs.
Running a program in valgrind usually takes *a lot* more time than
running it directly,
so please be patient.
This Rakudo version is 2016.08.1.202.g.78393.dd built on MoarVM
version 2016.08.47.g.2.eedba.8,
running on arch (4.7.3.1.arch) / linux (4.7.2.1.ARCH)
------------------------------------------------------------------------------------------------
==12496== Memcheck, a memory error detector
==12496== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et
al.
==12496== Using Valgrind-3.11.0 and LibVEX; rerun with -h for
copyright info
==12496== Command​: /home/dan/Source/perl6/install/bin/moar
--execname=/home/dan/Source/perl6/install/bin/perl6-valgrind-m
--libpath=/home/dan/Source/perl6/install/share/nqp/lib
--libpath=/home/dan/Source/perl6/install/share/perl6/lib
--libpath=/home/dan/Source/perl6/install/share/perl6/runtime
/home/dan/Source/perl6/install/share/perl6/runtime/perl6.moarvm -e
for\ ^100\ {my\ $proc\ =\ run(​:out,\ :bin,\ "ls");\
run(​:in($proc.out),\ :bin,\ "false");}
==12496==
==12496== Invalid free() / delete / delete[] / realloc()
==12496== at 0x4C2AD90​: free (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12496== by 0x4FC6CA3​: MVM_free (alloc.h​:29)
==12496== by 0x4FC6CA3​: do_close (syncpipe.c​:37)
==12496== by 0x4FC6CA3​: closefh (syncpipe.c​:52)
==12496== by 0x4FC38BA​: MVM_io_close (io.c​:28)
==12496== by 0x4F8F2E0​: MVM_interp_run (interp.c​:4361)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496== Address 0xffefffe30 is on thread 1's stack
==12496==
==12496== Conditional jump or move depends on uninitialised value(s)
==12496== at 0x4FB7B88​: MVM_intcache_get (intcache.c​:40)
==12496== by 0x4F85C65​: MVM_args_slurpy_positional (args.c​:574)
==12496== by 0x4F9B6DB​: MVM_interp_run (interp.c​:1046)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Conditional jump or move depends on uninitialised value(s)
==12496== at 0x4FEB430​: set_int (P6bigint.c​:73)
==12496== by 0x4F85E31​: MVM_args_slurpy_positional (args.c​:574)
==12496== by 0x4F9B6DB​: MVM_interp_run (interp.c​:1046)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Conditional jump or move depends on uninitialised value(s)
==12496== at 0x4FB7B88​: MVM_intcache_get (intcache.c​:40)
==12496== by 0x4F842C8​: MVM_args_get_pos_obj (args.c​:297)
==12496== by 0x4F913C3​: MVM_interp_run (interp.c​:917)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Conditional jump or move depends on uninitialised value(s)
==12496== at 0x4FEB430​: set_int (P6bigint.c​:73)
==12496== by 0x4F8434C​: MVM_args_get_pos_obj (args.c​:297)
==12496== by 0x4F913C3​: MVM_interp_run (interp.c​:917)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Conditional jump or move depends on uninitialised value(s)
==12496== at 0x5048E6C​: MVM_bigint_cmp (bigintops.c​:479)
==12496== by 0xCBD50CB​: ???
==12496== by 0x5029F28​: MVM_jit_enter_code (compile.c​:136)
==12496== by 0x4F90181​: MVM_interp_run (interp.c​:5535)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Conditional jump or move depends on uninitialised value(s)
==12496== at 0x4F94EDE​: MVM_interp_run (interp.c​:2858)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Use of uninitialised value of size 8
==12496== at 0x4F94EE4​: MVM_interp_run (interp.c​:2858)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Use of uninitialised value of size 8
==12496== at 0x4F94EEE​: MVM_interp_run (interp.c​:2858)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Conditional jump or move depends on uninitialised value(s)
==12496== at 0x4FAEA2A​: MVM_is_null (MVMNull.h​:11)
==12496== by 0x4FAEA2A​: MVM_coerce_istrue (coerce.c​:31)
==12496== by 0x4F9BCF0​: MVM_interp_run (interp.c​:242)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Conditional jump or move depends on uninitialised value(s)
==12496== at 0x4FAEA3D​: MVM_is_null (MVMNull.h​:11)
==12496== by 0x4FAEA3D​: MVM_coerce_istrue (coerce.c​:31)
==12496== by 0x4F9BCF0​: MVM_interp_run (interp.c​:242)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Use of uninitialised value of size 8
==12496== at 0x4FAEA3F​: MVM_coerce_istrue (coerce.c​:32)
==12496== by 0x4F9BCF0​: MVM_interp_run (interp.c​:242)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Use of uninitialised value of size 8
==12496== at 0x4FAEBD2​: MVM_coerce_istrue (coerce.c​:65)
==12496== by 0x4F9BCF0​: MVM_interp_run (interp.c​:242)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496== Use of uninitialised value of size 8
==12496== at 0x4FDFB50​: MVM_p6opaque_real_data (P6opaque.h​:108)
==12496== by 0x4FDFB50​: get_int (P6opaque.c​:452)
==12496== by 0x4FAEBF5​: MVM_coerce_istrue (coerce.c​:65)
==12496== by 0x4F9BCF0​: MVM_interp_run (interp.c​:242)
==12496== by 0x5052758​: MVM_vm_run_file (moar.c​:304)
==12496== by 0x400ED3​: main (main.c​:191)
==12496==
==12496==
==12496== HEAP SUMMARY​:
==12496== in use at exit​: 63,559,757 bytes in 231,703 blocks
==12496== total heap usage​: 313,406 allocs, 81,741 frees,
87,015,274
bytes allocated
==12496==
==12496== LEAK SUMMARY​:
==12496== definitely lost​: 22,486 bytes in 344 blocks
==12496== indirectly lost​: 36,640 bytes in 836 blocks
==12496== possibly lost​: 378,880 bytes in 6,745 blocks
==12496== still reachable​: 63,121,751 bytes in 223,778 blocks
==12496== suppressed​: 0 bytes in 0 blocks
==12496== Rerun with --leak-check=full to see details of leaked
memory
==12496==
==12496== For counts of detected and suppressed errors, rerun with​:
-v
==12496== Use --track-origins=yes to see where uninitialised values
come from
==12496== ERROR SUMMARY​: 466 errors from 14 contexts (suppressed​: 0
from 0)
==12492==
==12492== HEAP SUMMARY​:
==12492== in use at exit​: 27,914 bytes in 728 blocks
==12492== total heap usage​: 4,019 allocs, 3,291 frees, 191,374
bytes
allocated
==12492==
==12492== LEAK SUMMARY​:
==12492== definitely lost​: 12 bytes in 1 blocks
==12492== indirectly lost​: 0 bytes in 0 blocks
==12492== possibly lost​: 0 bytes in 0 blocks
==12492== still reachable​: 27,902 bytes in 727 blocks
==12492== suppressed​: 0 bytes in 0 blocks
==12492== Rerun with --leak-check=full to see details of leaked
memory
==12492==
==12492== For counts of detected and suppressed errors, rerun with​:
-v
==12492== ERROR SUMMARY​: 0 errors from 0 contexts (suppressed​: 0 from
0)

If I edit MoarVM/src/io/syncpipe.c and disable the if block on line
35, the segfault goes away, but to no surprise, rakudo starts leaking
memory and doesn't pass spectest. Most of the errors are in S32-
io/pipe.t because the Proc​::Status.exitcode isn't the correct value
(it's always 0).

AlexDaniel++ reminded me about --full-cleanup, so here's the output of another run with MoarVM built with --debug​:

This is Rakudo Perl 6 running in valgrind, a tool for debugging and profiling programs.
Running a program in valgrind usually takes *a lot* more time than running it directly,
so please be patient.
This Rakudo version is 2016.08.1.212.gab.68.f.82 built on MoarVM version 2016.08.47.g.2.eedba.8,
running on arch (4.7.3.1.arch) / linux (4.7.2.1.ARCH)


==15836== Memcheck, a memory error detector
==15836== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==15836== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==15836== Command​: /home/dan/Source/perl6/install/bin/moar --full-cleanup --execname=/home/dan/Source/perl6/install/bin/perl6-valgrind-m --libpath=/home/dan/Source/perl6/install/share/nqp/lib --libpath=/home/dan/Source/perl6/install/share/perl6/lib --libpath=/home/dan/Source/perl6/install/share/perl6/runtime /home/dan/Source/perl6/install/share/perl6/runtime/perl6.moarvm -e my\ $proc\ =\ run(​:out,\ :bin,\ "ls");\ run(​:in($proc.out),\ :bin,\ "true");
==15836==
==15836== Invalid read of size 8
==15836== at 0x4FC6B04​: do_close (syncpipe.c​:36)
==15836== by 0x4FC6B04​: gc_free (syncpipe.c​:67)
==15836== by 0x4FE359B​: gc_free (MVMOSHandle.c​:48)
==15836== by 0x4FC1F34​: MVM_gc_collect_free_nursery_uncopied (collect.c​:580)
==15836== by 0x4FBE9B6​: MVM_gc_global_destruction (orchestrate.c​:511)
==15836== by 0x50528B1​: MVM_vm_destroy_instance (moar.c​:391)
==15836== by 0x400D2D​: main (main.c​:194)
==15836== Address 0xffefffe20 is on thread 1's stack
==15836== 768 bytes below stack pointer
==15836==
==15836== Invalid free() / delete / delete[] / realloc()
==15836== at 0x4C2AD90​: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15836== by 0x4FC6B0F​: MVM_free (alloc.h​:29)
==15836== by 0x4FC6B0F​: do_close (syncpipe.c​:37)
==15836== by 0x4FC6B0F​: gc_free (syncpipe.c​:67)
==15836== by 0x4FE359B​: gc_free (MVMOSHandle.c​:48)
==15836== by 0x4FC1F34​: MVM_gc_collect_free_nursery_uncopied (collect.c​:580)
==15836== by 0x4FBE9B6​: MVM_gc_global_destruction (orchestrate.c​:511)
==15836== by 0x50528B1​: MVM_vm_destroy_instance (moar.c​:391)
==15836== by 0x400D2D​: main (main.c​:194)
==15836== Address 0xffefffe20 is on thread 1's stack
==15836== 672 bytes below stack pointer
==15836==
==15836==
==15836== HEAP SUMMARY​:
==15836== in use at exit​: 251,811 bytes in 4,470 blocks
==15836== total heap usage​: 229,054 allocs, 224,585 frees, 59,799,213 bytes allocated
==15836==
==15836== LEAK SUMMARY​:
==15836== definitely lost​: 8,998 bytes in 183 blocks
==15836== indirectly lost​: 22,784 bytes in 673 blocks
==15836== possibly lost​: 201,880 bytes in 3,605 blocks
==15836== still reachable​: 18,149 bytes in 9 blocks
==15836== suppressed​: 0 bytes in 0 blocks
==15836== Rerun with --leak-check=full to see details of leaked memory
==15836==
==15836== For counts of detected and suppressed errors, rerun with​: -v
==15836== ERROR SUMMARY​: 2 errors from 2 contexts (suppressed​: 0 from 0)

@p6rt
Copy link
Author

p6rt commented Sep 21, 2016

From @jnthn

On Sat Sep 17 07​:29​:24 2016, ddgreen@​gmail.com wrote​:

AlexDaniel++ reminded me about --full-cleanup, so here's the output of
another run with MoarVM built with --debug​:

This is Rakudo Perl 6 running in valgrind, a tool for debugging and
profiling programs.
Running a program in valgrind usually takes *a lot* more time than
running it directly,
so please be patient.
This Rakudo version is 2016.08.1.212.gab.68.f.82 built on MoarVM
version 2016.08.47.g.2.eedba.8,
running on arch (4.7.3.1.arch) / linux (4.7.2.1.ARCH)
------------------------------------------------------------------------------------------------
==15836== Memcheck, a memory error detector
==15836== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et
al.
==15836== Using Valgrind-3.11.0 and LibVEX; rerun with -h for
copyright info
==15836== Command​: /home/dan/Source/perl6/install/bin/moar --full-
cleanup --execname=/home/dan/Source/perl6/install/bin/perl6-valgrind-m
--libpath=/home/dan/Source/perl6/install/share/nqp/lib
--libpath=/home/dan/Source/perl6/install/share/perl6/lib
--libpath=/home/dan/Source/perl6/install/share/perl6/runtime
/home/dan/Source/perl6/install/share/perl6/runtime/perl6.moarvm -e my\
$proc\ =\ run(​:out,\ :bin,\ "ls");\ run(​:in($proc.out),\ :bin,\
"true");
==15836==
==15836== Invalid read of size 8
==15836== at 0x4FC6B04​: do_close (syncpipe.c​:36)
==15836== by 0x4FC6B04​: gc_free (syncpipe.c​:67)
==15836== by 0x4FE359B​: gc_free (MVMOSHandle.c​:48)
==15836== by 0x4FC1F34​: MVM_gc_collect_free_nursery_uncopied
(collect.c​:580)
==15836== by 0x4FBE9B6​: MVM_gc_global_destruction
(orchestrate.c​:511)
==15836== by 0x50528B1​: MVM_vm_destroy_instance (moar.c​:391)
==15836== by 0x400D2D​: main (main.c​:194)
==15836== Address 0xffefffe20 is on thread 1's stack
==15836== 768 bytes below stack pointer
==15836==
==15836== Invalid free() / delete / delete[] / realloc()
==15836== at 0x4C2AD90​: free (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15836== by 0x4FC6B0F​: MVM_free (alloc.h​:29)
==15836== by 0x4FC6B0F​: do_close (syncpipe.c​:37)
==15836== by 0x4FC6B0F​: gc_free (syncpipe.c​:67)
==15836== by 0x4FE359B​: gc_free (MVMOSHandle.c​:48)
==15836== by 0x4FC1F34​: MVM_gc_collect_free_nursery_uncopied
(collect.c​:580)
==15836== by 0x4FBE9B6​: MVM_gc_global_destruction
(orchestrate.c​:511)
==15836== by 0x50528B1​: MVM_vm_destroy_instance (moar.c​:391)
==15836== by 0x400D2D​: main (main.c​:194)
==15836== Address 0xffefffe20 is on thread 1's stack
==15836== 672 bytes below stack pointer
==15836==
==15836==
==15836== HEAP SUMMARY​:
==15836== in use at exit​: 251,811 bytes in 4,470 blocks
==15836== total heap usage​: 229,054 allocs, 224,585 frees,
59,799,213 bytes allocated
==15836==
==15836== LEAK SUMMARY​:
==15836== definitely lost​: 8,998 bytes in 183 blocks
==15836== indirectly lost​: 22,784 bytes in 673 blocks
==15836== possibly lost​: 201,880 bytes in 3,605 blocks
==15836== still reachable​: 18,149 bytes in 9 blocks
==15836== suppressed​: 0 bytes in 0 blocks
==15836== Rerun with --leak-check=full to see details of leaked memory
==15836==
==15836== For counts of detected and suppressed errors, rerun with​: -v
==15836== ERROR SUMMARY​: 2 errors from 2 contexts (suppressed​: 0 from
0)

The fix in MoarVM/MoarVM@debb859 seems to address this bug and pass the spectest. Would appreciate some further testing, and the bug itself could do with a regression test adding too.

/jnthn

@p6rt
Copy link
Author

p6rt commented Sep 21, 2016

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

@p6rt
Copy link
Author

p6rt commented Sep 22, 2016

From @MasterDuke17

Test added in Raku/roast@6cc1a85cf4

@p6rt
Copy link
Author

p6rt commented Sep 22, 2016

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

@p6rt
Copy link
Author

p6rt commented Sep 24, 2016

From @zoffixznet

On Wed Sep 21 19​:37​:06 2016, ddgreen@​gmail.com wrote​:

Test added in Raku/roast@6cc1a85cf4

This ticket still needs tests for Windows.

@p6rt
Copy link
Author

p6rt commented Sep 24, 2016

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

@p6rt
Copy link
Author

p6rt commented Sep 24, 2016

From @zoffixznet

To be more specific, the Official Perl 6 Specification should not have lines like this as a final product​: https://github.com/perl6/roast/blob/7dfe5a9732f2c3fd9fd16cc0448b958424b2b861/S17-procasync/stress.t#L22

@p6rt
Copy link
Author

p6rt commented Oct 15, 2017

From @zoffixznet

Windows tests​: Raku/roast@a5b3bb1669

@p6rt
Copy link
Author

p6rt commented Oct 15, 2017

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

@p6rt p6rt closed this as completed Oct 15, 2017
@p6rt p6rt added the testneeded label Jan 5, 2020
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