Skip to main content
Known Participant
February 3, 2006
Question

Intermittant dialog draw proc CRASH

  • February 3, 2006
  • 3 replies
  • 628 views
Hi,

I am developing Illustrator CS2 plugin for Mac using Xcode 1.5/OS 10.3.9. I have intermittant problem with display of certain dialog. I have overridden dialog's draw procedure with my own, which calls default draw and then adds some additional text and icon.

Usually it dislays fine.

Sometimes however, it starts to draw my text and then I get bad crash out of Illustrator. Some of crash log is below. Perhaps it is recursivly calling my display proc?

Tried debugging. I put breakpoint in my draw proc. First time it is hit, nothing shows up in Illustrator. After continue, dialog pops up and breakpoint is hit again (why?). Continue again, and back in Illustrator we can hit OK to dismiss dialog. Now breakpoint is hit a third time, after continue all is normal.

HELP please!

Chunky

Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_INVALID_ADDRESS (0x0001) at 0xbf7ffaf0

Thread 0:
0 com.apple.CoreGraphics 0x936ade74 aa_moveto + 0xc
1 com.apple.CoreGraphics 0x936928f8 CGPathApply + 0x224
2 libRIP.A.dylib 0x9073bac8 ripr_Path + 0x538
3 libRIP.A.dylib 0x907352dc ripc_GetClippingState + 0x5b8
4 libRIP.A.dylib 0x907377a8 ripc_GetRenderingState + 0x2c
5 libRIP.A.dylib 0x9073632c ripc_DrawGlyphs + 0x98
6 com.apple.CoreGraphics 0x936aa270 drawGlyphs + 0x94
7 com.apple.CoreGraphics 0x936ab4e0 CGContextShowGlyphsWithAdvances + 0xd0
8 com.apple.QD 0x951d6ccc RenderGlyphRecordArrayWithCG + 0x650
9 com.apple.QD 0x951d3500 ATSUDrawGlyphs(ATSGlyphVector*, unsigned long, unsigned long, FixedPoint*, CGContext*) + 0x58
10 com.apple.QD 0x951d347c TTextLineLayout::DrawText(unsigned long, unsigned long, long, long) + 0x298
11 com.apple.QD 0x951d31b8 ATSUDrawText + 0x98
12 com.apple.HIToolbox 0x9288fbac TATSUTextLayout::DrawBox(_HIThemeTextInfo*, CGRect const&, CGContext*) + 0x278
13 com.apple.HIToolbox 0x9288fce0 DataEngine::DrawThemeTextBox(__CFString const*, CGRect const*, _HIThemeTextInfo*, CGContext*) + 0xa4
14 com.apple.HIToolbox 0x92895278 HIThemeDrawTextBox + 0x100
15 com.apple.HIToolbox 0x928a91c0 _DrawThemeTextBox + 0x22c
16 com.adobe.coretech.adm 0x0ee2d160 dyld_stub_binding_helper + 0x77e30
17 com.adobe.coretech.adm 0x0edde400 dyld_stub_binding_helper + 0x290d0
18 com.mycompany.myplugin 0x12516b10 MyDlgDrawProc(_Opaque_ADMDialog*, _Opaque_ADMDrawer*) + 0xd0
19 com.adobe.coretech.adm 0x0edc915c dyld_stub_binding_helper + 0x13e2c
20 com.adobe.coretech.adm 0x0ee27ed8 dyld_stub_binding_helper + 0x72ba8
21 com.adobe.coretech.adm 0x0ee2a454 dyld_stub_binding_helper + 0x75124
22 com.adobe.coretech.adm 0x0ee2ae4c dyld_stub_binding_helper + 0x75b1c
23 com.adobe.coretech.adm 0x0ee2af7c dyld_stub_binding_helper + 0x75c4c
24 com.adobe.coretech.adm 0x0ee2fc08 dyld_stub_binding_helper + 0x7a8d8
25 com.adobe.coretech.adm 0x0edb9248 dyld_stub_binding_helper + 0x3f18
26 com.adobe.coretech.adm 0x0ee003c8 dyld_stub_binding_helper + 0x4b098
27 com.mycompany.myplugin 0x12516c50 MyDlgDrawProc(_Opaque_ADMDialog*, _Opaque_ADMDrawer*) + 0x210
28 com.adobe.coretech.adm 0x0edc915c dyld_stub_binding_helper + 0x13e2c
29 com.adobe.coretech.adm 0x0ee27ed8 dyld_stub_binding_helper + 0x72ba8
30 com.adobe.coretech.adm 0x0ee2a454 dyld_stub_binding_helper + 0x75124
31 com.adobe.coretech.adm 0x0ee2ae4c dyld_stub_binding_helper + 0x75b1c
32 com.adobe.coretech.adm 0x0ee2af7c dyld_stub_binding_helper + 0x75c4c
33 com.adobe.coretech.adm 0x0ee2fc08 dyld_stub_binding_helper + 0x7a8d8
34 com.adobe.coretech.adm 0x0edb9248 dyld_stub_binding_helper + 0x3f18
35 com.adobe.coretech.adm
This topic has been closed for replies.

3 replies

Known Participant
July 21, 2006
Incidentally, I think there are bugs in Illustrator's support of custom drawing. For example, I occasionally get an Illustrator crash if I resize one of my dialogs that has a custom draw proc. I have never had a crash when resizing dialogs without custom draw procs.

It could be that there is a problem with my draw proc and Chunky's draw proc as noted above. However, there are many other issues with custom drawing that make me think it has not been tested very well.
Known Participant
February 9, 2006
This is probably not the problem - but since text is involved, it would at least be worth triple checking that your string's memory isn't getting overwritten somehow.

Also, I've had a similar issue with debugging a draw proc that may explain your situtation. When I hit the break point, my IDE window gets the focus. When I resume, the dialog repaints itself causing the break point to get hit again, etc... ad nausem...
_Chunky_Author
Known Participant
February 3, 2006
Rest of crash log which got cut off:

36 com.mycompany.myplugin 0x12516c50 MyDlgDrawProc(_Opaque_ADMDialog*, _Opaque_ADMDrawer*) + 0x210
37 com.adobe.coretech.adm 0x0edc915c dyld_stub_binding_helper + 0x13e2c
38 com.adobe.coretech.adm 0x0ee27ed8 dyld_stub_binding_helper + 0x72ba8
.
.
(many lines deleted)
.
.
503 com.adobe.coretech.adm 0x0ee003c8 dyld_stub_binding_helper + 0x4b098
504 com.mycompany.myplugin 0x12516c50 MyDlgDrawProc(_Opaque_ADMDialog*, _Opaque_ADMDrawer*) + 0x210
505 com.adobe.coretech.adm 0x0edc915c dyld_stub_binding_helper + 0x13e2c
506 com.adobe.coretech.adm 0x0ee27ed8 dyld_stub_binding_helper + 0x72ba8
507 com.adobe.coretech.adm 0x0ee2a454 dyld_stub_binding_helper + 0x75124
508 com.adobe.coretech.adm 0x0ee2ae4c dyld_stub_binding_helper + 0x75b1c

Thread 1 Crashed:
0 ...ple.CoreServices.CarbonCore 0x947d668c _XHNDL_fullinfo_init + 0x14
1 ...ple.CoreServices.CarbonCore 0x947d6788 _XHNDL_exception_setup_dispatch + 0x30
2 ...ple.CoreServices.CarbonCore 0x947d6948 _XHNDL_server_handler + 0x108
3 ...ple.CoreServices.CarbonCore 0x947d5988 TS_exception_listener_thread + 0xbc
4 libSystem.B.dylib 0x92516990 _pthread_body + 0x28