Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Sep 2011 12:57:19 -0500
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Unga <unga888@yahoo.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Segmentation fault, _malloc_prefork () - debugging help needed
Message-ID:  <20110919175719.GI9801@dan.emsphone.com>
In-Reply-To: <1316347805.62034.YahooMailClassic@web160112.mail.bf1.yahoo.com>
References:  <1316347805.62034.YahooMailClassic@web160112.mail.bf1.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Sep 18), Unga said:
> I'm developing an multi-threaded application on FreeBSD.
> 
> When it is running for sometime, it develops a Segmentation fault.
> 
> The ddd debugger shows following:
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 296c6580 (LWP 100137)]
> 0x28ee390e in _malloc_prefork () from /lib/libc.so.7
> 
> How could I know the exact line in source where this issue develops?

If you have a full /usr/src tree extracted, you can edit
/usr/src/lib/libc/Makefile and add

DEBUG_FLAGS=-g

at the top, then run "make obj && make depend && make && make install" to
install the new libc with debugging symbols.  Then your debugger will show
more info for functions inside libc.

If you don't have a source tree checked out yet, install the
devel/subversion-freebsd port, cd into /usr/src/ and run

svn co svn://svn.freebsd.org/base/stable/8 .

(or base/release/8.2.0, or base/stable/7 or base/head, depending on which
version you want; you can browse the branches at
http://svnweb.freebsd.org/base/ before you checkout anything)

-- 
	Dan Nelson
	dnelson@allantgroup.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110919175719.GI9801>