bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #18494] NSRunAlertPanel crash problems (threads?)


From: Richard Frith-Macdonald
Subject: [bug #18494] NSRunAlertPanel crash problems (threads?)
Date: Sun, 01 Apr 2007 09:31:40 +0000
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko) Safari/419.3

Update of bug #18494 (project gnustep):

                  Status:                    None => Confirmed              

    _______________________________________________________

Follow-up Comment #1:

I reproduced this problem ...

#0  0x00002b216024d605 in DPSgsave (ctxt=0x0)
    at ../Headers/AppKit/DPSOperators.h:715
#1  0x00002b216024d1f3 in -[NSWindow _initBackendWindow] (self=0x9ef690, 
    _cmd=0x2b2160533a30) at NSWindow.m:780
#2  0x00002b216024ffa3 in -[NSWindow orderWindow:relativeTo:] (self=0x9ef690,

    _cmd=0x2b2160533cf0, place=NSWindowAbove, otherWin=-1) at
NSWindow.m:1576
#3  0x00002b216024fd2a in -[NSWindow orderFrontRegardless] (self=0x9ef690, 
    _cmd=0x2b216045c240) at NSWindow.m:1508
#4  0x00002b21600cd037 in -[NSApplication beginModalSessionForWindow:] (
    self=0x69fa60, _cmd=0x2b216045c970, theWindow=0x9ef690)
    at NSApplication.m:1461
#5  0x00002b21600cd40b in -[NSApplication runModalForWindow:] (self=0x69fa60,

    _cmd=0x2b2160455490, theWindow=0x9ef690) at NSApplication.m:1535
#6  0x00002b21600c210c in -[GSAlertPanel runModal] (self=0x9ef690, 
    _cmd=0x2b21604555a0) at NSAlert.m:725
#7  0x00002b21600c330d in NSRunAlertPanel (title=0x50fbe0, msg=0x964c90, 
    defaultButton=0x50fb60, alternateButton=0x0, otherButton=0x0)
    at NSAlert.m:983
#8  0x0000000000405898 in -[AppController showAlertDialog:] (self=0x88bde0, 
    _cmd=0x5136c0, message=0x964c90) at AppController.m:621
#9  0x00000000004074af in -[ftpclient storeFile:from:beingAt:]
(self=0x9f9410, 
    _cmd=0x510fc0, file=0x9dcd80, localClient=0x9ca500, depth=0)
    at ftpclient.m:491
#10 0x00000000004033bf in -[AppController performStoreFile:] (self=0x88bde0,

    _cmd=0x510f20, parameters=0x0) at AppController.m:308
#11 0x00002b216078a654 in -[NSObject performSelector:withObject:] (
    self=0x88bde0, _cmd=0x2b2160b19000, aSelector=0x510f20, anObject=0x0)
    at NSObject.m:1947
#12 0x00002b21607ed08e in -[NSThread _sendThreadMethod] (self=0x8fe760, 
    _cmd=0x2b2160b18fc0) at NSThread.m:780
#13 0x00002b2160c878d7 in ?? () from /usr/lib/libobjc.so.1
#14 0x00002b2160b65f1a in start_thread () from /lib/libpthread.so.0
#15 0x00002b21610ea602 in clone () from /lib/libc.so.6
#16 0x0000000000000000 in ?? ()


The issue is plainly that the call to NSRunAlertPanel() is not from the main
thread and is running up against the fact that gui is not thread-safe so and
there is no graphics context available in other threads.

The problem is, I don't know what policy is on how to solve this ... should
we aim to make NSRunAlertpanel() and similar functions work from any thread?
I don't think we can hope to make gui thread-safe (even if that term was well
defined, which it isn't) in any reasonable timeframe, but we could relatively
easily solve the immediate issue by making these functions use the
-performSelectorOnMainThread:withObject:waitUntilDone:modes: method to ensure
that the actual management of the alert panel is done in the main thread.

Thoughts/comments from core developers solicited ... if nobody tells me about
a better solution, I'll probably just modify the alert functions to work in
the main thread when I have time.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?18494>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]