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

--target=parse causes a hang since sometime after 2018.10 #2827

Open
MasterDuke17 opened this issue Apr 9, 2019 · 11 comments
Open

--target=parse causes a hang since sometime after 2018.10 #2827

MasterDuke17 opened this issue Apr 9, 2019 · 11 comments
Labels
regression Issue did not exist previously tests needed Issue is generally resolved but tests were not written yet

Comments

@MasterDuke17
Copy link
Contributor

[20:54] uh, does --target=parse (even for -e '') work for anybody?
[20:56] on two different systems at HEAD, it's just chewing up 100% of a core and ram used keeps growing
[20:56] --target=optimize works fine
[21:03] committable6: 2018.12 say run <perl6 --target=optimize -e ''>
[21:03] MasterDuke, https://gist.github.com/56903b7d96c11d6f019bf38eb0ff22ee
[21:03] committable6: 2018.12 say run <perl6 --target=parse -e ''>
[21:06] hm, its default timeout may be too long for this...
[21:08] MasterDuke, ¦2018.12: ««timed out after 40 seconds» «exit signal = SIGHUP (1)»»
[21:09] committable6: 2018.08 say run <perl6 --target=parse -e ''>
[21:09] MasterDuke, https://gist.github.com/158ea0f9d9ce9dd87bb907df97cd7923
[21:09] committable6: 2018.09 say run <perl6 --target=parse -e ''>
[21:09] MasterDuke, https://gist.github.com/bbaf0dabd274fc316fb3c61b9053371d
[21:09] committable6: 2018.10 say run <perl6 --target=parse -e ''>
[21:09] MasterDuke, https://gist.github.com/78830f5e024c21614b741bab8e32e448
[21:09] committable6: 2018.11 say run <perl6 --target=parse -e ''>
[21:10] ok, looks like it happened sometime between 2018.10 and 2018.11
[21:11] MasterDuke, ¦2018.11: ««timed out after 40 seconds» «exit signal = SIGHUP (1)»»

@AlexDaniel AlexDaniel added regression Issue did not exist previously BLOCKER Preventing the next release of rakudo, or just needing attention before the release labels Apr 9, 2019
@AlexDaniel
Copy link
Contributor

So there's no test anywhere for that? Amazing. I don't like that we missed it.

@AlexDaniel
Copy link
Contributor

Pretty sure it started happening right after 46ef0ea

https://gist.github.com/Whateverable/fabb5bd36bec34e81fd8c6a344854ccc

@lizmat
Copy link
Contributor

lizmat commented Apr 15, 2019

FWIW, I cannot reproduce this on HEAD. Am I missing something?

@MasterDuke17
Copy link
Contributor Author

MasterDuke17 commented Apr 15, 2019

Still does it for me at HEAD. Maybe someone on a non-mac BSD or Windows can try? @Kaiepi

@MasterDuke17
Copy link
Contributor Author

Here's a perf report of running perl6 --target=parse -e '' for a couple seconds.

  66.64%  moar     libmoar.so            [.] MVM_gc_root_add_frame_registers_to_worklist
  12.65%  moar     libmoar.so            [.] MVM_gc_root_add_frame_roots_to_worklist
   3.17%  moar     libmoar.so            [.] process_worklist
   2.47%  moar     libmoar.so            [.] MVM_gc_mark_collectable
   2.21%  moar     libmoar.so            [.] MVM_gc_root_add_gen2s_to_worklist
   1.53%  moar     libc-2.28.so          [.] __memmove_sse2_unaligned_erms
   0.91%  moar     libc-2.28.so          [.] __memset_sse2_unaligned_erms
   0.56%  moar     libmoar.so            [.] MVM_gc_collect_free_nursery_uncopied
   0.51%  moar     libmoar.so            [.] MVM_frame_invoke
   0.46%  moar     libmoar.so            [.] MVM_gc_collect_free_gen2_unmarked
   0.45%  moar     libmoar.so            [.] MVM_gc_mark_collectable@plt
   0.44%  moar     libmoar.so            [.] MVM_gc_root_add_frame_registers_to_worklist@plt
   0.43%  moar     libc-2.28.so          [.] _int_malloc
   0.38%  moar     libmoar.so            [.] gc_mark
   0.35%  moar     perf-15023.map        [.] (gen/moar/stage2/QRegex.nqp:1119)
   0.35%  moar     libmoar.so            [.] MVM_fixed_size_alloc
   0.28%  moar     libmoar.so            [.] VMArray_gc_mark
   0.25%  moar     libmoar.so            [.] MVM_interp_run
   0.25%  moar     libmoar.so            [.] allocate_frame
   0.24%  moar     perf-15023.map        [.] dump_match(gen/moar/stage2/QRegex.nqp:1122)
   0.24%  moar     libmoar.so            [.] MVM_gc_gen2_allocate
   0.22%  moar     libmoar.so            [.] MVM_gc_root_add_frame_roots_to_worklist@plt
   0.21%  moar     libmoar.so            [.] 0x0000000000220ffd
   0.18%  moar     libmoar.so            [.] gc_mark
   0.17%  moar     libmoar.so            [.] MVM_spesh_arg_guard_run
   0.17%  moar     libmoar.so            [.] MVM_gc_allocate_object
   0.17%  moar     perf-15023.map        [.] dump(gen/moar/stage2/QRegex.nqp:1115)
   0.16%  moar     perf-15023.map        [.] Bool(gen/moar/stage2/QRegex.nqp:2289)
   0.15%  moar     libc-2.28.so          [.] memcpy@GLIBC_2.2.5
   0.15%  moar     libmoar.so            [.] remove_one_frame
   0.15%  moar     libc-2.28.so          [.] malloc
   0.12%  moar     libmoar.so            [.] MVM_coerce_istrue

@ugexe
Copy link
Member

ugexe commented Apr 16, 2019

HEAD is stuck for me on OSX

@MasterDuke17
Copy link
Contributor Author

Commenting out this line 46ef0ea#diff-d3980092fdbde9a1dd4a30438f8dba19R1348 causes make install to die with:

===SORRY!=== Error while compiling /home/dan/Source/perl6/rakudo/tools/build/create-moar-runner.p6
Too late to switch language version. Must be used as the very first statement.
at /home/dan/Source/perl6/rakudo/tools/build/create-moar-runner.p6:4
------> use v6⏏;

but "/home/dan/Source/perl6/install/bin/moar" --libpath="blib" --libpath="/home/dan/Source/perl6/install/share/nqp/lib" perl6.moarvm --nqp-lib=blib --target=parse -e '' does not die and instead prints

- statementlist: 
  - statement:  isa NQPArray

@usev6
Copy link
Contributor

usev6 commented Apr 16, 2019

Still does it for me at HEAD. Maybe someone on a non-mac BSD or Windows can try? @Kaiepi

As a data point: It hangs for me at HEAD on FreeBSD 11.2-RELEASE-p4.

@jnthn
Copy link
Member

jnthn commented Apr 18, 2019

It's due to an infinite recursion.

 from gen/moar/stage2/QRegex.nqp:1137  (/home/jnthn/dev/MoarVM/install/bin/../share/nqp/lib/QRegex.moarvm:dump_match)
 from gen/moar/stage2/QRegex.nqp:1172  (/home/jnthn/dev/MoarVM/install/bin/../share/nqp/lib/QRegex.moarvm:)
 from gen/moar/stage2/QRegex.nqp:1116  (/home/jnthn/dev/MoarVM/install/bin/../share/nqp/lib/QRegex.moarvm:dump)
 from gen/moar/stage2/QRegex.nqp:1137  (/home/jnthn/dev/MoarVM/install/bin/../share/nqp/lib/QRegex.moarvm:dump_match)
 from gen/moar/stage2/QRegex.nqp:1172  (/home/jnthn/dev/MoarVM/install/bin/../share/nqp/lib/QRegex.moarvm:)
 from gen/moar/stage2/QRegex.nqp:1116  (/home/jnthn/dev/MoarVM/install/bin/../share/nqp/lib/QRegex.moarvm:dump)
 from gen/moar/stage2/QRegex.nqp:1137  (/home/jnthn/dev/MoarVM/install/bin/../share/nqp/lib/QRegex.moarvm:dump_match)
 from gen/moar/stage2/QRegex.nqp:1172  (/home/jnthn/dev/MoarVM/install/bin/../share/nqp/lib/QRegex.moarvm:)
 from gen/moar/stage2/QRegex.nqp:1116  (/home/jnthn/dev/MoarVM/install/bin/../share/nqp/lib/QRegex.moarvm:dump)
 from gen/moar/stage2/QRegex.nqp:1137  (/home/jnthn/dev/MoarVM/install/bin/../share/nqp/lib/QRegex.moarvm:dump_match)
 from gen/moar/stage2/QRegex.nqp:1172  (/home/jnthn/dev/MoarVM/install/bin/../share/nqp/lib/QRegex.moarvm:)
 from gen/moar/stage2/QRegex.nqp:1116  (/home/jnthn/dev/MoarVM/install/bin/../share/nqp/lib/QRegex.moarvm:dump)
 from gen/moar/stage2/QRegex.nqp:1137  (/home/jnthn/dev/MoarVM/install/bin/../share/nqp/lib/QRegex.moarvm:dump_match)
 from gen/moar/stage2/QRegex.nqp:1172  (/home/jnthn/dev/MoarVM/install/bin/../share/nqp/lib/QRegex.moarvm:)
 from gen/moar/stage2/QRegex.nqp:1116  (/home/jnthn/dev/MoarVM/install/bin/../share/nqp/lib/QRegex.moarvm:dump)

jnthn added a commit to Raku/nqp that referenced this issue Apr 18, 2019
This is sufficient to deal with the hang that was reported in
rakudo/rakudo#2827.
@jnthn
Copy link
Member

jnthn commented Apr 18, 2019

Put in something to the dumper to prevent this. Probably worth adding a Rakudo test so we catch such regressions in the future.

@jnthn jnthn added tests needed Issue is generally resolved but tests were not written yet and removed BLOCKER Preventing the next release of rakudo, or just needing attention before the release labels Apr 18, 2019
@MasterDuke17
Copy link
Contributor Author

@jnthn the output of perl6 --target=parse -e '' used to be:

- statementlist: ''
  - statement: 1 matches
    - EXPR: ''
      - value: ''
        - quote: ''
          - nibble: 

Now it's:

- lang-version: 
  - lang-version: 
    - <self-reference>
- statementlist: 
  - statement:  isa NQPArray

Is there some deeper problem that causes the infinite recursion in <lang-version>?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression Issue did not exist previously tests needed Issue is generally resolved but tests were not written yet
Projects
None yet
Development

No branches or pull requests

6 participants