Ticket #629 (closed bug: fixed)

Opened 5 years ago

Last modified 4 years ago

exception from :immediate sub bus errors.

Reported by: coke Owned by:
Priority: normal Milestone:
Component: none Version: trunk
Severity: medium Keywords:
Cc: Language:
Patch status: Platform:

Description (last modified by coke) (diff)

$ more foo.pir
.sub 'foo' :immediate
  die 'no'
.end
$ ./parrot foo.pir
no
current instr.: 'foo' pc 0 (foo.pir:2)
Bus error

partial backtrace

0x012e1af3 in imcc_globals_destroy (interp=0x500d10, ex_unused=1, param_unused=0x0) at compilers/imcc/pbc.c:316
316         code_segment_t *cs = IMCC_INFO(interp)->globals->cs;
(gdb) bt
#0  0x012e1af3 in imcc_globals_destroy (interp=0x500d10, ex_unused=1, param_unused=0x0) at compilers/imcc/pbc.c:316
#1  0x0107c8e8 in Parrot_exit (interp=0x500d10, status=1) at src/exit.c:91
#2  0x0107ba31 in die_from_exception (interp=0x500d10, exception=0x375e28) at src/exceptions.c:155
#3  0x0107bf0b in Parrot_ex_throw_from_op (interp=0x500d10, exception=0x375e28, dest=0x527398) at src/exceptions.c:225
#4  0x010107be in Parrot_die_sc (cur_opcode=0x527390, interp=0x500d10) at src/op
...

Change History

Changed 5 years ago by coke

  • description modified (diff)
  • summary changed from exception in anon sub with duplicate name bus errors to exception from :immediate sub bus errors.

Updated description with simpler test case.

Changed 5 years ago by NotFound

The culprit is IMCC_INFO(interp)->globals, which has a NULL value and the code doesn't expect it.

I fixed this in r38716 by surrounding the body of the function with an if on that condition, but I'm not sure if this is condition must be allowed or is a symptom of other problem, so I added a comment referring to this ticket.

If someone is sure that the condition must be valid, please delete the comment and close the ticket.

Changed 4 years ago by coke

  • status changed from new to closed
  • resolution set to fixed

It seems reasonable to me that there is no global state since the first thing we're doing is compiling code that tells us to die. I'll leave the reference in the code but close the ticket.

Thanks.

Changed 4 years ago by jimmy

Hi coke, is there a test for this ticket?

Note: See TracTickets for help on using tickets.