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

[perl #34587] Build Segfaults While Generating config.fpmc (Linux PPC)

0 views
Skip to first unread message

Chromatic

unread,
Mar 27, 2005, 6:21:22 PM3/27/05
to bugs-bi...@rt.perl.org
# New Ticket Created by chromatic
# Please include the string: [perl #34587]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=34587 >


---
osname= linux
osvers= 2.4.24-benh0
arch= powerpc-linux
cc= gcc 3.4.3 20041125 (Gentoo Linux 3.4.3-r1, ssp-3.4.3-0,
pie-8.7.7)
---
Flags:
category=core
severity=critical
ack=no
---

The current CVS HEAD has failed for about a week or so at the point
where Parrot tries to generate its configuration library. (I originally
posted in the MinGW thread so it may have looked like another Windows
error. It's not.) Here's the relevant output.

Compiling with:
xx.c
gcc -DDEBUGGING -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g
-Wall -Wstrict-prototypes -Wmissing-prototypes -Winline -Wshadow
-Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings
-Waggregate-return -Winline -W -Wno-unused -Wsign-compare
-Wformat-nonliteral -Wformat-security -Wpacked -Wdisabled-optimization
-Wno-shadow -falign-functions=16 -I./include -I./blib/include -DHAS_JIT
-DPPC -DHAVE_COMPUTED_GOTO -I. -o xx.o -c xx.c
Invoking Parrot to generate runtime/parrot/include/config.fpmc --cross
your fingers
./parrot config_lib.pasm
make: *** [runtime/parrot/include/config.fpmc] Segmentation fault

Here's the backtrace:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 7383)]
0x100b74f0 in pobject_lives (interpreter=0x103ac910, obj=0x35) at
src/dod.c:196
196 if (PObj_is_live_or_free_TESTALL(obj)) {
(gdb) bt
#0 0x100b74f0 in pobject_lives (interpreter=0x103ac910, obj=0x35)
at src/dod.c:196
#1 0x10278d7c in Parrot_SArray_mark (interpreter=0x103ac910,
pmc=0x1056c540)
at classes/sarray.c:276
#2 0x100b7bd4 in Parrot_dod_trace_children (interpreter=0x103ac910,
how_many=4294967295) at src/dod.c:460
#3 0x100b78fc in trace_active_PMCs (interpreter=0x103ac910,
trace_stack=1)
at src/dod.c:378
#4 0x100b87a8 in Parrot_dod_ms_run (interpreter=0x103ac910, flags=1)
at src/dod.c:1198
#5 0x100b88c8 in Parrot_do_dod_run (interpreter=0x103ac910, flags=1)
at src/dod.c:1237
#6 0x1014cbec in mem_allocate (interpreter=0x103ac910,
req_size=0x7ffff384,
pool=0x103aceb0, align_1=15) at src/resources.c:142
#7 0x1014da90 in Parrot_allocate_string (interpreter=0x103ac910,
str=0x10552b10, size=0) at src/resources.c:613
#8 0x10062b8c in string_make_empty (interpreter=0x103ac910,
representation=enum_stringrep_one, capacity=0) at src/string.c:397
#9 0x1025ca44 in Parrot_String_init (interpreter=0x103ac910,
pmc=0x1056a188)
at classes/string.c:46
#10 0x1006954c in pmc_new (interpreter=0x103ac910, base_type=34)
at src/pmc.c:47
#11 0x1027bc50 in get_string_pmc (interpreter=0x103ac910, base_type=52)
at classes/hash.c:120
#12 0x1027d4ec in Parrot_Hash_set_string_keyed (interpreter=0x103ac910,
pmc=0x1056ad28, key=0x10607170, value=0x103d4d18) at
classes/hash.c:635
#13 0x10102130 in Parrot_set_p_kc_sc (cur_opcode=0x10602430,
interpreter=0x103ac910) at set.ops:465
#14 0x101931b4 in runops_slow_core (interpreter=0x103ac910,
pc=0x10602430)
at src/runops_cores.c:147
#15 0x101902a8 in runops_int (interpreter=0x103ac910, offset=0)
at src/interpreter.c:742
#16 0x101917ac in runops (interpreter=0x103ac910, offs=0) at
src/inter_run.c:81
#17 0x100adf18 in Parrot_runcode (interpreter=0x103ac910, argc=1,
argv=0x7ffff618) at src/embed.c:768
#18 0x100add50 in Parrot_runcode (interpreter=0x103ac910, argc=1,
argv=0x7ffff618) at src/embed.c:700
#19 0x10056604 in main (argc=1, argv=0x7ffff618) at imcc/main.c:603

---
Summary of my parrot 0.1.2 configuration:
configdate='Sun Mar 27 14:45:22 2005'
Platform:
osname=linux, archname=powerpc-linux
jitcapable=1, jitarchname=ppc-linux,
jitosname=LINUX, jitcpuarch=ppc
execcapable=1
perl=/usr/bin/perl5.8.6
Compiler:
cc='gcc', ccflags='-DDEBUGGING -pipe -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64',
Linker and Libraries:
ld='gcc', ldflags=' -L/usr/local/lib',
cc_ldflags='',
libs='-lpthread -lnsl -ldl -lm -lcrypt -lutil -lrt -lgmp'
Dynamic Linking:
share_ext='.so', ld_share_flags='-shared -L/usr/local/lib -fPIC',
load_ext='.so', ld_load_flags='-shared -L/usr/local/lib -fPIC'
Types:
iv=long, intvalsize=4, intsize=4, opcode_t=long, opcode_t_size=4,
ptrsize=4, ptr_alignment=1 byteorder=4321,
nv=double, numvalsize=8, doublesize=8

---
Environment:
HOME LANG LANGUAGE LC_ALL LD_LIBRARY_PATH LOGDIR
PATH SHELL

Leopold Toetsch

unread,
Mar 28, 2005, 4:42:18 AM3/28/05
to perl6-i...@perl.org
Chromatic <parrotbug...@parrotcode.org> wrote:

> The current CVS HEAD has failed for about a week or so at the point
> where Parrot tries to generate its configuration library.

Strange.

> (gdb) bt
> #0 0x100b74f0 in pobject_lives (interpreter=0x103ac910, obj=0x35)
> at src/dod.c:196
> #1 0x10278d7c in Parrot_SArray_mark (interpreter=0x103ac910,
> pmc=0x1056c540)
> at classes/sarray.c:276

At that point we have AFAIK two SArrays around: the @ARGV array, which
should be visible in REG_PMC(5) and the interpreter->iglobals array,
see src/global_setup.c.

Could you please check, which of these two PMCs is marked and at what
index of the array the bogus object is marked.

leo

Chromatic

unread,
Mar 28, 2005, 8:41:50 PM3/28/05
to p6i
On Mon, 2005-03-28 at 11:42 +0200, Leopold Toetsch wrote:

> > (gdb) bt
> > #0 0x100b74f0 in pobject_lives (interpreter=0x103ac910, obj=0x35)
> > at src/dod.c:196
> > #1 0x10278d7c in Parrot_SArray_mark (interpreter=0x103ac910,
> > pmc=0x1056c540)
> > at classes/sarray.c:276
>
> At that point we have AFAIK two SArrays around: the @ARGV array, which
> should be visible in REG_PMC(5) and the interpreter->iglobals array,
> see src/global_setup.c.
>
> Could you please check, which of these two PMCs is marked and at what
> index of the array the bogus object is marked.

I've attached a patch representing the code I added for debugging, being
at a loss for how to do this from gdb.

Here's the output:

./parrot config_lib.pasm
Marking 274122152
Iglobals: 274122152
ARGV: 274116056
Checking index 0


make: *** [runtime/parrot/include/config.fpmc] Segmentation fault

It looks like the first element of interpreter->iglobals is wrong. I
set a breakpoint at the print and did a bit of data dumping:

Breakpoint 1, Parrot_SArray_mark (interpreter=0x103ac978,
pmc=0x1056c5a8)
at classes/sarray.c:269
269 printf( "Checking index %d\n", i );
(gdb) x e
0x10576a98: 0xffffff9f
(gdb) p e
$1 = (HashEntry *) 0x10576a98
(gdb) p e->type
$2 = enum_hash_pmc
(gdb) p e->val
$3 = {_b = {_bufstart = 0x0, _buflen = 53}, _ptrs = {_struct_val = 0x0,
_pmc_val = 0x35}, _i = {_int_val = 0, _int_val2 = 53},
_num_val = 2.6185479229586067e-322, _string_val = 0x0}

Is that null _struct_val the problem?

-- c


debug_sarray_segfault.patch

Chromatic

unread,
Mar 28, 2005, 9:10:58 PM3/28/05
to chromatic
On Mon, 2005-03-28 at 17:41 -0800, chromatic wrote:

> It looks like the first element of interpreter->iglobals is wrong.

Obviously storing a null pointer in there doesn't help. Here's a patch
that fixes things for me.

Now gdb says:

Breakpoint 1, Parrot_SArray_mark (interpreter=0x103ac920,
pmc=0x1056c550)
at classes/sarray.c:269
269 switch (e->type) {
(gdb) p e
$1 = (HashEntry *) 0x10576a40


(gdb) p e->type
$2 = enum_hash_pmc
(gdb) p e->val

$3 = {_b = {_bufstart = 0x0, _buflen = 272522888}, _ptrs = {_struct_val
= 0x0,
_pmc_val = 0x103e5e88}, _i = {_int_val = 0, _int_val2 = 272522888},
_num_val = 1.346441966662417e-315, _string_val = 0x0}

I'm curious why this worked anywhere else, though, unless there's
something about my platform that triggered an early DOD run.

-- c


init_class_hash.patch

Chromatic

unread,
Mar 28, 2005, 9:27:47 PM3/28/05
to p6i
On Mon, 2005-03-28 at 17:41 -0800, chromatic wrote:

(apologies if this appears multiple times; I had the wrong address
earlier)

> It looks like the first element of interpreter->iglobals is wrong.

Obviously storing a null pointer in there doesn't help. Here's a patch


that fixes things for me.

Now gdb says:

Breakpoint 1, Parrot_SArray_mark (interpreter=0x103ac920,
pmc=0x1056c550)
at classes/sarray.c:269
269 switch (e->type) {

(gdb) p e
$1 = (HashEntry *) 0x10576a40


(gdb) p e->type
$2 = enum_hash_pmc
(gdb) p e->val

$3 = {_b = {_bufstart = 0x0, _buflen = 272522888}, _ptrs = {_struct_val
= 0x0,

init_class_hash.patch

Leopold Toetsch

unread,
Mar 29, 2005, 3:26:00 AM3/29/05
to Chromatic, perl6-i...@perl.org
Chromatic <chro...@wgz.org> wrote:
> - (INTVAL)IGLOBALS_CLASSNAME_HASH, classname_hash);
> + (INTVAL)IGLOBALS_CLASSNAME_HASH, interpreter->class_hash);

Oouch. Good catch, thanks - applied.

leo

0 new messages