3/31/2024 0 Comments How to get core dumpLogged StackTrace\n", (sig = SIGSEGV) ? "Segmentation" : ((sig = SIGBUS) ? "Bus" : "Unknown")) If (sig = SIGHUP) panic("FATAL: Program hanged up\n") Sigaction(SIGKILL, &sigact, (struct sigaction *)NULL) Sigaction(SIGHUP, &sigact, (struct sigaction *)NULL) Sigaction(SIGQUIT, &sigact, (struct sigaction *)NULL) Sigaction(SIGBUS, &sigact, (struct sigaction *)NULL) Sigaction(SIGSEGV, &sigact, (struct sigaction *)NULL) Sigaction(SIGINT, &sigact, (struct sigaction *)NULL) Printf("About to seg fault by assigning zero to *s\n") You will need to change the sprintf variable to use gdb in the case of Linux. Maybe you could do it this way, this program is a demonstration of how to trap a segmentation fault and shells out to a debugger (this is the original code used under AIX) and prints the stack trace up to the point of a segmentation fault.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |