Bug: Crash while editing new SVG file

A simple viewer/inspector for Scalable Vector Graphics files
Post Reply
Sfiera
Posts: 5
Joined: Sat Jun 09, 2007 8:05 pm
Contact:

Bug: Crash while editing new SVG file

Post by Sfiera » Sun Jun 10, 2007 2:58 pm

Just had a crash while trying to create a new SVG document. I pasted in the header (xml decl, doctype, svg open tag) from another SVG file and saw an error at the bottom to the effect of "unexpected EOF while parsing." I started to type the closing tag and got through "</", at which point svg Detective changed the error message to "EOF while parsing close tag for svg" and then crashed.

[Crashes aside, I would think it appropriate for svg Detective to provide a basic skeleton (xml decl, doctype, svg open and close tags) when a new document is created.]


I found the following in Console.log:

Code: Select all

2007-06-10 15:46:59.829 svg Detective[8753] parse failed
Parse error (1) Encountered unexpected EOF while parsing tag content on line 5, character 291
2007-06-10 15:47:00.703 svg Detective[8753] parse failed
Parse error (1) Encountered unexpected EOF while parsing tag content on line 5, character 292
2007-06-10 15:47:01.023 svg Detective[8753] parse failed
Parse error (1) Encountered unexpected EOF while parsing close tag for <svg> on line 5, character 293
2007-06-10 15:47:01.203 svg Detective[8753] parse failed
svg Detective(8753,0xa000ed88) malloc: *** vm_allocate(size=4129812480) failed (error code=3)
svg Detective(8753,0xa000ed88) malloc: *** error: can't allocate region
svg Detective(8753,0xa000ed88) malloc: *** set a breakpoint in szone_error to debug
Jun 10 15:47:11 hauteclaire crashdump[8755]: svg Detective crashed
Jun 10 15:47:13 hauteclaire crashdump[8755]: crash report written to: /Users/chpickel/Library/Logs/CrashReporter/svg Detective.crash.log
The CrashReporter report is as follows:

Code: Select all

**********

Host Name:      hauteclaire
Date/Time:      2007-06-10 15:47:02.001 -0400
OS Version:     10.4.9 (Build 8P135)
Report Version: 4

Command: svg Detective
Path:    /Applications/svg Detective.app/Contents/MacOS/svg Detective
Parent:  WindowServer [110]

Version: 1.0b1 (1.0b1)

PID:    8753
Thread: 0

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x00000006

Thread 0 Crashed:
0   com.apple.CoreFoundation   	0x907cad38 CFHash + 24
1   com.apple.CoreFoundation   	0x907d70b4 __CFSetFindBuckets2 + 148
2   com.apple.CoreFoundation   	0x907d6c24 CFSetAddValue + 220
3   com.apple.CoreFoundation   	0x90818674 _inputStreamScanXMLName + 872
4   com.apple.CoreFoundation   	0x9081a188 parseCloseTag + 92
5   com.apple.CoreFoundation   	0x90819474 parseTag + 528
6   com.apple.CoreFoundation   	0x90817d6c parseXML + 300
7   com.apple.CoreFoundation   	0x908176e8 CFXMLParserParse + 444
8   com.gandreas.svg.detective 	0x000060ec -[GandSVG(XML) parseXML:error:] + 1072
9   com.gandreas.svg.detective 	0x00003fac -[MyDocument setRawSVG:] + 232
10  com.apple.Foundation       	0x92c6c9fc _NSSetObjectValueAndNotify + 136
11  com.apple.Foundation       	0x92c6c728 -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 180
12  com.apple.AppKit           	0x939f5b1c -[NSBinder _setValue:forKeyPath:ofObject:mode:validateImmediately:raisesForNotApplicableKeys:error:] + 300
13  com.apple.AppKit           	0x939f59a4 -[NSBinder setValue:forBinding:error:] + 224
14  com.apple.AppKit           	0x93c694a8 -[NSValueBinder _applyObjectValue:forBinding:canRecoverFromErrors:handleErrors:typeOfAlert:discardEditingCallback:otherCallback:callbackContextInfo:didRunAlert:] + 204
15  com.apple.AppKit           	0x93c69904 -[NSValueBinder applyDisplayedValueHandleErrors:typeOfAlert:canRecoverFromErrors:discardEditingCallback:otherCallback:callbackContextInfo:didRunAlert:] + 496
16  com.apple.AppKit           	0x93c699a4 -[NSValueBinder _applyDisplayedValueIfHasUncommittedChangesWithHandleErrors:typeOfAlert:discardEditingCallback:otherCallback:callbackContextInfo:didRunAlert:] + 100
17  com.apple.AppKit           	0x93c6a3d8 -[NSValueBinder validateAndCommitValueInEditor:editingIsEnding:errorUserInterfaceHandled:] + 460
18  com.apple.AppKit           	0x93c56a88 -[_NSBindingAdaptor _validateAndCommitValueInEditor:editingIsEnding:errorUserInterfaceHandled:bindingAdaptor:] + 164
19  com.apple.AppKit           	0x93c56bd8 -[_NSBindingAdaptor validateAndCommitValueInEditor:editingIsEnding:errorUserInterfaceHandled:] + 288
20  com.apple.AppKit           	0x9388802c -[NSTextView(NSSharing) didChangeText] + 400
21  com.apple.AppKit           	0x93886454 -[NSTextView insertText:] + 1960
22  com.apple.AppKit           	0x93885b08 -[NSKeyBindingManager(NSKeyBindingManager_MultiClients) flushTextForClient:] + 212
23  com.apple.AppKit           	0x93883514 -[NSTSMInputContext interpretKeyEvents:] + 1188
24  com.apple.AppKit           	0x938828a0 -[NSView interpretKeyEvents:] + 64
25  com.apple.AppKit           	0x938826f4 -[NSTextView keyDown:] + 756
26  com.apple.AppKit           	0x937fdfa0 -[NSWindow sendEvent:] + 6424
27  com.apple.AppKit           	0x937a68d4 -[NSApplication sendEvent:] + 4172
28  com.apple.AppKit           	0x9379dd10 -[NSApplication run] + 508
29  com.apple.AppKit           	0x9388e87c NSApplicationMain + 452
30  com.gandreas.svg.detective 	0x00002a58 _start + 760
31  com.gandreas.svg.detective 	0x0000275c start + 48

Thread 1:
0   libSystem.B.dylib          	0x9002c4c8 semaphore_wait_signal_trap + 8
1   libSystem.B.dylib          	0x90030fac pthread_cond_wait + 480
2   com.apple.Foundation       	0x92bea30c -[NSConditionLock lockWhenCondition:] + 68
3   com.apple.AppKit           	0x9383e708 -[NSUIHeartBeat _heartBeatThread:] + 324
4   com.apple.Foundation       	0x92be31a0 forkThreadForFunction + 108
5   libSystem.B.dylib          	0x9002be08 _pthread_body + 96

Thread 0 crashed with PPC Thread State 64:
  srr0: 0x00000000907cad38 srr1: 0x000000000000d030                        vrsave: 0x0000000000000000
    cr: 0x22024228          xer: 0x0000000000000004   lr: 0x00000000907cad30  ctr: 0x00000000907cad20
    r0: 0x00000000907d70b4   r1: 0x00000000bfffdc90   r2: 0x0000000000000008   r3: 0x0000000000000000
    r4: 0x0000000000000000   r5: 0x0000000000000000   r6: 0x00000000bfffdd94   r7: 0x0000000000000003
    r8: 0x0000000000000000   r9: 0x0000000000000018  r10: 0x0000000000000005  r11: 0x0000000000000000
   r12: 0x00000000907cad20  r13: 0x0000000000000000  r14: 0x0000000000000100  r15: 0x0000000000000000
   r16: 0x0000000000000000  r17: 0x0000000000000001  r18: 0x0000000000021418  r19: 0x000000000002134c
   r20: 0x0000000009fcefb0  r21: 0x0000000000021430  r22: 0x00000000bfffdd90  r23: 0x000000000a5006a0
   r24: 0x000000000002186c  r25: 0x0000000000021420  r26: 0x0000000000000000  r27: 0x0000000009ba48d0
   r28: 0x00000000bfffdd94  r29: 0x00000000a07be500  r30: 0x0000000009df81f8  r31: 0x00000000907cad30

Binary Images Description:
    0x1000 -    0x1efff com.gandreas.svg.detective 1.0b1	/Applications/svg Detective.app/Contents/MacOS/svg Detective
  0x2f8000 -   0x2fafff net.culater.SIMBL 0.8 (8)	/Library/InputManagers/SIMBL/SIMBL.bundle/Contents/MacOS/SIMBL
  0x405000 -   0x40cfff com.unsanity.smartcrashreports Smart Crash Reports version 1.2 (1.2)	/Users/chpickel/Library/InputManagers/Smart Crash Reports/Smart Crash Reports.bundle/Contents/MacOS/Smart Crash Reports
0x8fe00000 - 0x8fe52fff dyld 46.12	/usr/lib/dyld
0x90000000 - 0x901bdfff libSystem.B.dylib 	/usr/lib/libSystem.B.dylib
0x90215000 - 0x9021afff libmathCommon.A.dylib 	/usr/lib/system/libmathCommon.A.dylib
0x9021c000 - 0x90269fff com.apple.CoreText 1.0.3 (???)	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreText.framework/Versions/A/CoreText
0x90294000 - 0x90345fff ATS 	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS
0x90374000 - 0x9072ffff com.apple.CoreGraphics 1.258.75 (???)	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics
0x907bc000 - 0x90895fff com.apple.CoreFoundation 6.4.7 (368.28)	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x908de000 - 0x908defff com.apple.CoreServices 10.4 (???)	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
0x908e0000 - 0x909e2fff libicucore.A.dylib 	/usr/lib/libicucore.A.dylib
0x90a3c000 - 0x90ac0fff libobjc.A.dylib 	/usr/lib/libobjc.A.dylib
0x90aea000 - 0x90b5afff com.apple.framework.IOKit 1.4 (???)	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
0x90b70000 - 0x90b82fff libauto.dylib 	/usr/lib/libauto.dylib
0x90b89000 - 0x90e60fff com.apple.CoreServices.CarbonCore 681.12	/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore
0x90ec6000 - 0x90f46fff com.apple.CoreServices.OSServices 4.1	/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices
0x90f90000 - 0x90fd1fff com.apple.CFNetwork 129.20	/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
0x90fe6000 - 0x90ffefff com.apple.WebServices 1.1.2 (1.1.0)	/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/WebServicesCore.framework/Versions/A/WebServicesCore
0x9100e000 - 0x9108ffff com.apple.SearchKit 1.0.5	/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit
0x910d5000 - 0x910fffff com.apple.Metadata 10.4.4 (121.36)	/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata
0x91110000 - 0x9111efff libz.1.dylib 	/usr/lib/libz.1.dylib
0x91121000 - 0x912dcfff com.apple.security 4.6 (29770)	/System/Library/Frameworks/Security.framework/Versions/A/Security
0x913db000 - 0x913e4fff com.apple.DiskArbitration 2.1	/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
0x913eb000 - 0x913f3fff libbsm.dylib 	/usr/lib/libbsm.dylib
0x913f7000 - 0x9141ffff com.apple.SystemConfiguration 1.8.3	/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
0x91432000 - 0x9143dfff libgcc_s.1.dylib 	/usr/lib/libgcc_s.1.dylib
0x91442000 - 0x914bdfff com.apple.audio.CoreAudio 3.0.4	/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
0x914fa000 - 0x914fafff com.apple.ApplicationServices 10.4 (???)	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
0x914fc000 - 0x91534fff com.apple.AE 1.5 (297)	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
0x9154f000 - 0x91621fff com.apple.ColorSync 4.4.9	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSync.framework/Versions/A/ColorSync
0x91674000 - 0x91705fff com.apple.print.framework.PrintCore 4.6 (177.13)	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore
0x9174c000 - 0x91803fff com.apple.QD 3.10.24 (???)	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD
0x91840000 - 0x9189efff com.apple.HIServices 1.5.3 (???)	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices
0x918cd000 - 0x918f1fff com.apple.LangAnalysis 1.6.1	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis
0x91905000 - 0x9192afff com.apple.FindByContent 1.5	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/FindByContent.framework/Versions/A/FindByContent
0x9193d000 - 0x9197ffff com.apple.LaunchServices 182	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices
0x9199b000 - 0x919affff com.apple.speech.synthesis.framework 3.3	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis
0x919bd000 - 0x91a03fff com.apple.ImageIO.framework 1.5.4	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
0x91a1a000 - 0x91ae1fff libcrypto.0.9.7.dylib 	/usr/lib/libcrypto.0.9.7.dylib
0x91b2f000 - 0x91b44fff libcups.2.dylib 	/usr/lib/libcups.2.dylib
0x91b49000 - 0x91b67fff libJPEG.dylib 	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib
0x91b6d000 - 0x91c24fff libJP2.dylib 	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib
0x91c73000 - 0x91c77fff libGIF.dylib 	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib
0x91c79000 - 0x91ce1fff libRaw.dylib 	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libRaw.dylib
0x91ce6000 - 0x91d23fff libTIFF.dylib 	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
0x91d2a000 - 0x91d43fff libPng.dylib 	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib
0x91d48000 - 0x91d4bfff libRadiance.dylib 	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib
0x91d4d000 - 0x91e2bfff libxml2.2.dylib 	/usr/lib/libxml2.2.dylib
0x91e4b000 - 0x91e4bfff com.apple.Accelerate 1.2.2 (Accelerate 1.2.2)	/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
0x91e4d000 - 0x91f32fff com.apple.vImage 2.4	/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage
0x91f3a000 - 0x91f59fff com.apple.Accelerate.vecLib 3.2.2 (vecLib 3.2.2)	/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib
0x91fc5000 - 0x92033fff libvMisc.dylib 	/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib
0x9203e000 - 0x920d3fff libvDSP.dylib 	/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib
0x920ed000 - 0x92675fff libBLAS.dylib 	/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
0x926a8000 - 0x929d3fff libLAPACK.dylib 	/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
0x92a03000 - 0x92af1fff libiconv.2.dylib 	/usr/lib/libiconv.2.dylib
0x92af4000 - 0x92b7cfff com.apple.DesktopServices 1.3.6	/System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv
0x92bbd000 - 0x92de8fff com.apple.Foundation 6.4.8 (567.29)	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
0x92f15000 - 0x92f33fff libGL.dylib 	/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
0x92f3e000 - 0x92f98fff libGLU.dylib 	/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib
0x92fe4000 - 0x92ff4fff com.apple.speech.recognition.framework 3.4	/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition
0x9324e000 - 0x9326bfff com.apple.audio.SoundManager 3.9	/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CarbonSound.framework/Versions/A/CarbonSound
0x93293000 - 0x935a1fff com.apple.HIToolbox 1.4.9 (???)	/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
0x936f1000 - 0x936fdfff com.apple.opengl 1.4.7	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
0x93797000 - 0x93797fff com.apple.Cocoa 6.4 (???)	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
0x93799000 - 0x93dccfff com.apple.AppKit 6.4.7 (824.41)	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
0x94159000 - 0x941cbfff com.apple.CoreData 91 (92.1)	/System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
0x94204000 - 0x942c8fff com.apple.audio.toolbox.AudioToolbox 1.4.5	/System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox
0x9431a000 - 0x9431afff com.apple.audio.units.AudioUnit 1.4	/System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit
0x9431c000 - 0x944dcfff com.apple.QuartzCore 1.4.12	/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
0x94526000 - 0x94563fff libsqlite3.0.dylib 	/usr/lib/libsqlite3.0.dylib
0x9456b000 - 0x945bbfff libGLImage.dylib 	/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib
0x945c4000 - 0x945defff com.apple.CoreVideo 1.4	/System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
0x945ee000 - 0x9460efff libmx.A.dylib 	/usr/lib/libmx.A.dylib
0x947ba000 - 0x947c9fff libCGATS.A.dylib 	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libCGATS.A.dylib
0x947d1000 - 0x947ddfff libCSync.A.dylib 	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libCSync.A.dylib
0x94823000 - 0x9483bfff libRIP.A.dylib 	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libRIP.A.dylib
0x94c3a000 - 0x94cabfff libstdc++.6.dylib 	/usr/lib/libstdc++.6.dylib

Sfiera
Posts: 5
Joined: Sat Jun 09, 2007 8:05 pm
Contact:

Post by Sfiera » Sun Jun 10, 2007 4:04 pm

Also, if I may add--perhaps it's not the best thing to bind the source window's content directly to the source. It would be better if the update was delayed for a second or so after editing stops. That would prevent lots of unnecessary (and often erroneous) parsing.

gandreas
Immortal
Posts: 1464
Joined: Wed Feb 04, 2004 6:02 pm
Contact:

Post by gandreas » Sun Jun 17, 2007 6:35 pm

There are some bugs with the NSXML support when it comes to malformed XML (leading to crashes). I'm working on coming up with a better work around (yet still supports back to 10.3.9), but certainly adding a delay between editing and "re-rendering" would help to work around some of them.

Sfiera
Posts: 5
Joined: Sat Jun 09, 2007 8:05 pm
Contact:

Post by Sfiera » Mon Jun 18, 2007 10:07 pm

I am not confident on this, but I believe libxml2 has been present on the system since at least 10.3.9. AppKit is linked to libxml2 on 10.4, so it's probably what NSXML is built against. I've never had trouble with software built against libxml2 (e.g. `xsltproc`) crashing, so it's probably a problem with Apple's code rather than the underlying XML parser.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest