Skip to content
This repository has been archived by the owner on Oct 18, 2021. It is now read-only.

Hang in _openProtocol::: when launching listener twice #2

Closed
ghmrs356 opened this issue Jun 4, 2013 · 1 comment
Closed

Hang in _openProtocol::: when launching listener twice #2

ghmrs356 opened this issue Jun 4, 2013 · 1 comment

Comments

@ghmrs356
Copy link

ghmrs356 commented Jun 4, 2013

When I'm lauching a listener, shut it down and launch it again, the call to [listener open] never returns. It seems deadlocked with thread 6.

Complete backtraces of all threads below

Code to startup and shutdown

  • (void)startup
    {
    if (browser != nil)
    return;

    browser = [[MYBonjourBrowser alloc] initWithServiceType:@"_rtxxxdata._tcp."];

    registration = [[browser myRegistration] retain];

    listener = [[BLIPListener alloc] initWithPort:12345];
    [listener setPickAvailablePort:YES];

    [browser start];
    [listener setDelegate:self];
    [listener open];

    [registration setPort:[listener port]];
    [registration start];
    }

  • (void)shutdown
    {
    [browser stop];
    [registration stop];
    [listener close];
    [listener setDelegate:nil];

    [browser release], browser = nil;
    [registration release], registration = nil;
    [listener release], listener = nil;
    }

Thread 1, Queue : com.apple.main-thread
#0 0x3bddea7a in OSSpinLockLock$VARIANT$mp ()
#1 0x33a7baca in CFSocketCreateWithNative ()
#2 0x33ab6630 in CFSocketCreate ()
#3 0x0027a7bc in -[TCPListener _openProtocol:address:error:] at /Users/markus/MyApp/SOFramework/MYNetwork/TCP/TCPListener.m:126
#4 0x0027ac66 in -[TCPListener open:] at /Users/markus/MyApp/SOFramework/MYNetwork/TCP/TCPListener.m:169
#5 0x0027b226 in -[TCPListener open] at /Users/markus/MyApp/SOFramework/MYNetwork/TCP/TCPListener.m:216
#6 0x00286e28 in -[RubiNetwork startup] at /Users/markus/MyApp/rubiTrack/src/core/RubiNetwork.m:68
#7 0x002880cc in -[RTGNetworkViewController startupNetwork:] at /Users/markus/Projects/rubiTrack-to-Go/src/ui/RTGNetworkViewController.m:83
#8 0x359d10c4 in -UIApplication sendAction:to:from:forEvent:
#9 0x359d1076 in -UIApplication sendAction:toTarget:fromSender:forEvent:
#10 0x359d1054 in -UIControl sendAction:to:forEvent:
#11 0x359d090a in -UIControl(Internal) _sendActionsForEvents:withEvent:
#12 0x359d0e00 in -UIControl touchesEnded:withEvent:
#13 0x358f95f0 in -UIWindow _sendTouchesForEvent:
#14 0x358e6800 in -UIApplication sendEvent:
#15 0x358e611a in _UIApplicationHandleEvent ()
#16 0x375d85a2 in _PurpleEventCallback ()
#17 0x375d81d2 in PurpleEventCallback ()
#18 0x33ab3172 in CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION ()
#19 0x33ab3116 in __CFRunLoopDoSource1 ()
#20 0x33ab1f98 in __CFRunLoopRun ()
#21 0x33a24ebc in CFRunLoopRunSpecific ()
#22 0x33a24d48 in CFRunLoopRunInMode ()
#23 0x375d72ea in GSEventRunModal ()
#24 0x3593a300 in UIApplicationMain ()
#25 0x000475a6 in main at /Users/markus/Projects/rubiTrack-to-Go/src/app/main.m:16
#26 0x3bdaeb20 in start ()

Thread 3, Queue : com.apple.libdispatch-manager
#0 0x3be65648 in kevent64 ()
#1 0x3bd95978 in _dispatch_mgr_invoke ()
#2 0x3bd95658 in _dispatch_mgr_thread$VARIANT$mp ()

Thread 5 WebThread, Queue : (null)
#0 0x3be64eb4 in mach_msg_trap ()
#1 0x3be6504c in mach_msg ()
#2 0x33ab3044 in __CFRunLoopServiceMachPort ()
#3 0x33ab1da2 in __CFRunLoopRun ()
#4 0x33a24ebc in CFRunLoopRunSpecific ()
#5 0x33a24d48 in CFRunLoopRunInMode ()
#6 0x39a0a504 in RunWebThread(void*) ()
#7 0x3bdce310 in _pthread_start ()
#8 0x3bdce1d8 in thread_start ()

Thread 6 com.apple.CFSocket.private, Queue : (null)
#0 0x3be64fbc in syscall_thread_switch ()
#1 0x3bddea92 in OSSpinLockLock$VARIANT$mp ()
#2 0x33a7fba8 in CFSocketInvalidate ()
#3 0x0028587a in -[MYDNSConnection close] at /Users/markus/MyApp/SOFramework/MYNetwork/PortMapper/MYDNSService.m:272
#4 0x00285458 in -[MYDNSConnection dealloc] at /Users/markus/MyApp/SOFramework/MYNetwork/PortMapper/MYDNSService.m:223
#5 0x33a1f310 in CFRelease ()
#6 0x33a7fd8c in CFSocketInvalidate ()
#7 0x33ab70c6 in __CFSocketManager ()
#8 0x3bdce310 in _pthread_start ()

@snej
Copy link
Owner

snej commented Jun 4, 2013

This should be filed in MYNetwork, not MYCrypto...

@snej snej closed this as completed Jun 4, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants