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

[perl #34476] Segfault doing splice on intlist

6 views
Skip to first unread message

Nick Glencross

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


---
osname= linux
osvers= 2.4.21-14.elsmp
arch= i386-linux-thread-multi
cc= gcc 3.4.2 20041006 (Red Hat 3.4.2-5)
---
Flags:
category=core
severity=medium
ack=no
---
Splicing an intlist seems to segfault.

e.g.

.sub main
new P0, .IntList
P0[0] = 100
P0[1] = 200
new P1, .IntList
P1[0] = 300
splice P0, P1, 0, 0
end
.end


The backtrace is

#0 0x080d5cf2 in list_splice (interpreter=0x98e8008, list=0x9ae7754,
value=0x9aaa3f0, offset=0, count=0) at src/list.c:1997
#1 0x081e6145 in Parrot_IntList_splice (interpreter=0x98e8008, pmc=0x9aaa408,
value=0x9aaa3f0, offset=0, count=0) at classes/intlist.c:191
#2 0x0810ba33 in Parrot_splice_p_p_ic_ic (cur_opcode=0x9b210c8,
interpreter=0x98e8008) at experimental.ops:184
#3 0x0816816c in runops_slow_core (interpreter=0x98e8008, pc=0x9b210c8)
at src/runops_cores.c:147
#4 0x0816661d in runops_int (interpreter=0x98e8008, offset=0)
at src/interpreter.c:742
#5 0x08167477 in runops (interpreter=0x98e8008, offs=0) at src/inter_run.c:81
#6 0x080d7459 in Parrot_runcode (interpreter=0x98e8008, argc=1,
argv=0xbffa8c58) at src/embed.c:768
#7 0x080d7292 in Parrot_runcode (interpreter=0x98e8008, argc=1,
argv=0xbffa8c58) at src/embed.c:700
#8 0x0809d8d7 in main (argc=1, argv=0xbffa8c58) at imcc/main.c:603

The offending line is the first in list_splice in list.c:

List *value_list = value ? (List *)PMC_data(value): NULL;

and seems to be the PMC_data operation on 'value'.

There seems to be a test 't/pmc/perlarray.t' which does a splice using
'list_spice', but it seems to work ok.


---
Summary of my parrot 0.1.2 configuration:
configdate='Wed Mar 16 23:42:02 2005'
Platform:
osname=linux, archname=i386-linux-thread-multi
jitcapable=1, jitarchname=i386-linux,
jitosname=LINUX, jitcpuarch=i386
execcapable=1
perl=/usr/bin/perl
Compiler:
cc='gcc', ccflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
Linker and Libraries:
ld='gcc', ldflags=' -L/usr/local/lib',
cc_ldflags='',
libs='-lnsl -ldl -lm -lcrypt -lutil -lpthread -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=1234,
nv=double, numvalsize=8, doublesize=8

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

Jens Rieks

unread,
Mar 18, 2005, 5:46:36 AM3/18/05
to perl6-i...@perl.org
[not directly related to this specific bug report]

On Friday 18 March 2005 00:28, Nick Glencross wrote:
> Splicing an intlist seems to segfault.

...


> The backtrace is
>
> #0 0x080d5cf2 in list_splice (interpreter=0x98e8008, list=0x9ae7754,
> value=0x9aaa3f0, offset=0, count=0) at src/list.c:1997

With the attached patch, parrot aborts with:
parrot: src/list.c:1997: list_splice: Assertion `(value)->pmc_ext' failed.
Aborted

It affects only code compiled without -DNDEBUG.
Should I apply it?

jens

pobj.h.patch

Leopold Toetsch

unread,
Mar 18, 2005, 7:15:08 AM3/18/05
to perl6-i...@perl.org
Nick Glencross <parrotbug...@parrotcode.org> wrote:

> Splicing an intlist seems to segfault.

Ah, yep - fixed.

Thanks for reporting,
leo

Leopold Toetsch

unread,
Mar 18, 2005, 7:32:51 AM3/18/05
to Jens Rieks, perl6-i...@perl.org
Jens Rieks <par...@jensbeimsurfen.de> wrote:

> With the attached patch, parrot aborts with:
> parrot: src/list.c:1997: list_splice: Assertion `(value)->pmc_ext' failed.
> Aborted

> It affects only code compiled without -DNDEBUG.
> Should I apply it?

Looks good and shows immediately that some internals are hosed, yes.

> jens

leo

0 new messages