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

'try' at BEGIN time hangs in Rakudo #2950

Closed
p6rt opened this issue Oct 27, 2012 · 8 comments
Closed

'try' at BEGIN time hangs in Rakudo #2950

p6rt opened this issue Oct 27, 2012 · 8 comments

Comments

@p6rt
Copy link

p6rt commented Oct 27, 2012

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

Searchable as RT115502$

@p6rt
Copy link
Author

p6rt commented Oct 27, 2012

From @masak

<diakopter> r​: macro marco { try 0 }; marco
<p6eval> rakudo 6859fb​: OUTPUT«(timeout)»
<diakopter> masak​: ^^
* masak submits rakudobug
<masak> r​: BEGIN { try 0 }; say "alive"
<p6eval> rakudo 6859fb​: OUTPUT«(timeout)»
<masak> seems it has nothing to do with macros, just 'try' at BEGIN time.
<diakopter> oh

@p6rt
Copy link
Author

p6rt commented Nov 19, 2012

From @FROGGS

gdb backtrace, in case it helps...

@p6rt
Copy link
Author

p6rt commented Nov 19, 2012

From @FROGGS

gdb --args install/bin/perl6 -e 'BEGIN { try 0 }; say "alive"'
GNU gdb (GDB) 7.5-ubuntu
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+​: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software​: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see​:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/froggs/dev/rakudo-2012-11/install/bin/perl6...done.
(gdb) run
Starting program​: /home/froggs/dev/rakudo-2012-11/install/bin/perl6 -e BEGIN\ \{\ try\ 0\ \}\;\ say\ \"alive\"
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
Parrot_gc_new_pmc_header (interp=interp@​entry=0x611050, flags=0) at src/gc/api.c​:312
312 PMC * const pmc = interp->gc_sys->allocate_pmc_header(interp, flags);
(gdb) bt full
#​0 Parrot_gc_new_pmc_header (interp=interp@​entry=0x611050, flags=0) at src/gc/api.c​:312
  pmc = <optimized out>
#​1 0x00007ffff7a5e68d in get_new_pmc_header (interp=interp@​entry=0x611050, base_type=<optimized out>, flags=<optimized out>, flags@​entry=0) at src/pmc.c​:567
  newpmc = <optimized out>
  vtable = 0x641190
  vtable_flags = <optimized out>
#​2 0x00007ffff7a5ebec in Parrot_pmc_new_init_int (interp=interp@​entry=0x611050, base_type=base_type@​entry=23, init=2) at src/pmc.c​:658
  pmc = <optimized out>
  classobj = <optimized out>
#​3 0x00007ffff7a44bed in parse_signature_string (interp=0x611050, signature=0x7ffff7b3c818 "PiP", arg_flags=0x7fffff7ff0c8) at src/call/args.c​:1477
  current_array = <optimized out>
  x = <optimized out>
  flags = 0
  set = 0
  count = <optimized out>
#​4 0x00007ffff7a46c6b in Parrot_pcc_fill_params_from_varargs (interp=0x611050, call_object=0x109a4578, signature=<optimized out>, args=args@​entry=0x7fffff7ff0f8,
  direction=direction@​entry=PARROT_ERRORS_PARAM_COUNT_FLAG) at src/call/args.c​:1403
  raw_sig = 0x698108
  function_pointers = {intval = 0x7ffff7a44880 <intval_param_from_c_args>, numval = 0x7ffff7a448b0 <numval_param_from_c_args>, string = 0x7ffff7a448e0 <string_param_from_c_args>,
  pmc = 0x7ffff7a44910 <pmc_param_from_c_args>, intval_constant = 0x7ffff7a44940 <intval_constant_from_varargs>, numval_constant = 0x7ffff7a44950 <numval_constant_from_varargs>,
  string_constant = 0x7ffff7a44960 <string_constant_from_varargs>, pmc_constant = 0x7ffff7a44970 <pmc_constant_from_varargs>}
#​5 0x00007ffff7a46d28 in Parrot_pcc_fill_params_from_c_args (interp=interp@​entry=0x611050, call_object=call_object@​entry=0x109a4578, signature=signature@​entry=0x7ffff7b3c818 "PiP")
  at src/call/args.c​:1356
  args = {{gp_offset = 24, fp_offset = 48, overflow_arg_area = 0x7fffff7ff1d0, reg_save_area = 0x7fffff7ff110}}
#​6 0x00007ffff7accebc in Parrot_ExceptionHandler_nci_can_handle (interp=0x611050, _self=0x69dd60) at src/pmc/exceptionhandler.c​:189
  exception = 0x7ffff7a3da4c <gc_gms_allocate_pmc_attributes+76>
  _ctx = <optimized out>
  _call_object = 0x109a4578
#​7 0x00007ffff7add274 in Parrot_NativePCCMethod_invoke (interp=0x611050, _self=<optimized out>, next=0x0) at src/pmc/nativepccmethod.c​:124
  func = <optimized out>
  fptr = <optimized out>
#​8 0x00007ffff7a4434a in Parrot_pcc_invoke_from_sig_object (interp=interp@​entry=0x611050, sub_obj=0x69dd60, call_object=call_object@​entry=0x109a4578) at src/call/pcc.c​:330
  dest = <optimized out>
  ret_cont = 0x109a45c8
#​9 0x00007ffff7a44557 in Parrot_pcc_invoke_method_from_c_args (interp=interp@​entry=0x611050, pmc=pmc@​entry=0x7e70d40, method_name=0x622b88, signature=signature@​entry=0x7ffff7b3c067 "P->I")
  at src/call/pcc.c​:218
  call_obj = 0x109a4578
  sub_obj = <optimized out>
  args = {{gp_offset = 40, fp_offset = 48, overflow_arg_area = 0x7fffff7ff3b0, reg_save_area = 0x7fffff7ff2c0}}
  arg_sig = 0x7ffff7b3c067 "P->I"
  ret_sig = <optimized out>
  old_call_obj = 0x698108
#​10 0x00007ffff7a64136 in Parrot_cx_find_handler_local (interp=interp@​entry=0x611050, task=task@​entry=0x109a3e20) at src/events.c​:356
  valid_handler = 0
  handler = 0x7e70d40
  already_doing = 1
  keep_context = 0x7e70cc8
  context = 0x7e70cc8
  handled_str = <optimized out>
  handler_str = 0x61e200
[...]

@p6rt
Copy link
Author

p6rt commented Jan 8, 2013

From @moritz

A bit more experimenting​:

* jnthn wonders where on earth it hangs...
< jnthn> r​: BEGIN { say 1; try 0; say 2; }; say "alive"
<+p6eval> rakudo ffde43​: OUTPUT«(timeout)1␤»
< moritz> so it hangs at run time
< jnthn> r​: BEGIN { say 1; try say 1.5; say 2; }; say "alive"
<+p6eval> rakudo ffde43​: OUTPUT«(timeout)1␤1.5␤»
< moritz> r​: BEGIN { if 0 { try 1 }; say 'alive' }
<+p6eval> rakudo ffde43​: OUTPUT«alive␤»
diakopter> r​: BEGIN { say 1; eval 'try 0'; say 2; }; say "alive"
<+p6eval> rakudo ffde43​: OUTPUT«1␤2␤alive␤»
< jnthn> Very weird
< moritz> r​: BEGIN { try die 42; say "alive" }
<+p6eval> rakudo ffde43​: OUTPUT«(timeout)»
< tadzik> r​: BEGIN { say 1; CATCH {} }; say 2
<+p6eval> rakudo ffde43​: OUTPUT«1␤2␤»
< diakopter> r​: BEGIN { say 1; eval 'die'; say 2; }; say "alive"

@p6rt
Copy link
Author

p6rt commented Jan 8, 2013

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

@p6rt
Copy link
Author

p6rt commented Oct 8, 2014

From @usev6

This does no longer hang.

$ perl6-m -e 'BEGIN { try 0 }; say "alive"'
alive
$ perl6-p -e 'BEGIN { try 0 }; say "alive"'
alive
$ perl6-j -e 'BEGIN { try 0 }; say "alive"'
alive

I added a test to S04-phasers/begin.t with the following commit​: Raku/roast@05bf75e3b6

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 8, 2014

From @usev6

This does no longer hang.

$ perl6-m -e 'BEGIN { try 0 }; say "alive"'
alive
$ perl6-p -e 'BEGIN { try 0 }; say "alive"'
alive
$ perl6-j -e 'BEGIN { try 0 }; say "alive"'
alive

I added a test to S04-phasers/begin.t with the following commit​: Raku/roast@05bf75e3b6

@p6rt
Copy link
Author

p6rt commented Oct 8, 2014

@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