Hi,

I've been playing with Parrot for the last two days trying to get the
disassembler working, but I was not very successful. As I mentioned
earlier in my patch email there were some issues in the debug.c file due
to some uninitialized variables. The second SEGFAULT I get happens due
to some strange memory management issues I don't fully understand. 
The disassembler calls Parrots own sprintf function to throw simple
chars out on a string when it gets another op decoded (Backtrace is
below). What I found out till now is that it is somewhere deep down in
the smallobjects.c and the arena structures.
It seems as if the initialized size of 1024 is not big enough and he
tries to reallocate some more objects, but that does not work somehow.
Though he sets the new size to 4096 the free_list somehow points to a
wrong value after some additions, thus returning a bad ptr in
get_free_object and thus creating a bad n value that leads to the SEGV.
As I said, I have no clue what is happening there, sound like an
uninitialized value problem, but I couldn't make out where that
happened. BTW this happens when I try to disassemble one of my example
programs (testmmu2.urm) that has quite a long bytecode. With shorter
pbcs this does not happen, as it the overflow is connected to the amount
of ops used.

BTW, I managed to write a urm.in for the Configure.pl script and made my
urmc package relative to the parrot root (assuming it in languages/urm).
Now it is completely integrated into the Parrot build process and should
be even more platform independent than e.g. perl6, which has hardcoded /
in it's perl6.in :-)
        http://perl.thiesenweb.de/urmc-0.3.tar.bz2

Have fun,
        Marcus

Program received signal SIGSEGV, Segmentation fault.
0x08134102 in get_free_object (interpreter=0x819bb60, pool=0x81bc438)
    at smallobject.c:143
143         arena->dod_flags[ n >> ARENA_FLAG_SHIFT ] &=
#0  0x08134102 in get_free_object (interpreter=0x819bb60,
    pool=0x81bc438) at smallobject.c:143
#1  0x080f6ae4 in get_free_buffer (interpreter=0x819bb60,
    pool=0x81bc438) at headers.c:55
#2  0x080f6eb3 in new_string_header (interpreter=0x819bb60, flags=8192)
    at headers.c:194
#3  0x0808c735 in string_make (interpreter=0x819bb60,
    buffer=0x816bb8c, len=2, encoding=0x816e140, flags=8192,
    type=0x8198ba0) at string.c:234
#4  0x080f8926 in Parrot_vsprintf_c (interpreter=0x819bb60,
    pat=0x816bb8c "%c", args=0xbffffa88 "6") at misc.c:49
#5  0x080fbb14 in PIO_printf (interpreter=0x819bb60, s=0x816bb8c "%c")
    at io/io.c:664
#6  0x080c7b78 in Parrot_disassemble (interpreter=0x819bb60)
    at embed.c:525
#7  0x0804980c in main (argc=2, argv=0xbffffb14) at disassemble.c:54



-- 
---------------------------------------------------------
|Marcus Thiesen                           ICQ# 108989768|
---------------------------------------------------------
|                   www.thiesenweb.de                   |
---------------------------------------------------------
  28A7 37CC AE2C BB6C D56D  8A3D E614 E56B 7546 75F2

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to