This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: tracing malloc/free call
- From: Marco Atzeri <marco dot atzeri at gmail dot com>
- To: Alexander dot Kleinsorge at gmx dot de, "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Thu, 15 Jan 2015 21:17:48 +0100
- Subject: Re: tracing malloc/free call
- Authentication-results: sourceware.org; auth=none
- References: <trinity-2b354d37-64f8-425c-b700-f3d872c5d0fb-1421351998667 at 3capp-gmx-bs27>
On 1/15/2015 8:59 PM, Alexander.Kleinsorge@gmx.de wrote:
Hi Marco,
freeing an address that is not alligned to typically 4 or 8 bytes is
never possible,
because malloc would never return such.
Your pointer ends with 0x..1 so it cannot be alligned on any architecture.
regards,
Alexander
I know. The application is crashing.
It is clearly a free call with a corrupted pointer,
but not knowing the caller address make difficult to
identify what is corrupting the pointer.
Your Post:
Debugging a program I am trying to catch where this call is happening
17 1499678 [main] ncview 1484 free: (0x6000D7961), called by 0x180115A0B
unfortunately the 0x180115A0B address is not real caller address
/usr/src/debug/cygwin-1.7.33-1/winsup/cygwin/malloc_wrapper.cc
extern "C" void
free (void *p)
{
malloc_printf ("(%p), called by %p", p, __builtin_return_address (0));
if (!use_internal)
user_data->free (p);
else
{
__malloc_lock ();
dlfree (p);
__malloc_unlock ();
}
}
Any way to improve the tracing ?
$ uname -svr
CYGWIN_NT-6.1 1.7.33-2(0.280/5/3) 2014-11-13 15:47
Regards
Marco
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple