Re: [dev] [surf] Segfault bug

From: Kris Maglione <maglione.k_AT_gmail.com>
Date: Thu, 10 Jun 2010 02:02:10 -0400

On Wed, Jun 09, 2010 at 10:17:28PM -0700, Gene Auyeung wrote:
>On Wed, Jun 9, 2010 at 10:01 PM, Kris Maglione <maglione.k_AT_gmail.com> wrote:
>> On Wed, Jun 09, 2010 at 12:50:06PM -0700, Gene Auyeung wrote:
>>>
>>> Hi,
>>>
>>> For a while I've been frustrated when I close a surf window, it takes
>>> down the process that created it, along with all windows of that
>>> process.  For clicking a link in gmail will open a new window, and
>>> closing that window sometimes closes the parent window as well.  Today
>>> I had some time to insert printfs into surf.c to find out what's going
>>> on.
>>
>> Why don't you just use gdb (apart from the fact that surf doesn't build with
>> debugging information by default)?
>>
>Apart from not knowing how to use gdb beyond the basics, surf's code
>is clean/simple enough that printing debug statements work. But yes,
>good suggestion.

That's really not the point. gdb would have told you where the
program crashed and why in about two seconds in this kind of
scenario (assuming you had debugging information, which you
hadn't), whereas debug statements would have taken minutes on
the low end. Plus, the backtrace probably would have told one of
us what was wrong without any further back and forth.

Anyway, it's simple. Add -g to your CFLAGS and LDFLAGS. When you
get a core, run:

%gdb $(which surf) surf.core
...
(gdb) bt full

Then you know where, when, and likely why the program crashed.
And, if you don't, post it here and someone will tell you.

It might also be profitable to brow beat someone into adding
debug flags to the default build flags in hg, along the way...

-- 
Kris Maglione
Only the educated are free.
	--Epictetus
Received on Thu Jun 10 2010 - 06:02:10 UTC

This archive was generated by hypermail 2.2.0 : Thu Jun 10 2010 - 06:12:02 UTC