What methods are there for automatically getting a stack trace on Unix systems? I don't mean just getting a core file or attaching interactively with GDB, but having a SIGSEGV handler that dumps a backtrace to a text file.
Bonus points for the following optional features:
Extra information gathering at crash time (eg. config files).
...
Hello,
I have a bash script that runs a simulation program written in Fortran 90, and all output is redirected to a file. If the program finishes without problems, I set a success parameter. The code looks something like this:
#!/bin/bash
...
echo -n "Running program..."
./sim_program >...
environment: linux, userspace-application created via g++ from a couple of C++ files
(result is an ELF)
there is a problem (SIGSEGV) when traversing the constructor list
( __CTOR_LIST__ )
(note: code called via this list is a kind of system initialisation for every class,
not the constructor-code I wrote)
when I understan...
I have been facing a weird issue in a piece of code.
void app_ErrDesc(char *ps_logbuf, char *pc_buf_err_recno)
{
char *pc_logbuf_in;
char rec_num[10];
char *y = "|";
int i, j;
memset(rec_num, 0, sizeof(rec_num));
memset(pc_buf_err_recno, 0, LOGBUFF);
.....
.....
}
For some reason the first me...
Hello,
I'm trying to understand what's going wrong with a program run in HP-UX 11.11 that results in a SIGSEGV (11, segmentation fault):
(gdb) bt
#0 0x737390e8 in _sigfillset+0x618 () from /usr/lib/libc.2
#1 0x73736a8c in _sscanf+0x55c () from /usr/lib/libc.2
#2 0x7373c23c in malloc+0x18c () from /usr/lib/libc.2
#3 0x7379e3f8 in _fi...
In Objective-C how should I best approximate what in Java I am doing like this:
static private String[] array {"A", "B", "C"};
What I think I need is a simple array that I can index into with some integers. Alternative suggestions are welcome, but bear in mind that if I am getting stuck on this then I am pretty much hopeless anyway...
Recently I tried to use p/invoke in mono (.NET for Linux platform) to write a simple OpenGL application to find out how it works on C# (I've already sucessfully done it on windows). I heard about the tao framework, but I don't want everything for a simple "hello world" like program.
I just stucked at the start. I p/invoked some GL funct...
Any attempts to use Rational/IBM PurifyPlus (Purify or Quantify) on an executable that's linked with the Hoard memory manager results in an immediate SIGSEGV:
0004dcd0 ???????? (f78d4, b, 0, 1, 230f, b)
0002aca0 pure_signal_handler_wrapper (b, ffbff808, ffbff550, fd932000, fdbf91c0, 0) + 740
fdab7188 memcpy (febd1860, 3d0, ff360530, f...
Hello!
My firefox started crashing since today. I haven't changed anything on the system or on firefox config.
I use
strace -ff -o dumpfile.txt firefox
to trace the problem. It's not a big help.
I see the segfault, in two of the generated process dumps,
but how I can trace them to their cause?
After running for 10 seconds and crashin...
I'm working on a memory tracking library where we use mprotect to remove access to most of a program's memory and a SIGSEGV handler to restore access to individual pages as the program touches them. This works great most of the time.
My problem is that when the program invokes a system call (say read) with memory that my library has mar...
I'm moving a project to the new Android Native Development Kit (i.e. JNI) and I'd like to catch SIGSEGV, should it occur (possibly also SIGILL, SIGABRT, SIGFPE) in order to present a nice crash reporting dialog, instead of (or before) what currently happens: the immediate unceremonious death of the process and possibly some attempt by th...
I have an odd bug in my program, it appears to me that malloc() is causing a SIGSEGV, which as far as my understanding goes does not make any sense. I am using a library called simclist for dynamic lists.
Here is a struct that is referenced later:
typedef struct {
int msgid;
int status;
void* udata;
list_t queue;
} msg_...
I need to know the root cause of the segmentation fault and also can anyone tell me how to handle it.
...
Im making a wrapper for the pthread library that allows each thread to have its own set of non-shared memory. Right now the way c is set up if any thread tries to rwe another threads data, the program segfaults. This is fine, I can catch it with a sighandler and call pthread_exit() and continue on with the program.
But not every segfaul...
First and foremost, apologies for any cross-posting. Hope I'm not repeating an issue here, but I was unable to find this elsewhere (via Google and Stack Overflow).
Here's the gist of the error. If I call printf, sprintf or fprintf anywhere within my code, to display a float, I get a SIGSEGV (EXC_BAD_ACCESS) error. Let me give an example...
Hello
I've got (the currently latest) jdk 1.6.0.18 crashing while running a web application on (the currently latest) tomcat 6.0.24 unexpectedly after 4 to 24 hours 4 hours to 8 days of stress testing (30 threads hitting the app at 6 mil. pageviews/day). This is on RHEL 5.2 (Tikanga).
The crash report is at http://pastebin.com/f639a6cf...
EDIT: This reproducible SIGSEGV happens on a Linux machine with more than one proc and more than 2GB of mem, so Java is defaulting to the -server mode. Interestingly enough if I force "-client" there's no crash anymore... (I'm still not too sure what to do with my reproducible SIGSEGV but it's interesting nonetheless).
First note that t...
Hi, I'm writing a client-server app, in which the client has a determined memory address from the server side.
If something goes wrong and the server needs to be reestarted the address the client has is not valid anymore. When using a function using that invalid info a SIGSEGV will be sent to the server as the address may not be its any...
I have a Java process that is working on some large data set in memory. I've seen it crash with a SIGSEGV signal sometimes, so i was wondering some potential causes and fixes could do.
Caues:
JVM bug
Native library bug (e.g pthreads etc)
JNI bug in user code
Fixes:
Upgrade to new JVM
In my particular case, this is the output for...
Hi,
In my application I handle SIGSEG to produce a backtrace and call abort() to generate a core dump.
If I now run a gdb-post-mortem analysis of the core, the thread which caused the SEGFAULT is no longer visible. Is there anything I can do so I see the cause for the SEGFAULT?
Best regards,
Martin
...