Hi list,
I must admit that I'm quite new to XS, but i'm starting to realy
understand how thing works (i hope), excepts for this one :
I'm writing a XS module to wrap around a c library provided only in
binary form (starts bad ain't it :-) ). My XS seems ok, compiles with no
warning with -Wall and make test works fine, and spits out the hash I'm
building correctly. But when I use the same code inside apache-perl, the
child apache crashes. Spitting out in the log :
[Wed Apr 2 17:08:13 2003] [notice] child pid 26140 exit signal Segmentation fault (11)
To check the problem, I added some fprintf(stderr, "was there") in the
incriminated function. 'strace make test' spits out among other things :
[...]
write(2, "was there")
open("XXXX", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0664, st_size=2948, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x40015000
read(4, "XXXX"..., 4096) = 2948
close(4) = 0
munmap(0x40015000, 4096) = 0
write(2, "was there")
[...]
Obviously the block between the two "was there" is executed by the
binary lib. I'm eliminating open, fstat and close as possible source of
the problem (correct me if i'm wrong), which leaves mmap as a possible
cause of trouble.
Can anyone help me to solve this ? Where shall I look to find more
information ? As anyone already seen this happen ? Workaround ? How does
make test and apache-perl differ in context (library links maybe) ?
I'm working on debian woody
apache-perl is 1.3.26-1-1.26-0woody1
perl is 5.6.1-7
Please write to me directly since I'm not (yet) subscribed to the list
Thanks,
Nico
--
Whoa...I did a 'zcat /vmlinuz > /dev/audio' and I think I heard God...
-- mikecd on #Linux