Guard Malloc crashes...
Guard Malloc crashes...
- Subject: Guard Malloc crashes...
- From: "Shawn Erickson" <email@hidden>
- Date: Wed, 19 Sep 2007 15:21:44 -0700
I am attempting to use Guard Malloc (enabled via Xcode menu option) to
trap a potential memory smasher. When I enabled Guard Malloc it drops
into the debugger because of a EXE_BAD_ACCESS signal but it happens
_well_ before the pathway I believe the memory issue exists under. In
fact I see this when the application is first starting up and the code
area I expect hasn't yet run and wont until I trigger an action in the
UI.
The following shows what I am seeing... note thread 16 is the thread
that gdb breaks into when the signal happens and thread 8 is another
thread down in GMmalloc at the same time.
Note every time I have attempted to use Guard Malloc I get a crash
like the following that shows at least two threads attempting to "new"
memory (sometimes I get 4+ threads down in GMMalloc). Also note I am
using an Intel system.
So my questions are...
1) Is the following a type of result one would expect to see when
using Guard Malloc? To me it looks like Guard Malloc itself is
crashing and not actually trapping any type of failure.
2) How robust is Guard Malloc in an application that makes heavy use
of threads? Assuming that Guard Malloc itself crashing and not it
stopping because of coding error on my part.
3) If Guard Malloc is trapping a failure any suggestions on what this
type of crash means and how to debug it? (assume it would be heap
corruption)
(will enable malloc history shortly and see how that goes)
(gdb) thread 8
[Switching to thread 8 (process 12196 thread 0x5903)]
0x90009cd7 in mach_msg_trap ()
(gdb) bt
#0 0x90009cd7 in mach_msg_trap ()
#1 0x90009c38 in mach_msg ()
#2 0x90023e85 in vm_protect ()
#3 0x9b40ae17 in GMmalloc ()
#4 0x90b4e5b3 in operator new ()
#5 0x90b4e6a5 in operator new[] ()
#6 0x0013f96e in ECInternalString::_allocate (this=0xb041fd88, minTCHARS=91)
#7 0x0013fd7a in ECInternalString::append (this=0xb041fd88,
src=0xc3855fdc "<<<< CryptoBsoc::CryptoBsoc(...)", srcNumTChars=32)
#8 0x00136ad4 in ECLog::makeLogString (level=0, ts=0xc384ffe8
"2007-09-19 13:32:45 PST", name=0xc3851ff4 "Blah",
threadName=0xc3853ff0 "InitConnection", msg=0xc3855fdc "<<<<
CryptoBsoc::CryptoBsoc(...)", logStr=@0xb041fd88)
#9 0x001dbdf7 in CLoggingPlugin::log (this=0xbe47e3fc, level=0,
timeStamp=0xc384ffe8 "2007-09-19 13:32:45 PST", moduleName=0xc3851ff4
"Blah", threadID=0xc3853ff0 "InitConnection", msg=0xc3855fdc "<<<<
CryptoBsoc::CryptoBsoc(...)")
#10 0x0052328b in CLogTask::run (this=0xc382beb8)
#11 0x0019a215 in ECWorkerThread::run (this=0xbebbe990)
#12 0x001432f7 in ECThread::ThreadProc_ (lParam=0xbebbe990)
#13 0x90024227 in _pthread_body ()
(gdb) thread 16
[Switching to thread 16 (process 12196 thread 0x7e03)]
0x9b40a836 in GMmalloc ()
(gdb) bt
#0 0x9b40a836 in GMmalloc ()
#1 0x90b4e5b3 in operator new ()
#2 0x90b4e6a5 in operator new[] ()
#3 0x00387ae8 in ssl_CreateGlobalContext () at JSocketScheduler.h:36
Previous frame inner to this frame (corrupt stack?)
(gdb)
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden