via RT Patrick R. Michaud <[EMAIL PROTECTED]> wrote:
With the latest changes to the perl6 compiler I'm starting to see
miscellaneous core dumps from Parrot. I think it's likely GC or
pointer related, as the program in question runs correctly with the
-G flag present.
The core dump appears for me in r15764. The steps to build perl6.pbc:
1. build parrot
2. cd languages/perl6
3. make
After building the perl6.pbc compiler, running perl6.pbc on
t/00-parrot/07-op-string.t produces the core dump:
$ ../../parrot perl6.pbc t/00-parrot/07-op-string.t
parrot: src/string.c:2086: string_hash: Assertion `s->encoding && s->charset &&
!(((s)->obj.flags) & b_PObj_on_free_list_FLAG)' failed.
Aborted (core dumped)
While I didn't get this error here, I got it on one of the other Perl6
tests and spent some time debugging. The portion of the assertion that
fails is
!(((s)->obj.flags) & b_PObj_on_free_list_FLAG
which means that this string has been garbage collected. I saw a
couple different instances of this problem and in all of them, the
string in question was a constant (some were C-level and others were
PIR-level).
So the underlying problem is that constant strings are getting
collected when they shouldn't. The easy fix is to not collect *any*
constant PObj headers (see patch below). Is this correct? Or is there
a case when they should get collected? If it's the later, does somehow
know how to fix the issue?
--
Matt Diephouse
http://matt.diephouse.com
Index: src/dod.c
===================================================================
--- src/dod.c (revision 15920)
+++ src/dod.c (working copy)
@@ -553,6 +553,8 @@
for (i = nm = 0; i < cur_arena->used; i++) {
if (PObj_on_free_list_TEST(b))
; /* if its on free list, do nothing */
+ else if (PObj_constant_TEST(b))
+ ; /* if its a constant, do nothing */
else if (PObj_live_TEST(b)) {
/* its live */
total_used++;