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

make()ing a range 1..$/ leads to segmentation fault #826

Closed
p6rt opened this issue Mar 22, 2009 · 5 comments
Closed

make()ing a range 1..$/ leads to segmentation fault #826

p6rt opened this issue Mar 22, 2009 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Mar 22, 2009

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

Searchable as RT64104$

@p6rt
Copy link
Author

p6rt commented Mar 22, 2009

From @moritz

Rakudo 8207372ae394ca87667e974a2be2cd547def1f9c
on parrot r37565 (amd64 linux)

grammar Math {
  token TOP { ^ <value> $ {*} }
  token value { \d+ {*} }
}
class Actions {
  method value($/) { say 'in value()'; make 1..$/};
  method TOP($/) { say 'in TOP()'; make 1 + $/<value>};
}

my $x := Math.parse('234', :action(Actions.new));

say $x ?? 'matched' !! 'no match';

# Output​:
in value()
in TOP()
Segmentation fault

in gdb​:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f869d59c6f0 (LWP 10687)]
0x00007f869cd7bcac in Parrot_pcc_invoke_from_sig_object (interp=Cannot
access memory at address 0x7fffa4dc5828
)
  at src/call/pcc.c​:2917
2917 {
(gdb) bt
#​0 0x00007f869cd7bcac in Parrot_pcc_invoke_from_sig_object
(interp=Cannot acces
s memory at address 0x7fffa4dc5828
)
  at src/call/pcc.c​:2917
#​1 0x00007f869cd80102 in Parrot_pcc_invoke_sub_from_c_args
(interp=0x23ec010,
  sub_obj=0x25b4490, sig=0x7f869d0645b2 "P->I") at src/call/pcc.c​:2629
#​2 0x00007f869cf72e3e in Parrot_Object_get_integer (interp=0x23ec010,
  pmc=0x7f86986105d0) at ./src/pmc/object.pmc​:415
#​3 0x00007f869cd7973b in convert_arg_from_pmc (interp=0x23ec010,
  st=0x7fffa4dc9bf0) at src/call/pcc.c​:1113
#​4 0x00007f869cd7d475 in Parrot_convert_arg (interp=0x23ec010,
  st=0x7fffa4dc9bf0) at src/call/pcc.c​:1828
#​5 0x00007f869cd7e2c0 in Parrot_process_args (interp=0x23ec010,
  st=0x7fffa4dc9bf0, param_or_result=PARROT_PASS_RESULTS)
  at src/call/pcc.c​:1694
#​6 0x00007f869cd7e87b in parrot_pass_args (interp=0x23ec010,
  src_ctx=0x2db0750, dest_ctx=0x308e8d0, src_indexes=0x7f8698b6de48,
  dest_indexes=0x7f8698b6e218, param_or_result=PARROT_PASS_RESULTS)
  at src/call/pcc.c​:1884
#​7 0x00007f869cd1f0f4 in Parrot_set_returns_pc (cur_opcode=0x7f8698b6de48,
  interp=0x23ec010) at src/ops/core.ops​:656
#​8 0x00007f869cdd5ad5 in runops_slow_core (interp=0x23ec010,
  pc=0x7f8698b6de48) at src/runops_cores.c​:461
#​9 0x00007f869cd83765 in runops_int (interp=0x23ec010, offset=527)
  at src/interpreter.c​:980
#​10 0x00007f869cd8426a in runops (interp=0x23ec010, offs=527)
  at src/call/ops.c​:107
#​11 0x00007f869cd7c05e in Parrot_pcc_invoke_from_sig_object
(interp=0x23ec010,
  sub_obj=0x7f8698fcf3a0, sig_obj=0x7f8698f87280) at src/call/pcc.c​:2994
#​12 0x00007f869cd80102 in Parrot_pcc_invoke_sub_from_c_args
(interp=0x23ec010,
  sub_obj=0x7f8698fcf3a0, sig=0x7f869d0645b2 "P->I") at
src/call/pcc.c​:2629
#​13 0x00007f869cf72e3e in Parrot_Object_get_integer (interp=0x23ec010,
  pmc=0x7f869861bbb0) at ./src/pmc/object.pmc​:415
#​14 0x00007f869a3ba82d in Parrot_ObjectRef_get_integer (interp=0x23ec010,
  pmc=0x7f8698f88120) at ./objectref.pmc​:74
#​15 0x00007f869cec417a in Parrot_Integer_multi_cmp_DEFAULT
(interp=0x23ec010,
  pmc=0x7f8698f881b0, value=0x7f8698f88120) at ./src/pmc/integer.pmc​:1209
#​16 0x00007f869cda01a6 in pcf_I_JPP (interp=0x23ec010, self=0x24cbf90)
  at src/nci.c​:695
#​17 0x00007f869ceba617 in Parrot_NCI_invoke (interp=0x23ec010,
pmc=0x24cbf90,
  next=0x0) at ./src/pmc/nci.pmc​:330
#​18 0x00007f869cd7bf8a in Parrot_pcc_invoke_from_sig_object
(interp=0x23ec010,
  sub_obj=0x24cbf90, sig_obj=0x7f8698f87610) at src/call/pcc.c​:2980
#​19 0x00007f869cd91670 in Parrot_mmd_multi_dispatch_from_c_args (
  interp=0x23ec010, name=0x7f869d01161f "cmp", sig=0x7f869d0112e9 "PP->I")
  at src/multidispatch.c​:340
#​20 0x00007f869ce847b6 in Parrot_default_cmp (interp=0x23ec010,
  pmc=0x7f8698f881b0, value=0x7f8698f88120) at ./src/pmc/default.pmc​:2439
#​21 0x00007f869cf75d0e in Parrot_Object_cmp (interp=0x23ec010,
  pmc=0x7f8698f88270, value=0x7f8698f88120) at ./src/pmc/object.c​:1290
#​22 0x00007f869ccf1023 in Parrot_isle_i_p_p (cur_opcode=0x7f869d3ece38,
  interp=0x23ec010) at src/ops/cmp.ops​:793
#​23 0x00007f869cdd5ad5 in runops_slow_core (interp=0x23ec010,
  pc=0x7f869d3ece38) at src/runops_cores.c​:461
#​24 0x00007f869cd83765 in runops_int (interp=0x23ec010, offset=8394)
  at src/interpreter.c​:980
#​25 0x00007f869cd8426a in runops (interp=0x23ec010, offs=8394)
  at src/call/ops.c​:107
#​26 0x00007f869cd84646 in runops_args (interp=0x23ec010, sub=0x25b5390,
  obj=0x7f8698f883f0, meth_unused=0x23fadd0, sig=0x7f869d0644a7 "I",
  ap=0x7fffa4dd27a0) at src/call/ops.c​:254
#​27 0x00007f869cd8500d in Parrot_run_meth_fromc_args_reti
(interp=0x23ec010,
  sub=0x25b5390, obj=0x7f8698f883f0, meth=0x23fadd0,
sig=0x7f869d0644a7 "I")
  at src/call/ops.c​:492
#​28 0x00007f869cf72feb in Parrot_Object_get_bool (interp=0x23ec010,
  pmc=0x7f8698f883f0) at ./src/pmc/object.c​:2305
#​29 0x00007f869cce7be3 in Parrot_unless_p_ic (cur_opcode=0x7f869d3ebdf0,
  interp=0x23ec010) at src/ops/core.ops​:433
#​30 0x00007f869cdd5ad5 in runops_slow_core (interp=0x23ec010,
  pc=0x7f869d3ebdf0) at src/runops_cores.c​:461
#​31 0x00007f869cd83765 in runops_int (interp=0x23ec010, offset=8661)
...

Looks like an infinite loop, the backtrace goes on quite long...

Moritz

@p6rt
Copy link
Author

p6rt commented May 7, 2009

From @moritz

Works now, just needs tests.

@p6rt
Copy link
Author

p6rt commented May 7, 2009

@moritz - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented May 8, 2009

From @moritz

Tested in t/spec/S05-grammar/action-stubs.t

@p6rt
Copy link
Author

p6rt commented May 8, 2009

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

@p6rt p6rt closed this as completed May 8, 2009
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant