Ticket #162 (closed bug: fixed)

Opened 13 years ago

Last modified 12 years ago

Parrot segfaults if specifying a non-sensical namespace

Reported by: kjs Owned by: plobsing
Priority: major Milestone:
Component: imcc Version:
Severity: fatal Keywords:
Cc: parrot-dev@… Language:
Patch status: Platform:

Description

while inspecting imcc's parser, I noticed that a key, in a keylist, is in fact a <var>. A var can be a target, which is just a register.

So, this is allowed: .namespace [$P0]

which doesn't make sense *at all*.

Parrot will segfault on this.

I think the simplest solution is to fix this in the parser (imcc.y); by changing some rules, we can fully disallow writing $P0 (registers in general) as namespace keys.

Change History

Changed 13 years ago by whiteknight

As a basic question, what types of data should be allowed here instead. should .namespace [] accept only constant strings? Are there any other things that belong in there?

Changed 13 years ago by NotFound

Added an assertion that prevent segfault in r35779. Not a solution, but may help to catch and diagnose further related problems.

Changed 13 years ago by whiteknight

  • status changed from new to assigned
  • owner set to whiteknight

Changed 13 years ago by jkeenan

  • component changed from none to imcc

Changed 12 years ago by coke

Segfault for this file:

.namespace [$P0]

still occuring in an optimized build at 41185

Changed 12 years ago by whiteknight

This is an IMCC issue and would require some non-trivial changes to the grammar of IMCC. Do we want to fix this issue in place or just try to avoid it in PIRC?

Changed 12 years ago by coke

We can add a test that pirc will eventually have to pass and leave the ticket open until it does.

Changed 12 years ago by coke

  • status changed from assigned to new
  • owner changed from whiteknight to plobsing

Changed 12 years ago by plobsing

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

fixed in r46484.

Note: See TracTickets for help on using tickets.