Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #39378] Pheme Segfault with Keyed Class Names

1 view
Skip to first unread message

Chromatic

unread,
Jun 9, 2006, 3:19:07 PM6/9/06
to bugs-bi...@rt.perl.org
# New Ticket Created by chromatic
# Please include the string: [perl #39378]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=39378 >


Hi there,

I started to port Pheme's class names to the new keyed style. Applying this
patch and rebuilding causes segfaults in some tests and multidispatch
failures in others.

Oddly, I see these only when running through the Pheme interpreter, not when
dumping out the raw PIR code and executing that.

Here's the backtrace from parrot pheme.pbc t/car.t:

(gdb) run pheme.pbc t/car.t
Starting program: /home/chromatic/dev/parrot/parrot pheme.pbc t/car.t
[Thread debugging using libthread_db enabled]
[New Thread 805415360 (LWP 22606)]
[New Thread 814109936 (LWP 22609)]
[New Thread 822498544 (LWP 22610)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 805415360 (LWP 22606)]
0x0fdd97a8 in Parrot_Context_info (interpreter=0x1001a008, ctx=0x0,
info=0x7f9e7b20) at sub.c:316
316 if (PMC_IS_NULL(ctx->current_sub)) {
(gdb) bt
#0 0x0fdd97a8 in Parrot_Context_info (interpreter=0x1001a008, ctx=0x0,
info=0x7f9e7b20) at sub.c:316
#1 0x0fdd9c34 in Parrot_Context_infostr (interpreter=0x1001a008, ctx=0x0)
at sub.c:387
#2 0x0fea8c60 in Parrot_Continuation_get_string (interpreter=0x1001a008,
pmc=0x10245128) at continuation.pmc:293
#3 0x0fde052c in key_string (interpreter=0x1001a008, key=0x10245128)
at key.c:367
#4 0x0feeb41c in Parrot_NameSpace_get_pointer_keyed (interpreter=0x1001a008,
pmc=0x1004fed8, key=0x10245128) at namespace.pmc:292
#5 0x0fddc5b0 in pmc_type_p (interpreter=0x1001a008, name=0x10245140)
at pmc.c:416
#6 0x0fe73650 in mmd_cvt_to_types (interpreter=0x1001a008,
multi_sig=0x10245158) at mmd.c:1278
#7 0x0fe73760 in mmd_distance (interpreter=0x1001a008, pmc=0x10245188,
arg_tuple=0x10297ea0) at mmd.c:1305
#8 0x0fe73b04 in mmd_sort_candidates (interpreter=0x1001a008,
arg_tuple=0x10297ea0, cl=0x10297e88) at mmd.c:1411
#9 0x0fe731cc in mmd_search_default (interpreter=0x1001a008, meth=0x310bdb70,
arg_tuple=0x10297ea0) at mmd.c:1168
#10 0x0fe7274c in Parrot_MMD_search_default_func (interpreter=0x1001a008,
meth=0x310bdb70) at mmd.c:912
#11 0x0fe3cc5c in Parrot_get_name (interpreter=0x1001a008, name=0x310bdb70)
at global.c:185
#12 0x0fcd76f0 in Parrot_find_name_p_sc (cur_opcode=0x1034b3a0,
interpreter=0x1001a008) at var.ops:199
#13 0x0fdda494 in runops_slow_core (interpreter=0x1001a008, pc=0x1034b3a0)
at runops_cores.c:180
#14 0x0fdbec64 in runops_int (interpreter=0x1001a008, offset=3)
at interpreter.c:775
#15 0x0fdc4d18 in runops (interpreter=0x1001a008, offs=3) at inter_run.c:81
#16 0x0fdc5030 in runops_args (interpreter=0x1001a008, sub=0x10188e10,
obj=0x10054578, meth=0x0, sig=0xff3ea88 "vP", ap=0x7f9e7ee0)
at inter_run.c:182
#17 0x0fdc5224 in Parrot_runops_fromc_args (interpreter=0x1001a008,
sub=0x10188e10, sig=0xff3ea88 "vP") at inter_run.c:276
#18 0x0fe3ecc0 in Parrot_runcode (interpreter=0x1001a008, argc=2,
argv=0x7f9e81e8) at embed.c:802
#19 0x10003a0c in main (argc=2, argv=0x7f9e81e8) at main.c:681

For some reason, the continuation being used has an empty context. I haven't
been able to track it down further.

-- c

Leopold Toetsch

unread,
Jun 10, 2006, 4:44:13 AM6/10/06
to perl6-i...@perl.org, bugs-bi...@netlabs.develooper.com

On Jun 9, 2006, at 21:19, chromatic (via RT) wrote:

>
> I started to port Pheme's class names to the new keyed style.
> Applying this
> patch

Patch missing?
leo

Chromatic

unread,
Jun 10, 2006, 11:51:21 AM6/10/06
to perl6-i...@perl.org, Leopold Toetsch, bugs-bi...@netlabs.develooper.com
On Saturday 10 June 2006 01:44, Leopold Toetsch wrote:

> Patch missing?

That would explain the segfault. No seriously, here it is.

-- c

pheme_keyed_classname.patch

Leopold Toetsch

unread,
Jun 12, 2006, 8:56:30 AM6/12/06
to perl6-i...@perl.org, chromatic, bugs-bi...@netlabs.develooper.com
Am Freitag, 9. Juni 2006 21:19 schrieb chromatic:
> Oddly, I see these only when running through the Pheme interpreter, not
> when dumping out the raw PIR code and executing that.

(gdb) r -G pheme.pbc t/cdr.t
1..2
ok 1 - tail of three elem list should be two elem list
ok 2 - tail of two elem list should be one elem list

When GC is enabled, I see the same error as shown in the backtrace. Looks like
a GC bug to me. For some strange reason, the key in the multi signature has
the key_number bit set, which is leading to the segfault.

For now I'd suggest to disable DOD/GC for runtime by emitting sweepoff &
collectoff opcodes.

leo

Leopold Toetsch

unread,
Jun 16, 2006, 7:38:46 AM6/16/06
to perl6-i...@perl.org, chromatic, bugs-bi...@netlabs.develooper.com
Am Freitag, 9. Juni 2006 21:19 schrieb chromatic:
> I started to port Pheme's class names to the new keyed style.  Applying
> this patch and rebuilding causes segfaults in some tests and multidispatch
> failures in others.

This is now (r12950) fixed. I accidentally did also ci the patch. I hope this
is ok - else just revert it (sorry).

leo

Chromatic

unread,
Jun 16, 2006, 1:48:41 PM6/16/06
to perl6-i...@perl.org, Leopold Toetsch, chromatic, bugs-bi...@netlabs.develooper.com
On Friday 16 June 2006 04:38, Leopold Toetsch wrote:

> This is now (r12950) fixed. I accidentally did also ci the patch. I hope
> this is ok - else just revert it (sorry).

It's okay. I had to rebuild Pheme, but I can confirm the fix. Thanks again,
Leo!

-- c

0 new messages