Ticket #1833 (new bug)

Opened 11 years ago

Last modified 11 years ago

Incompatible bytecode error lacks file name of offending file

Reported by: moritz Owned by: whiteknight
Priority: normal Milestone:
Component: core Version: 2.8.0
Severity: medium Keywords: packfile
Cc: Language: perl6
Patch status: Platform: all

Description (last modified by moritz) (diff)

PackFile_unpack: This Parrot cannot read bytecode files with version 9.0.

PackFile header failed during unpack

This error message should include the name of the file that caused this error; otherwise it is very hard to figure out which file caused the problem.

(Happens on amd64 linux, with gcc 4.4.5)

Change History

Changed 11 years ago by moritz

  • description modified (diff)

Changed 11 years ago by bacek

Hello.

I think it's good "complex GCI task" candidate.

-- Bacek

Changed 11 years ago by cotto

  • keywords gci added

Changed 11 years ago by plobsing

  • status changed from new to closed
  • resolution set to invalid
PackFile header failed during unpack

This error only occurs when an arbitrary string has been passed to ImageIO for thawing (and it has an invalid PackFile header). These strings are, in general, not related to files in any way.

This is made clear by the exception type thrown, EXCEPTION_INVALID_STRING_REPRESENTATION, clearly indicating that it is a string-related, not a file-related, error.

Changed 11 years ago by dukeleto

  • status changed from closed to reopened
  • platform set to all
  • resolution invalid deleted

Changed 11 years ago by dukeleto

I am sure plobsing is correct, but this ticket should not get closed until the GCI task that mentions it is changed or deleted.

Changed 11 years ago by nwellnhof

This is probably triggered when linking against an incompatible libparrot and thawing the config hash in Parrot_gbl_set_config_hash_interpreter() in src/global_setup.c which happens pretty early in init_world(). plobsing noted on IRC:

"And the solution to making that error easier to debug would be (a) to have access to a C level backtrace or (b) for it to be possible to handle exceptions from c (so Parrot_gbl_set_config_hash_interpreter() could spit out something intelligent about the situation)."

As a quick work around, we could also directly test the version of the config_hash before thawing. But I can't find a way to read PARROT_PBC_MAJOR and PARROT_PBC_MINOR from libparrot.

Changed 11 years ago by nwellnhof

Commit d922b8a235 should give the following error message:

Version %d.%d of config hash is invalid, expected %d.%d. You're probably linking against an incompatible libparrot.

Changed 11 years ago by whiteknight

  • lang set to perl6
  • keywords packfile added; gci removed
  • status changed from reopened to new
  • owner set to whiteknight

The format-checking logic was moved into a new function from where nwellnhof had originally put it, and the message was generalized a little bit to be used for all cases of loading in a PMC image through the API. Does this satisfy the requirements of the ticket, or do we need something more?

Changed 11 years ago by moritz

  • summary changed from Incompatible bytecode error lacks important information to Incompatible bytecode error lacks file name of offending file
Note: See TracTickets for help on using tickets.