gnustep-dev
[Top][All Lists]
Advanced

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

Deadlock on performSelectorOnMainThread:


From: Jonathan Gillaspie
Subject: Deadlock on performSelectorOnMainThread:
Date: Thu, 26 Aug 2010 00:43:48 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6


We are running into an occasional problem with our application on GNUstep (Ubuntu 9.04) where we deadlock when attempting to call performSelectorOnMainThread: The back trace with the locked threads is included below. The only condition that I can see for this situation is that somehow the outputFD of the pipe that is used to "trigger" the main run loop to pick-up is blocked and can't be written to (GSRunLoopThreadInfo of NSThread.m). I do notice that although NBLK_OPT is set for the inputFD, it isn't set for outputFD which seems to be where the deadlock is occurring.

First, does anyone have an alternate (or clearer vision) of why this deadlock condition is occuring? Second, does anyone have a preferred solution other than to allow the outputFD to not-block?

Thanks for any help with this issue,
Jonathan Gillaspie
address@hidden


(gdb) thread apply all bt

Thread 4 (Thread 0xf6938b90 (LWP 30722)):
#0  0xf7f40430 in __kernel_vsyscall ()
#1  0xf73ed4fb in write () from /lib32/libpthread.so.0
#2 0xf7a17ca3 in -[GSRunLoopThreadInfo addPerformer:] (self=0x8cf81c0, _cmd=0xf7b2cc90,
    performer=0xf60085e8) at NSThread.m:922
#3 0xf7a18bb0 in -[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:modes:] (self=0x9461ff0, _cmd=0xf7b2cc60, aSelector=0x81cdba8, aThread=0x8b762e8, anObject=0x0,
    aFlag=0 '\000', anArray=0x8d09330) at NSThread.m:1254
#4 0xf7a16813 in -[NSObject(NSThreadPerformAdditions) performSelectorOnMainThread:withObject:waitUntilDone:modes:] (self=0x9461ff0, _cmd=0xf7b2cc68, aSelector=0x81cdba8, anObject=0x0,
    aFlag=<value optimized out>, anArray=0x8d09330) at NSThread.m:1176
#5 0xf7a18642 in -[NSObject(NSThreadPerformAdditions) performSelectorOnMainThread:withObject:waitUntilDone:] (self=0x9461ff0, _cmd=0x81cdbb0, aSelector=0x81cdba8, anObject=0x0, aFlag=<value optimized out>)
    at NSThread.m:1187
#6 0x080d5056 in -[VNCView primaryThreadNeedsDisplayInRect:] (self=0x9461ff0, _cmd=0x81f2ad8, aRect= {origin = {x = 160, y = 320}, size = {width = 32, height = 16}}) at VNCView.m:789 #7 0x0814d6dd in -[VNCConnection(VNCEncodings) readFrameBufferUpdate] (self=0x95e2130, _cmd=0x81ca670)
    at VNCConnectionEncodings.m:1132
#8 0x080c3cbf in -[VNCConnection processIncomingMessage] (self=0x95e2130, _cmd=0x81ca658)
    at VNCConnection.m:3263
#9 0x080ce421 in -[VNCConnection checkForIncomingMessage] (self=0x95e2130, _cmd=0x81ca310)
    at VNCConnection.m:3233
#10 0x080c42ad in -[VNCConnection runVNCLoop] (self=0x95e2130, _cmd=0x81ca1c0) at VNCConnection.m:1364 #11 0x080c6234 in -[VNCConnection startVNCThreadWithDictionary:] (self=0x95e2130, _cmd=0x81ca158,
    connectionDictionary=0x8f85db8) at VNCConnection.m:1031
#12 0xf79a84d0 in -[NSObject performSelector:withObject:] (self=0x95e2130, _cmd=0xf7b2cbd8,
    aSelector=0x81ca158, anObject=0x8f85db8) at NSObject.m:1855
---Type <return> to continue, or q <return> to quit---
#13 0xf7a16ff4 in -[NSThread main] (self=0x900f588, _cmd=0xf7b2cbe0) at NSThread.m:760
#14 0xf7a17739 in nsthreadLauncher (thread=0x900f588) at NSThread.m:823
#15 0xf73e64ff in start_thread () from /lib32/libpthread.so.0
#16 0xf7323cee in clone () from /lib32/libc.so.6

Thread 1 (Thread 0xf6ff26d0 (LWP 30717)):
#0  0xf7f40430 in __kernel_vsyscall ()
#1  0xf73ed179 in __lll_lock_wait () from /lib32/libpthread.so.0
#2  0xf73e8244 in _L_lock_89 () from /lib32/libpthread.so.0
#3  0xf73e7b42 in pthread_mutex_lock () from /lib32/libpthread.so.0
#4 0xf79955a8 in -[NSLock lock] (self=0x8cf7338, _cmd=0xf7b2cb88) at NSLock.m:206 #5 0xf7a1802b in -[GSRunLoopThreadInfo fire] (self=0x8cf81c0, _cmd=0xf7b5f088) at NSThread.m:1015 #6 0xf7aa6f31 in -[GSRunLoopCtxt pollUntil:within:] (self=0x8d00528, _cmd=0xf7b20e50, milliseconds=0,
    contexts=0x8cf7458) at GSRunLoopCtxt.m:612
#7 0xf79e84a6 in -[NSRunLoop acceptInputForMode:beforeDate:] (self=0x8cf7430, _cmd=0xf7b20e78,
    mode=0xf7b20ec0, limit_date=0x9297ce8) at NSRunLoop.m:1197
#8 0xf79e6563 in -[NSRunLoop runMode:beforeDate:] (self=0x8cf7430, _cmd=0xf7f05820, mode=0xf7b20ec0,
    date=0x8d03018) at NSRunLoop.m:1265
#9 0xf7dbb440 in -[GSDisplayServer(EventOps) getEventMatchingMask:beforeDate:inMode:dequeue:] ( self=0x8d3d390, _cmd=0xf6e3f198, mask=4294967295, limit=0x8d03018, mode=0xf7b20ec0, flag=1 '\001')
    at GSDisplayServer.m:1003
#10 0xf6defa6e in -[XGServer(X11Ops) getEventMatchingMask:beforeDate:inMode:dequeue:] (self=0x8d3d390, _cmd=0xf7e5ebb0, mask=4294967295, limit=0x8d03018, mode=0xf7b20ec0, flag=<value optimized out>)
    at XGServerEvent.m:2546
#11 0xf7c2b59f in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (self=0x8d078d8, _cmd=0xf7e5edf0, mask=4294967295, expiration=0x8d03018, mode=0xf7b20ec0, flag=1 '\001')
    at ../Headers/Additions/GNUstepGUI/GSDisplayServer.h:200
#12 0xf7c29581 in -[NSApplication run] (self=0x8d078d8, _cmd=0xf7e54f00) at NSApplication.m:1520
---Type <return> to continue, or q <return> to quit---
#13 0xf7c09506 in NSApplicationMain (argc=1, argv=0xff9602a4) at Functions.m:89
#14 0x08050e22 in main (argc=Cannot access memory at address 0x80
) at main.m:13
(gdb)



reply via email to

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