Ticket #1106 (closed bug: fixed)

Opened 12 years ago

Last modified 11 years ago

Cannot presently dump Class pmcs

Reported by: Austin_Hastings Owned by: whiteknight
Priority: minor Milestone: 3.0
Component: library Version: 1.6.0
Severity: medium Keywords:
Cc: Language:
Patch status: Platform: all


Invoking _dumper (the front end to Data::Dumper) on a RPA returned from the .parents() method of a P6object class produces an exception:

"VAR1" => ResizablePMCArray (size:2) [
    Class {get_iter() not implemented in class 'Class'
current instr.: 'parrot;Data::Dumper::Default;genericHash' pc 125 (runtime/parrot/library/Data/Dumper/Default.pir:127)
called from Sub 'parrot;Data::Dumper::Base;dump' pc 382 (runtime/parrot/library/Data/Dumper/Base.pir:252)
called from Sub 'parrot;Data::Dumper::Default;genericArray' pc 421 (runtime/parrot/library/Data/Dumper/Default.pir:323)
called from Sub 'parrot;Data::Dumper::Base;dump' pc 382 (runtime/parrot/library/Data/Dumper/Base.pir:252)
called from Sub 'parrot;Data::Dumper::Default;dumpWithName' pc 40 (runtime/parrot/library/Data/Dumper/Default.pir:57)
called from Sub 'parrot;Data::Dumper;dumper' pc 69 (runtime/parrot/library/Data/Dumper.pir:44)
called from Sub '_dumper' pc 66 (runtime/parrot/library/dumper.pir:93)
called from Sub 'parrot;Grand2;main' pc 24958 (src/gen_classtest.pir:10552)
called from Sub 'parrot;Grand2;_ONLOAD' pc 24771 (src/gen_classtest.pir:10491)
called from Sub 'parrot;Grand2;_block99' pc 24673 (src/gen_classtest.pir:10459)
make: *** [classtest] Error 1

I don't know if dumper was using genericHash because the class pmc identified itself as a hash, or if because Hash is the eventual root of the class hierarchy. Regardless, crash-and-exit seems inappropriate behavior.

Change History

Changed 12 years ago by whiteknight

Are there any other PMC types that have this problem, or is it just Class? I'm trying to see if it is a problem with the mechanism or a problem with this particular PMC.

Changed 12 years ago by coke

Austin - it would be helpful if you could provide a PIR snippet to reproduce this problem. Thanks!

Changed 11 years ago by whiteknight

  • owner set to whiteknight

Changed 11 years ago by whiteknight

  • priority changed from normal to minor
  • platform set to all
  • component changed from none to library
  • milestone set to 3.0

The following code snippet works for me and does not throw an unhandled exception like what was posted in the ticket:

{{ .sub main :main

load_bytecode 'Data/Dumper.pbc' $P0 = newclass 'Foo' $P1 = new ["Data";"Dumper"] $P1.'dumper'($P0)

.end }}}

this isn't the _dumper function like was mentioned, but it is Data::Dumper and it does dump a Class PMC without problems. Unless I can see some kind of concrete counter-example, I'm going to close this ticket in a few days.

Changed 11 years ago by whiteknight

  • status changed from new to assigned

Changed 11 years ago by bacek

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

No one complains. Closing ticket.

Note: See TracTickets for help on using tickets.