Ticket #776 (closed bug: worksforme)

Opened 13 years ago

Last modified 12 years ago

segfault in Parrot_str_equal...

Reported by: coke Owned by: coke
Priority: blocker Milestone:
Component: core Version: 1.2.0
Severity: medium Keywords:
Cc: Language: tcl
Patch status: Platform:


Tcl has a TclString PMC - I'm working on renaming that to TclStringPMC and having a TclString PIR class that subclasses the PMC, until I can move everything from the PMC back to the PIR object, then I'll remove the PMC.

Things now mostly work, but I'm getting a segfault in Parrot_str_equal, called from "$I0 = isa foo, 'Undef'". The Foo in question is a TclString (which is now a sublcass of TclStringPMC which in turn is a subclass of String)

the backtrace starts with:

#0  0xb7c16b91 in Parrot_str_equal (interp=0x804f040, s1=0xb6a1bca8, s2=0x1)
    at src/string/api.c:1556
#1  0xb7e6d661 in Parrot_Class_isa_pmc (interp=0x804f040, pmc=0xb6d6ded8,
    lookup=0x81c9a78) at ./src/pmc/class.pmc:1306
#2  0xb7e6d119 in Parrot_Class_isa (interp=0x804f040, pmc=0xb6d6ded8,
    classname=0x812fdc8) at ./src/pmc/class.pmc:1356
#3  0xb7c29c20 in Parrot_isa_i_p_sc (cur_opcode=0xb6e0581c, interp=0x804f040)
    at src/ops/object.ops:225

at src/string/api.c:1556, s1 is "Undef". s2 is (const STRING *) 0x1

going up a level to ./src/pmc/class.pmc:1306, the invalid class name is "self_name"; the value of is_proxy here is 0, which seems wrong to me. (as a subclass of a PMC, shouldn't it be a proxy?)

Change History

Changed 13 years ago by coke

I put my work in progress here into a branch:


You can check this out to duplicate the segfault, with:

prove t/cmd_upvar.t

but this small snippet of tcl is sufficient (runnable with parrot tcl.pbc foo.tcl)

proc eek {} {

upvar 0 a(b) c array set a [list b 3] set c

} eek

Changed 13 years ago by coke

bah. here's the tcl with wiki formatting:

proc eek {} {
  upvar 0 a(b) c
  array set a [list b 3]
  set c

Changed 13 years ago by jkeenan

  • component changed from none to hll_interop

Changed 12 years ago by coke

  • component changed from hll_interop to core

Changed 12 years ago by whiteknight

  • owner set to whiteknight

Changed 12 years ago by coke

  • owner changed from whiteknight to coke

The svn branch mentioned here no longer builds against parrot-latest. Need to try to reproduce this with git-latest code before we can resolve it.

Changed 12 years ago by coke

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

Can't reproduce.

Note: See TracTickets for help on using tickets.