[Openmcl-devel] PDFKit crashes

Ron Garret ron at awun.net
Wed May 27 23:19:19 UTC 2009


Trying to open and display a PDF file crashes CCL in various ways.

Using this code:

(in-package "CL-USER")

(require :cocoa)
(objc:load-framework "Quartz" :quartz)
(defun nsstr (s) (make-instance 'gui::ns-lisp-string :string s))

(defun pdf-from-file (filename)
  (#/initWithData: (#/alloc ns:pdf-document)
                   (#/dataWithContentsOfFile: ns:ns-data filename)))

(defun pdf-from-url (url)
  (#/initWithUrl: (#/alloc ns:pdf-document)
                  (#/URLWithString: ns:ns-url url)))

#|

(setf p1 (pdf-from-file #@"/Users/ron/Desktop/test.pdf"))
(setf p2 (pdf-from-url #@"http://www.flownet.com/ron/test.pdf"))
(setf v (#/alloc ns:pdf-view))
(#/setDocument: v sce)

|#

I can open the PDF as a file, but not as a URL.  When I try, I get a  
hard crash:

Unhandled exception 10 at 0xc49847a, context->regs at #xb0525e50
Exception occurred while executing foreign code
at .objc_category_name_NSColor_PDFColorUtilities + 99450
? for help
[24137] Clozure CL kernel debugger: b
current thread: tcr = 0xa7eeba0, native thread ID = 0x1a703,  
interrupts enabled


(#x000000000BF9AC38) #x0000300040F6D204 : #<Anonymous Function  
#x0000300040F6D12F> + 213
(#x000000000BF9AC58) #x0000300040F602D4 : #<Function (:INTERNAL SEND- 
UNAMBIGUOUS-MESSAGE (SHARED-INITIALIZE :AFTER (OBJC-DISPATCH-FUNCTION  
T))) #x0000300040F600DF> + 501
(#x000000000BF9AC98) #x00003000412CC5E4 : #<Function NSOBJECT- 
DESCRIPTION #x00003000412CC53F> + 165
(#x000000000BF9ACF0) #x0000300040EAE96C : #<Function (:INTERNAL (PRINT- 
OBJECT (OBJC-OBJECT T))) #x0000300040EAE8FF> + 109
(#x000000000BF9AD30) #x00003000404D18F4 : #<Function %PRINT-UNREADABLE- 
OBJECT #x00003000404D17CF> + 293
(#x000000000BF9AD78) #x0000300040EAE764 : #<Method-Function PRINT- 
OBJECT (OBJC-OBJECT T) #x0000300040EAE64F> + 277
(#x000000000BF9ADA8) #x00003000401A305C : #<Function %CALL-NEXT-METHOD  
#x00003000401A2C2F> + 1069
(#x000000000BF9AE28) #x00003000401A5A64 : #<Function %%STANDARD- 
COMBINED-METHOD-DCODE #x00003000401A575F> + 773
(#x000000000BF9AEA0) #x00003000404D405C : #<Function WRITE-A-FROB  
#x00003000404D3FAF> + 173
(#x000000000BF9AF20) #x00003000404D579C : #<Function WRITE-INTERNAL  
#x00003000404D544F> + 845
(#x000000000BF9AF80) #x00003000404EEABC : #<Function WRITE-A-CONS  
#x00003000404EE98F> + 301
(#x000000000BF9AFD8) #x00003000404D2E54 : #<Method-Function PRINT- 
OBJECT (T T) #x00003000404D2D9F> + 181
(#x000000000BF9B010) #x00003000401A305C : #<Function %CALL-NEXT-METHOD  
#x00003000401A2C2F> + 1069
(#x000000000BF9B090) #x00003000401A5A64 : #<Function %%STANDARD- 
COMBINED-METHOD-DCODE #x00003000401A575F> + 773
(#x000000000BF9B108) #x00003000404D405C : #<Function WRITE-A-FROB  
#x00003000404D3FAF> + 173
(#x000000000BF9B188) #x00003000404D579C : #<Function WRITE-INTERNAL  
#x00003000404D544F> + 845
(#x000000000BF9B1E8) #x00003000404E1A1C : #<Function WRITE-1  
#x00003000404E17FF> + 541
(#x000000000BF9B218) #x00003000404DED34 : #<Function PRIN1  
#x00003000404DECAF> + 133
(#x000000000BF9B258) #x0000300040A81E3C : #<Function FORMAT-PRIN1  
#x0000300040A81D7F> + 189
(#x000000000BF9B2A8) #x00003000405A629C : #<Function SUB-FORMAT  
#x00003000405A593F> + 2397
(#x000000000BF9B350) #x0000300040A931FC : #<Function DO-SUB-FORMAT  
#x0000300040A9315F> + 157
(#x000000000BF9B370) #x0000300040D3EE7C : #<Function DO-SUB-FORMAT-1  
#x0000300040D3ED9F> + 221
(#x000000000BF9B3F0) #x0000300040D1C4FC : #<Function DO-XP-PRINTING  
#x0000300040D1C39F> + 349
(#x000000000BF9B478) #x0000300040D1CCC4 : #<Function (:INTERNAL DO-IT  
XP-PRINT) #x0000300040D1CC8F> + 53
(#x000000000BF9B4A0) #x0000300040D1D37C : #<Function MAYBE-INITIATE-XP- 
PRINTING #x0000300040D1D13F> + 573
(#x000000000BF9B520) #x0000300040A943FC : #<Function FORMAT  
#x0000300040A93D5F> + 1693
(#x000000000BF9B5C8) #x0000300040541C3C : #<Function %BREAK-MESSAGE  
#x000030004054190F> + 813
(#x000000000BF9B780) #x0000300040543554 : #<Function BREAK-LOOP-HANDLE- 
ERROR #x000030004054334F> + 517
(#x000000000BF9B7D8) #x00003000405E3DC4 : #<Function %ERROR  
#x00003000405E3C5F> + 357
(#x000000000BF9B800) #x0000300040591FDC : #<Function DEFAULT-UNDEFINED- 
FUNCTION-CALL-RESTARTS #x00003000405917FF> + 2013
(#x000000000BF9B8B8) #x00003000405E8D54 : #<Function HANDLE-UDF-CALL  
#x00003000405E8C8F> + 197
(#x000000000BF9B8E8) #x00003000405E793C : #<Function (:INTERNAL %XERR- 
DISP) #x00003000405E6FAF> + 2445
(#x000000000BF9B938) #x000030004053F374 : #<Function FUNCALL-WITH- 
ERROR-REENTRY-DETECTION #x000030004053F2BF> + 181
(#x000000000BF9B978) #x00003000405E87DC : #<Function %XERR-DISP  
#x00003000405E85EF> + 493
(#x000000000BF9B9B0) #x000030004013D92C : #<Function %PASCAL-FUNCTIONS 
% #x000030004013D79F> + 397
(#x000000000BF9BA18) #x0000000000000000 : #<Function PDF-FROM-URL  
#x000030004518EC0F> + ??
(#x000000000BF9BA78) #x0000300040529CD4 : #<Function CALL-CHECK-REGS  
#x0000300040529BEF> + 229
(#x000000000BF9BAB0) #x000030004052BF64 : #<Function CHEAP-EVAL-IN- 
ENVIRONMENT #x000030004052B81F> + 1861
(#x000000000BF9BB10) #x000030004054589C : #<Function TOPLEVEL-EVAL  
#x00003000405455BF> + 733
(#x000000000BF9BBB0) #x0000300040547D34 : #<Function READ-LOOP  
#x000030004054752F> + 2053
(#x000000000BF9BDF0) #x000030004052973C : #<Function TOPLEVEL-LOOP  
#x00003000405296CF> + 109
(#x000000000BF9BE20) #x00003000405EC094 : #<Function (:INTERNAL MAKE- 
MCL-LISTENER-PROCESS) #x00003000405EBE0F> + 645
(#x000000000BF9BEB8) #x00003000404C4C3C : #<Function RUN-PROCESS- 
INITIAL-FORM #x00003000404C496F> + 717
(#x000000000BF9BF48) #x00003000404C5844 : #<Function (:INTERNAL  
(%PROCESS-PRESET-INTERNAL (PROCESS))) #x00003000404C56BF> + 389
(#x000000000BF9BF98) #x00003000404A777C : #<Function (:INTERNAL THREAD- 
MAKE-STARTUP-FUNCTION) #x00003000404A764F> + 301
[24137] Clozure CL kernel debugger:


Similar problem when I try to stick the PDF from the file into a PDF- 
view:

Unhandled exception 10 at 0xc483919, context->regs at #xb0526970
Exception occurred while executing foreign code
at .objc_category_name_NSColor_PDFColorUtilities + 14617
? for help
[24131] Clozure CL kernel debugger: b
current thread: tcr = 0xa7eead0, native thread ID = 0x1a703,  
interrupts enabled


(#x000000000BF9BA70) #x00003000412CBE2C : #<Anonymous Function  
#x00003000412CBC7F> + 429
(#x000000000BF9BA98) #x0000300040F602D4 : #<Function (:INTERNAL SEND- 
UNAMBIGUOUS-MESSAGE (SHARED-INITIALIZE :AFTER (OBJC-DISPATCH-FUNCTION  
T))) #x0000300040F600DF> + 501
(#x000000000BF9BAD8) #x0000300040529CD4 : #<Function CALL-CHECK-REGS  
#x0000300040529BEF> + 229
(#x000000000BF9BB10) #x000030004054589C : #<Function TOPLEVEL-EVAL  
#x00003000405455BF> + 733
(#x000000000BF9BBB0) #x0000300040547D34 : #<Function READ-LOOP  
#x000030004054752F> + 2053
(#x000000000BF9BDF0) #x000030004052973C : #<Function TOPLEVEL-LOOP  
#x00003000405296CF> + 109
(#x000000000BF9BE20) #x00003000405EC094 : #<Function (:INTERNAL MAKE- 
MCL-LISTENER-PROCESS) #x00003000405EBE0F> + 645
(#x000000000BF9BEB8) #x00003000404C4C3C : #<Function RUN-PROCESS- 
INITIAL-FORM #x00003000404C496F> + 717
(#x000000000BF9BF48) #x00003000404C5844 : #<Function (:INTERNAL  
(%PROCESS-PRESET-INTERNAL (PROCESS))) #x00003000404C56BF> + 389
(#x000000000BF9BF98) #x00003000404A777C : #<Function (:INTERNAL THREAD- 
MAKE-STARTUP-FUNCTION) #x00003000404A764F> + 301
[24131] Clozure CL kernel debugger:


This seems to be a problem with the ObjC object-printing code, and not  
PDFKit per se.  But I thought I'd ask if this was a known problem, or  
if I'm doing something obviously stupid, before filing a ticket.

This is running on a clean build of the trunk as of about 3PM PDT.

Thanks,
rg




More information about the Openmcl-devel mailing list