[Top][All Lists]

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

Re: [bug-libsigsegv] libsigsegv

From: Jonny Grant
Subject: Re: [bug-libsigsegv] libsigsegv
Date: Wed, 10 Apr 2019 18:15:16 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 31/03/2019 22:43, Bruno Haible wrote:
Jonny Grant wrote:
Would be good if there was a simple example and an example of the kind
of output we could expect. At the moment it just looks like test files.

The files tests/sigsegv1.c and tests/stackoverflow1.c are simple
fully working examples. Other than that, please refer to README and sigsegv.h.

Something with a backtrace of a SEGV would be handy..

When there is a SIGSEGV, the gdb stack trace is most often inaccurate.
The only reliable information that you get is
   - the fault address,
   - the information whether it's a stack overflow or not.



Thank you for your reply Bruno! I had a look and tests/sigsegv1.c and tests/stackoverflow1.c seems to have SIGSEGV handlers, but doesn't offer a stack trace? I wrote the attached, it's pretty simple and outputs a little stack trace. I was just hoping for something a little more advanced than my addr2line wrapper! but at least I have something for the moment to use.

From my experience I've always been fortunate that stack trace is generally pretty accurate with gdb, maybe I've been lucky.

Unhandled C++ exception: [vector::_M_range_check: __n (which is 0) >= this->size() (which is 0)]

[0]: ./exception5(+0x108d) [0x557502de108d]

[1]: ./exception5(+0x1528) [0x557502de1528]

[2]: ./exception5(+0x1548) [0x557502de1548]

[3]: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f40815c0b97]

[4]: ./exception5(+0xf2a) [0x557502de0f2a]
Segmentation fault (core dumped)

Cheers, Jonny

Attachment: exception5.cpp
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]