Man is this one killing me. vector is crashing deep deep inside the STL.
I have determined that the vector code that crashes (a push_back) only
crashes if I have declared a completely different unrelated vector in a
completely different part of the program. Just a declaration is enough to
trigger this bug, the unrelated vector is not used in any way at all. If
I comment out the unrelated declaratoin, the bug doesn't occur. This is
truly absurd. The path to vector.h is inside the CW 9.5 MSL directory, so
it isn't using vector from anywhere else.
I tried creating a completely new project from scratch, even a different
kind of project (The original was a nib bundle, the new project was not a
bundle at all). Both projects exhibit the exact same error.
I am including the thread states from the crash log below. Is this at all
revealing as to what the problem is? What is an EXC_BAD_ACCESS or a
KERN_PROTECTION_FAILURE? I'm quite out of ideas. I have tried commenting
out the program down to a bare skeleton. I got the program to the point
where it does practically nothing besides install Carbon event handlers
and test this one piece of vector code, but it's still dead in the water.
Any ideas? Here's the beginning of the crash log:
Thanks.
----------------------------------------------------------
Command: Spruce
Path:
/Users/keithwiley/Programming/Spruce/Spruce.app/Contents/MacOSClassic/Spruce
Version: Spruce version 1.0 (1.0)
PID: 186
Thread: 0
Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x00000000
Thread 0 Crashed:
0 Spruce 0x000cd9ac Block_subBlock + 0x5c
1 Spruce 0x000ce2cc
soft_allocate_from_var_pools + 0x6c
2 Spruce 0x000ce65c
allocate_from_fixed_pools + 0xb8
3 Spruce 0x000cea28 _pool_allocate + 0x68
4 Spruce 0x000ceac4 _allocate + 0x38
5 Spruce 0x000cec00 malloc + 0x1c
6 Spruce 0x000cd2b8 _nw__FUl + 0x3c
7 Spruce 0x000b6f44
allocate__Q23std13allocator<Ul>FUlPCv + 0x1c
8 Spruce 0x000b6b88
append_realloc__Q23std39__vec_deleter<Ul,Q23std13allocator<Ul>>FUlRCUlQ210Metrowerks11int2type<3>
+ 0x44
9 Spruce 0x000b6a70
append_realloc__Q23std39__vec_deleter<Ul,Q23std13allocator<Ul>>FUlRCUl +
0x34
10 Spruce 0x000b69b0
push_back__Q23std39__vec_deleter<Ul,Q23std13allocator<Ul>>FRCUlQ210Metrowerks11int2type<1>
+ 0x68
11 Spruce 0x000b6670
push_back__Q23std39__vec_deleter<Ul,Q23std13allocator<Ul>>FRCUl + 0x2c
12 Spruce 0x000b65c4
push_back__Q23std61__vec_constructor<PP7Picture,Q23std21allocator<PP7Picture>,1>FRCPP7Picture
+ 0x20
13 Spruce 0x000b6530
push_back__Q23std48vector<PP7Picture,Q23std21allocator<PP7Picture>>FRCPP7Picture
+ 0x20
14 Spruce 0x000b6428
GetMultipleImageFilesWithPreview__FPvRQ23std48vector<PP7Picture,Q23std21allocator<PP7Picture>>i
+ 0x21c
15 Spruce 0x000b3a88
OpenFromFile__10MainWindowFv + 0x34
16 Spruce 0x000b5728 MenuHandler + 0x174
17 com.apple.HIToolbox 0x92881fa0 DispatchEventToHandlers
+ 0x150
18 com.apple.HIToolbox 0x92882214
SendEventToEventTargetInternal + 0x174
19 com.apple.HIToolbox 0x928946bc SendEventToEventTarget
+ 0x28
20 com.apple.HIToolbox 0x928a96b4
SendHICommandEvent(unsigned long, HICommand const*, unsigned long,
unsigned long, unsigned char, OpaqueEventTargetRef*,
OpaqueEventTargetRef*, OpaqueEventRef**) + 0x170
21 com.apple.HIToolbox 0x92941874
SendMenuItemSelectedEvent + 0x88
22 com.apple.HIToolbox 0x929283ac
HandleKeyboardEvent(OpaqueEventRef*, unsigned char) + 0x148
23 com.apple.HIToolbox 0x92881fa0 DispatchEventToHandlers
+ 0x150
24 com.apple.HIToolbox 0x92882214
SendEventToEventTargetInternal + 0x174
25 com.apple.HIToolbox 0x92886694
SendEventToEventTargetWithOptions + 0x28
26 com.apple.HIToolbox 0x928bb034
HandleKeyboardEvent(OpaqueEventRef*, unsigned long) + 0x140
27 com.apple.HIToolbox 0x92892c6c
ToolboxEventDispatcherHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*,
void*) + 0x1f8
28 com.apple.HIToolbox 0x9288205c DispatchEventToHandlers
+ 0x20c
29 com.apple.HIToolbox 0x92882214
SendEventToEventTargetInternal + 0x174
30 com.apple.HIToolbox 0x928946bc SendEventToEventTarget
+ 0x28
31 com.apple.HIToolbox 0x928985d8 ToolboxEventDispatcher
+ 0x5c
32 com.apple.HIToolbox 0x928b57e4 HLTBEventDispatcher +
0x10
33 com.apple.HIToolbox 0x928ab680 RunApplicationEventLoop
+ 0x98
34 Spruce 0x000b497c main + 0xc8
Thread 1:
0 libSystem.B.dylib 0x90018e18
semaphore_timedwait_signal_trap + 0x8
1 libSystem.B.dylib 0x9000e9d4 _pthread_cond_wait +
0x268
2 ...ple.CoreServices.CarbonCore 0x902da570 TSWaitOnSemaphoreCommon
+ 0xb0
3 ...ickTimeComponents.component 0x99012920
ReadSchedulerThreadEntryPoint + 0x1b4
4 libSystem.B.dylib 0x90024910 _pthread_body + 0x28
Thread 2:
0 libSystem.B.dylib 0x90018e18
semaphore_timedwait_signal_trap + 0x8
1 libSystem.B.dylib 0x9000e9d4 _pthread_cond_wait +
0x268
2 ...ple.CoreServices.CarbonCore 0x902da570 TSWaitOnSemaphoreCommon
+ 0xb0
3 ...ple.CoreServices.CarbonCore 0x902da3f4 AsyncFileThread(void*)
+ 0x38
4 libSystem.B.dylib 0x90024910 _pthread_body + 0x28
PPC Thread State:
srr0: 0x000cd9ac srr1: 0x0200d030 vrsave: 0x00000000
cr: 0x82022224 xer: 0x00000000 lr: 0x000ce2cc ctr: 0x90001a44
r0: 0x00000000 r1: 0xbfffe340 r2: 0x000e0000 r3: 0x000f6000
r4: 0x00000830 r5: 0x00000000 r6: 0x00ffe762 r7: 0x00000001
r8: 0x00000008 r9: 0x00000000 r10: 0x00000087 r11: 0xa02b1268
r12: 0x90001a44 r13: 0x00000000 r14: 0x00000000 r15: 0x00000000
r16: 0x00000000 r17: 0x00000000 r18: 0x00000000 r19: 0x00000000
r20: 0x00000002 r21: 0x00000100 r22: 0x000e5838 r23: 0x003242a0
r24: 0xbffff410 r25: 0x00000830 r26: 0x000f2cf8 r27: 0x00000000
r28: 0x00000000 r29: 0x00000000 r30: 0x000e6000 r31: 0x00000000
________________________________________________________________________
Keith Wiley kwiley@cs.unm.edu http://www.unm.edu/~keithw
"Yet mark his perfect self-contentment, and hence learn his lesson,
that to be self-contented is to be vile and ignorant, and that to
aspire is better than to be blindly and impotently happy."
-- Edwin A. Abbott, Flatland
________________________________________________________________________
Keith Wiley - 27 May 2005 19:33 GMT
It never fails. I slave over a mystery-of-the-universe scale bug for a
day and a half, finally post a question to a newsgroup, and inevitably
find the bug two minutes after sending the post off.
I don't mean to cry wolf. Plenty of problems are truly astounding and I
always appreciate your help, but in this case, don't waste your time.
Sheesh!
Thanks.
________________________________________________________________________
Keith Wiley kwiley@cs.unm.edu http://www.unm.edu/~keithw
"Yet mark his perfect self-contentment, and hence learn his lesson,
that to be self-contented is to be vile and ignorant, and that to
aspire is better than to be blindly and impotently happy."
-- Edwin A. Abbott, Flatland
________________________________________________________________________