1. TortoiseHg
  2. TortoiseHg
  3. thg
  4. Issues
Issue #3437 closed

Tortoise HG crashes when opened from Launchpad on OSX 10.9

Anonymous created an issue

After downloading the OSX build, opening the zipfile and running the .app the initial first time, Tortoise HG opens as intended.

Once closed, and ran again, it crashes every time. Same goes for installing the application to Applications or the Launchpad.

This occurs with the nightly stable builds as of 24 oct. It did not occur in 10.8.

Comments (38)

  1. Miguel Tomás

    I have exactly the same problem. I have to unzip every time I want to commit/push/pull. If I close tortoiseHG and opened again on OSX Mavericks it crashes with this error:

    31/10/13 10:27:04,691 thg[2872]: TortoiseHg Error

    31/10/13 10:27:06,028 com.apple.launchd.peruser.501[162]: (org.pythonmac.tortoisehg.thg.48080[2872]) Exited with code: 255

    31/10/13 10:27:06,091 Console[2876]: setPresentationOptions called with NSApplicationPresentationFullScreen when there is no visible fullscreen window; this call will be ignored.

  2. Mats Larsson

    I got exactly same problem. It works just first time, then I get the "TortoiseHg Error".

    So I cannot run Tortoisehg on Mavericks. Please fix this.

    Best regards

  3. Pavel Sorokin

    I'm having the same issue. Software is unusable.

    Also, on retina, every window of the TortoiseHg UI seems to support retina (all fonts are clear), except probably the most important window: change log. It's very pixelated and almost unreadable.

  4. Paolo Boni

    I see that copying again the app extracted from a fresh zip into the Application folder, you can run it once again. Not really a solution, but a possibility to use anyway the application on our Mavericks

  5. Ratnesh Chandna

    Same here. I'm using Mavericks and I tried opening the earliest nightly build available (May 21 2013) and face the same issue. Having said that, it doesn't seem like a regression problem, but an OS compatibility issue instead.

    Either way, when can we expect a fix?

  6. Andre Rudlaff

    It seems that the root issue is that argv emulation is broken with py2app in Mavericks. See https://bitbucket.org/ronaldoussoren/py2app/issue/129/mavericks-osx-109-program-argument-passing

    So I've created a small hack which disables argv emulation completely and updated the thg.py file, so it does no longer try to access the arguments.

    You can get it from here https://dl.dropboxusercontent.com/u/21988053/TortoiseHG-Mavericks-Fix.zip

    Copy both files into your TortoiseHG.app and it should work again. However I do not know what side effects it may have if argv emulation is disabled (you may not be able to start the app with command line parameters?)

    I've tested this with the latest stable build (2013-12-03) available from https://s3.amazonaws.com/kiln-tortoisehg-nightlies/index.htm

  7. Yuya Nishihara

    thg: remove the -psn argument supplied by launchd only if present (refs #3437)

    Prior to OS X 10.9, when launching an app from Finder, launchd would provide an argument starting with "-psn", like this: "-psn_0_261532". This is the process serial number - a vestige from 2001, to support older apps that used cooperative multitasking. In OS X 10.9, Apple changed this, so launchd no longer sends the parameter. Thg assumed that there was always two arguments - the first being the name of the app, and the second starting with "-psn". The fix: just make sure argv has at least one element before checking if argv[0] starts with "-psn".

    → <<cset 3761007d0e72>>

  8. Andre Rudlaff

    I've built a new version, based on the latest TortoiseHG release (2.11.2).

    You can get the version here: https://dl.dropboxusercontent.com/u/21988053/TortoiseHg-2.11.2.zip

    I am only able to test this on Mavericks, so I'd appreciate any feedback if the app is working on older versions of OS X.

    I'd still consider this a BETA release, so don't throw away your old application files, and let me know if you have any issues with this version. :)

    For issues/feedback, check https://groups.google.com/forum/?hl=de#!topic/thg-dev/maaoY_-n6uc

  9. Laurens Holst

    Thanks for providing these builds. It seems to work well.

    One thing I noticed, when I use nonascii characters I get the following message:

    Unable to translate message to local encoding
    Consider setting HGENCODING environment variable
    Replace untranslatable characters with "?"?
    

    When I start this TortoiseHg build from the command line however, as well as with the old OS X builds, I can use nonascii characters without problems. Is the environment encoding (LANG=nl_NL.UTF-8) not set up correctly by the launcher wrapper?

  10. Andre Rudlaff

    I have updated the version, so it sets the proper environment. The LANG environment variable is only set by the terminal app and is not included in the environment provided to the app bundle.

    I have added pyobjc to get the users locale (i.e. de_DE or nl_NL) however I didn't find a way to detect the proper encoding to use (the terminal app settings provide a dropdown box for this), so I have hardcoded this to UTF-8.

    You should still be able to set the HGENCODING variable in case you need to override this behaviour.

    The version is available here: https://dl.dropboxusercontent.com/u/21988053/TortoiseHg-3.0.zip

    Note: this also fixes a crash when merging files, again this seems to be introduced by the py2app environment.

    EDIT Just updated the file again, I disabled the optimization and argv emulation in the py2app setup script, and I finally could remove the hacks I've introduced for dialogs and merging files.

    So I'd consider this version a pretty good release candidate. Note that I still test on OSX 10.9 only.

  11. Andre Rudlaff

    Sorry for the delay, had some problems with my toolchain setup (i.e. had to recreate it) and very little time to do so.

    Hopefully now everything works again, I'm currently uploading the 3.2.1 build.

  12. Log in to comment