<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Aug 28, 2012, at 7:21 AM, Gary Byers wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>I've generally had trouble reproducing this, and I confess that I've generally<br>been a little skeptical about what's been reported. The basis of that skepticism<br>is roughly:<br><br> - CCL::CHOOSE-FILE-DIALOG in the Cocoa IDE is a fairly thin wrapper around the<br> Cocoa NSOpenPanel class: it allocates an NSOpenPanel object, initializes that<br> object according to options passed to CHOOSE-FILE-DIALOG, runs the NSOpenPanel<br> via some flavor of #/runModal, and returns a lispified version of the Cocoa-level<br> result.<br><br> NSOpenPanel isn't subclassed and none of its methods are overridden by lisp<br> code; AFAIK, CCL::CHOOSE-FILE-DIALOG hasn't changed much in a long time.<br><br> When I hear people claim that CHOOSE-FILE-DIALOG behaves differently with<br> 10.8 and certain versions of CCL than it has otherwise, I wonder how it would<br> do that if it wanted to. Even if the different behavior was<br> attributable to some kind of memory-corruption or memory-initialization bug,<br> those kinds of bugs tend not to lead to predictable, repeatable behavior<br> that affects multiple users/machines/minor OS versions.<br><br> The claim sounds like it's based on primitive superstition, but that does<br> leave open the question of what IS going on.<br></div></blockquote><div><br></div><div>The proof is in the pudding. It just does. The code below (not completely sure where this came from, I think this was posted sometime but got seriously hacked over time) interestingly does NOT exhibit this behavior (32/64). There probably should be in in-main-thread in there.</div><div><br></div><div><br></div><div>____________ file chooser not hanging on moutain lion ______________</div><div><br></div><div><div>(defun NATIVE-STRING (String) "</div><div> Return a native string"</div><div> (#/autorelease (ccl::%make-nsstring String)))</div><div><br></div></div><div><br></div><div><div>(defun ns-array-from-list (list)</div><div> "The list must be an array of ns-objects"</div><div> (let ((nsa (#/array ns:ns-array)))</div><div> (dolist (list-item list)</div><div> (setf nsa (#/arrayByAddingObject: nsa list-item)))</div><div> nsa))</div><div><br></div><div><br></div><div>(defun choose-file-dialog (&key </div><div> directory </div><div> ;mac-file-type</div><div> ;mac-file-creator</div><div> (button-string "Open") </div><div> cancel-button-string </div><div> (window-title "Choose a File") </div><div> (allow-multiple-files nil)</div><div> prompt </div><div> (window-position (ns:make-ns-point 100 100))</div><div> file-type-string-list </div><div> )</div><div> (let* ((panel (#/openPanel ns:ns-open-panel))</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> ;(dc (#/sharedUserDefaultsController ns:ns-user-defaults-controller))</div><div> ;(values (#/values dc))</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> ;(key #@"cclDirectory")</div><div> (file-types +null-ptr+)</div><div> )</div><div> ;; Kind of nasty code just to change the title of the cancel button, need to go through two layers of subviews to find the button and change its title. </div><div> (if cancel-button-string</div><div> (let ((subviews (gui::list-from-ns-array (#/subviews (#/contentView panel)))))</div><div> (dolist (subview subviews)</div><div> (if (equal (type-of subview) 'NS:NS-VIEW)</div><div> (let ((subviews2 (gui::list-from-ns-array (#/subviews subview))))</div><div> (dolist (subview2 subviews2)</div><div> (if (equal (type-of subview2) 'NS:NS-BUTTON )</div><div> (if (equal (#/title subview2) (native-string "Cancel"))</div><div> (#/setTitle: subview2 (native-string cancel-button-string))))))))))</div><div> (when file-type-string-list</div><div> (setf file-type-string-list (mapcar #'native-string file-type-string-list))</div><div> (setf file-types (ns-array-from-list file-type-string-list)))</div><div> (when button-string</div><div> (setf button-string (ccl::%make-nsstring button-string))</div><div> (#/setPrompt: panel button-string))</div><div> (when window-title</div><div> (setf window-title (ccl::%make-nsstring window-title))</div><div> (#/setTitle: panel window-title))</div><div> (when prompt</div><div> (setf prompt (ccl::%make-nsstring prompt))</div><div> (#/setMessage: panel prompt))</div><div> (#/setAllowsMultipleSelection: panel allow-multiple-files)</div><div> (#/setCanChooseDirectories: panel nil)</div><div> (#/setCanChooseFiles: panel t)</div><div> (#/setFrameOrigin: panel window-position)</div><div> ;#-cocotron (#/setAllowedFileTypes: panel (#/arrayWithObject: ns:ns-array (native-string "lisp")))</div><div> ;#-cocotron (#/makeKeyAndOrderFront: panel +null-ptr+)</div><div> #-cocotron (#/orderFront: panel +null-ptr+)</div><div> (when (eql (#/runModalForDirectory:file:types: panel</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> (native-string directory)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> +null-ptr+</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> file-types)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> #$NSOKButton)</div><div> (if allow-multiple-files</div><div> (let ((filenames (gui::list-from-ns-array (#/filenames Panel))))</div><div> (dotimes (i (length filenames))</div><div> (setf (elt filenames i) (pathname (ccl::lisp-string-from-nsstring (elt filenames i)))))</div><div> filenames)</div><div> (pathname (ccl::lisp-string-from-nsstring (#/objectAtIndex: (#/filenames Panel) 0)))))))</div><div><br></div></div><div>___________________</div><div><br></div><br><blockquote type="cite"><div><br><br> - there's a known bug in 64-bit CCL on OSX that can cause lisp thread creation<br> to go into a horrible CPU-burning/memory-thrashing state. I think that that<br> bug's been present for a long time (since PPC64 days), but it's apparently<br> much easier to trigger on 10.8 (and/or recent versions of CCL) than it has been.<br> The problem ultimately has to do with whether or not #_malloc (actually #_calloc)<br> returns a 64-bit pointer whose high 32 bits are 0 and there can be many factors<br> that affect that (many of them subtle), and the fix is to stop assuming that<br> it does and allocate such pointers ourselves.<br><br> That's been fixed (in the trunk for a few weeks and in the 1.8 tree<br> for a few days) in svn; the symptoms happen to be very similar to<br> what people have reported seeing with CHOOSE-FILE-DIALOG, but the<br> CHOOSE-FILE-DIALOG problems seem to occur for at least some people<br> in 32-bit CCL (which was never affected by this thread-creation<br> problem) and in freshly-updated 64-bit versions.<br></div></blockquote><div><br></div><div><br></div><div>AFAIK this did not fix any of the problems we have. And it does not explain the problem on 32 bit. </div><div><br></div><div>Alex</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Prof. Alexander Repenning</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><br class="khtml-block-placeholder"></p><p style="margin: 0.0px 0.0px 0.0px 0.0px">University of Colorado</p><p style="margin: 0.0px 0.0px 0.0px 0.0px">Computer Science Department</p><p style="margin: 0.0px 0.0px 0.0px 0.0px">Boulder, CO 80309-430</p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><br class="khtml-block-placeholder"></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">vCard: <a href="http://www.cs.colorado.edu/~ralex/AlexanderRepenning.vcf">http://www.cs.colorado.edu/~ralex/AlexanderRepenning.vcf</a></font></p><br class="Apple-interchange-newline"></span></span></span></span>
</div>
<br></body></html>