[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Fwd: Debugging ADA-C-OS interface?]

As requested on IRC by Samuel. Good luck finding the cause of the
problem. Any ADA programmers around? A clarification: The real-time
library is libgnat-4.6.so and it uses libgnarl-4.6.so to implement
[multi-] tasking. Only executables linked with libgnarl.{a,so}
segfaults. Everything else, built executables, libraries, etc,  works
-------- Forwarded Message --------
From: Svante Signell <svante.signell@telia.com>
Reply-to: svante.signell@telia.com
To: debian-ada@lists.debian.org
Subject: Debugging ADA-C-OS interface?
Date: Tue, 27 Mar 2012 12:33:26 +0200


I have problems how to debug the C-ADA-OS interface for the GNU/Hurd
port of Gnat. I get a segfault for both dynamically and statically
linked files for the music123 prokgram, utilizing tasking. The problems
are in the real-time part of gnat: libgnarl.{a,-4.6.so.1}. Backtraces
are shown below. How are the object file symbol names built up in ADA
and how are they related to the .adb and .ads procedures and functions?

Dynamically linked: 
s-taprop.adb:1341: Interrupt_Management.Initialize;
gdb music123
Program received signal SIGSEGV, Segmentation fault.
0x01050a80 in
system__task_primitives__operations__specific__initializeXnn@plt ()
   from /usr/lib/i386-gnu/libgnarl-4.6.so.1
(gdb) bt
#0  0x01050a80 in
    () from /usr/lib/i386-gnu/libgnarl-4.6.so.1
#1  0x0105dc2f in system.task_primitives.operations.initialize (
    environment_task=0x80689e0) at s-taprop.adb:1341
#2  0x010608fa in system.tasking.initialize () at s-taskin.adb:215
#3  0x0105fdd4 in system.tasking.initialization.init_rts () at
#4  0x01060064 in <system__tasking__initialization___elabb> () at
#5  0x0804ce78 in adainit ()
    at /home/srs/DEBs/music123/music123-16.3/b~music123.adb:211
#6  0x0804cb5a in main (argc=1, argv=(system.address) 0x17ffd88, 
    envp=(system.address) 0x17ffd90)
    at /home/srs/DEBs/music123/music123-16.3/b~music123.adb:266
#7  0x01400c3b in __libc_start_main (main=0x804cb20 <main>, argc=1, 
    ubp_av=0x17ffd88, init=0x805fb50 <__libc_csu_init>, 
    fini=0x805fb40 <__libc_csu_fini>, rtld_fini=0xf340,
    at libc-start.c:257
#8  0x0804cb99 in _start ()

Statically linked:
gdb music123
Program received signal SIGSEGV, Segmentation fault.
    ceiling_priority=-1) at s-taprob.adb:81
81            Object.Ceiling := System.Any_Priority (Init_Priority);
(gdb) bt
#0  system.tasking.protected_objects.initialize_protection
    ceiling_priority=-1) at s-taprob.adb:81
#1  0x0804b91a in <commands___elabs> () at commands.ads:8
#2  0x0804ad16 in adainit ()
    at /home/srs/DEBs/gnat/music123/music123-16.3/b~music123.adb:227
#3  0x0804a99a in main (argc=1, argv=(system.address) 0x15ffdb8, 
    envp=(system.address) 0x15ffdc0)
    at /home/srs/DEBs/gnat/music123/music123-16.3/b~music123.adb:266
#4  0x010b2c3b in __libc_start_main (main=0x804a960 <main>, argc=1, 
    ubp_av=0x15ffdb8, init=0x809f110 <__libc_csu_init>, 
    fini=0x809f100 <__libc_csu_fini>, rtld_fini=0xf340,
    at libc-start.c:257
#5  0x0804a9d9 in _start ()

Same problem if statically linking with the sjlj libgnat.a  and

How to find out where the corresponding C/OS-interface routines are
called. I don't seem to be able to enter the C-routines in gdb?
Furthermore, most init-related functions are defines in init.c, but that
file is part of libgnat, not libgnarl??


Reply to: