Ticket #388 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

r37061 breaks rakudo build

Reported by: pmichaud Owned by: cotto
Priority: normal Milestone:
Component: core Version: trunk
Severity: medium Keywords:
Cc: Language:
Patch status: Platform:

Description

Commit r37061 ("[PMC] remove a couple more PMC_str_val instances") causes Parrot to segfault while building Rakudo. Here's the last few lines of the 'make' output:

/usr/bin/perl -e "" > src/gen_setting.pir
/home/pmichaud/parrot/trunk/parrot  -o perl6_s1.pbc perl6.pir
make: *** [perl6_s1.pbc] Segmentation fault

Note that the segfault occurs as part of imcc -- i.e., while compiling a .pir file to a .pbc. So none of Rakudo, PGE, PCT, etc. appear to be involved -- it's strictly a Parrot/imcc bug introduced/exposed by this commit.

Thanks,

Pm

Attachments

patch.patch Download (1.0 KB) - added by jimmy 5 years ago.
pbc_sf.patch Download (0.6 KB) - added by cotto 5 years ago.
segfaults Parrot when writing pbc_sf.pir to pbc
pbc_sf.pir Download (154 bytes) - added by cotto 5 years ago.
segfaults Parrot when run with pbc_sf.patch, as described

Change History

Changed 5 years ago by pmichaud

Steps to reproduce (on x86 linux):

1.  Build Parrot >= r37061.
2.  Check out fresh copy of rakudo into languages/rakudo:
        $ cd languages
        $ git clone git://github.com/rakudo/rakudo.git
3.  Configure and build Rakudo
        $ cd rakudo
        $ perl Configure.pl    # don't use --gen-parrot, or you'll test the wrong version!
        $ make
4.  Watch for the earth-shattering kaboom.

Pm

Changed 5 years ago by cotto

That's awesome. I'll get on it tonight.

Changed 5 years ago by cotto

  • owner set to cotto
  • priority changed from blocker to normal
  • severity changed from high to medium
  • milestone 1.0 deleted

Rakudo builds with r37069, so the fire is out for now. However, I'm leaving this ticket open because I don't fully understand what about the Key PMC caused this breakage. I'll close it once I have a chance to look into the problem more deeply and figure out a test case. From a brief look at key_string, it may be a cow issue. Moo.

In the meantime, I'm toning down the importance of this ticket.

Changed 5 years ago by jimmy

Changed 5 years ago by cotto

Something tricky is going on. I've attached a minimal pir example and a patch to src/packout.c. The patch simply uses Parrot_str_equal instead of == between two strings. The pir causes Parrot to segfault when Parrot tries to convert it to pbc.

The segfault happens because ct->constants[i]->u.string somehow doesn't point to a valid address, so any attempts to dereference it make Parrot die. I'll continue chasing this down, but it may be quicker for someone who's more familiar with the PackFile code.

Changed 5 years ago by cotto

segfaults Parrot when writing pbc_sf.pir to pbc

Changed 5 years ago by cotto

segfaults Parrot when run with pbc_sf.patch, as described

Changed 5 years ago by cotto

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

I'm going to close this ticket under the assumption that pointer comparison between STRING*s dtrt and that the pbc_sf patch actually breaks something instead of simply exposing an extant bug. The immediately surrounding code doesn't give me any reason the think otherwise. Thanks to pmichaud for pointing out my assumption.

Note: See TracTickets for help on using tickets.