Abbiamo una versione integrata del kernel Linux in esecuzione su un core MIP. Il programma che abbiamo scritto gestisce una particolare suite di test. Durante uno dei test di stress (eseguito per circa 12 ore) otteniamo un errore di seg. Questo a sua volta genera un core dump.Miglioramento del debug in caso di arresto anomalo di Linux in un programma C
Sfortunatamente il core dump non è molto utile. Il crash si verifica in alcune librerie di sistema che sono collegate dinamicamente (probabilmente pthread o glibc). Il backtrace nel core dump non è utile perché mostra solo il punto di caduta e nessun altro chiamanti (il nostro spazio utente app è costruita con -O0 -g, ma ancora nessuna traccia informazioni indietro):
Cannot access memory at address 0x2aab1004
(gdb) bt
#0 0x2ab05d18 in ??()
warning: GDB can't find the start of the function at 0x2ab05d18.
GDB is unable to find the start of the function at 0x2ab05d18
and thus can't determine the size of that function's stack frame.
This means that GDB may be unable to access that stack frame, or
the frames below it.
This problem is most likely caused by an invalid program counter or
stack pointer.
However, if you think GDB should simply search farther back
from 0x2ab05d18 for code which looks like the beginning of a
function, you can increase the range of the search using the `set
heuristic-fence-post' command.
Un altro sfortunato -ness è che non possiamo eseguire gdb/gdbserver. gdb/gdbserver continua a rompersi su __nptl_create_event. Vedendo che il test crea thread, timer e distrugge poi ogni 5s è quasi impossibile rimanere seduti per molto tempo a continuare su di essi.
MODIFICA: Un'altra nota, backtrace e backtrace_symbols non è supportata sulla nostra toolchain.
qui:
Esiste un modo di intrappolare colpa seg e generare più dati backtrace, puntatori dello stack, stack di chiamate, ecc?
C'è un modo per ottenere più dati da un core dump che si è arrestato in modo anomalo in un file .so?
Grazie.
Si potrebbe provare a gestire 'SIGSEGV' se è possibile? Non è mai raccomandato, ma sento che potrebbe aiutarti in questa situazione. – Stark07