1. Alexander Malinin
  2. BearLibTerminal
  3. Issues
Issue #23 resolved

Reopening a closed terminal hangs forever

Steve Losh
created an issue

I'm having a bit of trouble opening a terminal after I've closed one. I can open a terminal just fine (Python 2.7, OS X):

terminal.open()
terminal.refresh()

Then I can close it, which also works just fine:

terminal.close()

But then trying to open it again hangs forever (after printing a warning):

terminal.open()
Feb  7 14:24:54  python[4945] <Warning>: void CGSUpdateManager::log() const: conn 0x2e683: spurious update.

Note: I'm actually trying to wrap bearlibterminal in a different language (Common Lisp with CFFI) and I see the same problem, so it's probably not the Python bindings. I just wanted to eliminate my wrapper code as the issue.

Comments (9)

  1. Steve Losh reporter

    Thanks for the update. I rebuilt the .dylib with cmake . && make and tried again. This time I get a stack trace when I try to refresh the terminal the second time:

    sjl at fenrir in ~
    (bearlib) ><((°> python
    Python 2.7.9 (default, Jan 29 2015, 06:27:40)
    [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from bearlibterminal import terminal
    >>> terminal.open()
    True
    >>> terminal.refresh()
    >>> terminal.close()
    # Everything above here works great ^^^
    
    >>> terminal.open()
    True
    >>> terminal.refresh()
    2017-03-06 11:53:39.073 python[45903:1500295] -[NSSurface hideCursor]: unrecognized selector sent to instance 0x7fb23a91fce0
    2017-03-06 11:53:39.075 python[45903:1500295] An uncaught exception was raised
    2017-03-06 11:53:39.075 python[45903:1500295] -[NSSurface hideCursor]: unrecognized selector sent to instance 0x7fb23a91fce0
    2017-03-06 11:53:39.076 python[45903:1500295] (
            0   CoreFoundation 0x00007fff8bcb9452 __exceptionPreprocess + 178
            1   libobjc.A.dylib 0x00007fff93c50f7e objc_exception_throw + 48
            2   CoreFoundation 0x00007fff8bd2310d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
            3   CoreFoundation 0x00007fff8bc294d1 ___forwarding___ + 1009
            4   CoreFoundation 0x00007fff8bc29058 _CF_forwarding_prep_0 + 120
            5   CoreFoundation 0x00007fff8bc44b1c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
            6   CoreFoundation 0x00007fff8bc44aaf ___CFXRegistrationPost_block_invoke + 63
            7   CoreFoundation 0x00007fff8bc44a27 _CFXRegistrationPost + 407
            8   CoreFoundation 0x00007fff8bc44792 ___CFXNotificationPost_block_invoke + 50
            9   CoreFoundation 0x00007fff8bc01542 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1922
            10  CoreFoundation 0x00007fff8bc00795 _CFXNotificationPost + 693
            11  Foundation 0x00007fff950a917a -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
            12  AppKit 0x00007fff97319116 -[NSApplication sendEvent:] + 8394
            13  libBearLibTerminal.dylib 0x00000001013a5132 -[CocoaTerminalApplicationsendEvent:] + 98
            14  libBearLibTerminal.dylib 0x00000001013a4f8c _ZN15BearLibTerminal11CocoaWindow10PumpEventsEv + 108
            15  libBearLibTerminal.dylib 0x00000001013903b7 _ZN15BearLibTerminal8Terminal7RefreshEv + 535
            16  _ctypes.so 0x00000001013347ef ffi_call_unix64 + 79
            17  ??? 0x00007fff5edef0e0 0x0 + 140734785056992
    )
    2017-03-06 11:53:39.076 python[45903:1500295] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSSurface hideCursor]: unrecognized selector sent to instance 0x7fb23a91fce0'
    *** First throw call stack:
    (
            0   CoreFoundation 0x00007fff8bcb9452 __exceptionPreprocess + 178
            1   libobjc.A.dylib 0x00007fff93c50f7e objc_exception_throw + 48
            2   CoreFoundation 0x00007fff8bd2310d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
            3   CoreFoundation 0x00007fff8bc294d1 ___forwarding___ + 1009
            4   CoreFoundation 0x00007fff8bc29058 _CF_forwarding_prep_0 + 120
            5   CoreFoundation 0x00007fff8bc44b1c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
            6   CoreFoundation 0x00007fff8bc44aaf ___CFXRegistrationPost_block_invoke + 63
            7   CoreFoundation 0x00007fff8bc44a27 _CFXRegistrationPost + 407
            8   CoreFoundation 0x00007fff8bc44792 ___CFXNotificationPost_block_invoke + 50
            9   CoreFoundation 0x00007fff8bc01542 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1922
            10  CoreFoundation 0x00007fff8bc00795 _CFXNotificationPost + 693
            11  Foundation 0x00007fff950a917a -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
            12  AppKit 0x00007fff97319116 -[NSApplication sendEvent:] + 8394
            13  libBearLibTerminal.dylib 0x00000001013a5132 -[CocoaTerminalApplicationsendEvent:] + 98
            14  libBearLibTerminal.dylib 0x00000001013a4f8c _ZN15BearLibTerminal11CocoaWindow10PumpEventsEv + 108
            15  libBearLibTerminal.dylib 0x00000001013903b7 _ZN15BearLibTerminal8Terminal7RefreshEv + 535
            16  _ctypes.so 0x00000001013347ef ffi_call_unix64 + 79
            17  ??? 0x00007fff5edef0e0 0x0 + 140734785056992
    )
    libc++abi.dylib: terminating with uncaught exception of type NSException
    fish: 'python' terminated by signal SIGABRT (Abort)
    

    Maybe I didn't build it properly? The instructions in the README are pretty sparse and I couldn't find a prebuilt binary of the repo head anywhere...

  2. Log in to comment