Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#35400 closed defect (duplicate)

Pymol crash in Mountain Lion

Reported by: akouts_1871@… Owned by: howarth@…
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: mountainlion Cc: derekathomas@…, john@…, mich.r.mitchell@…, r+macports@…, jruhym@…, adfernandes (Andrew Fernandes)
Port: pymol

Description (last modified by ryandesign (Ryan Carsten Schmidt))

Port Pymol version 1.5.0.3 compiled with Xcode 4.4 on Mountain Lion crashes with the following displayed error

Tcl_WaitForEvent: CFRunLoop finished
Abort trap: 6

Attachments (1)

Portfile.diff (1.4 KB) - added by howarth@… 12 years ago.
Portfile diff to update to 8.5.12 and move corefoundation usage into threads variant

Download all attachments as: .zip

Change History (34)

comment:1 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Keywords: mountainlion added; crash removed
Owner: changed from macports-tickets@… to howarth@…

comment:2 Changed 12 years ago by michelle.lynn.gill@…

I am experiencing the same issue on an identical setup.

comment:3 Changed 12 years ago by michelle.lynn.gill@…

Cc: michelle.lynn.gill@… added

Cc Me!

comment:4 in reply to:  3 ; Changed 12 years ago by howarth@…

I strongly suspect this is breakage introduced by the attempt to address...

https://trac.macports.org/ticket/31995
Please try regressing this change from the tcl package and see if that 'fixes' pymol.
Note that the error you are seeing was previously seen before --disable-corefoundation was added to the tcl build...
http://lists.macosforge.org/pipermail/macports-tickets/2009-October/042584.html

comment:5 in reply to:  4 Changed 12 years ago by michelle.lynn.gill@…

Replying to howarth@…:

I strongly suspect this is breakage introduced by the attempt to address...

https://trac.macports.org/ticket/31995
Please try regressing this change from the tcl package and see if that 'fixes' pymol.
Note that the error you are seeing was previously seen before --disable-corefoundation was added to the tcl build...
http://lists.macosforge.org/pipermail/macports-tickets/2009-October/042584.html

Installing the older version of tcl that has core foundation disabled and then uninstalling, cleaning, and reinstalling Pymol seems to work for me.

Maybe tcl should have a core foundation variant (or a non-core foundation variant) as was discussed in 31995 and then Pymol could enforce the appropriate version at build?

comment:6 Changed 12 years ago by howarth@…

Perhaps we should first see if Jeremy Huddleston can take a look at this issue and perhaps forward it to the Apple developer who maintains their Tcl package.
It would be nice to just find a proper fix for tcl or a viable workaround for pymol rather than just resort to variants which will result in packages not being
able to co-exist.

comment:7 Changed 12 years ago by howarth@…

A similar issue with Tcl_WaitForEvent is also discussed in...
http://sourceforge.net/tracker/?func=detail&aid=2944777&group_id=10894&atid=110894

comment:8 Changed 12 years ago by howarth@…

A good place to start would be to try to debug the origin of the crash. In particular, see if the crash is actually in the Blt code (which is very crufty).

comment:9 Changed 12 years ago by howarth@…

Why do we have...

# dont enable threads by default as Tcl uses thread-local storage which makes
# passing Tcl_Obj* around between threads fatal
variant threads description {add multithreading support} {

configure.args-append --enable-threads

}

yet we leave threading defaulted on. This makes no sense at all.

comment:10 Changed 12 years ago by howarth@…

I can't reproduce the crash on Mountain Lion with local builds of all of the packages against Xcode 4.4.
Are you seeing this with the stock tcl build or the threads variant? I know on fink, we found that the problems
with forked threads under corefoundation would be sporadic and pop up irregularly whenever we tried to use that
feature. FYI, I am testing on a dual quad Xeon.

comment:11 Changed 12 years ago by howarth@…

Nore the comments in thread from https://groups.google.com/forum/?fromgroups#!msg/comp.lang.tcl/e8PR4MM7o1c/sI3auiQTas4J
Since blt uses fork() in CreateProcess() of src/bltUnixPipe.c, a tcl build using --enable-threads should be avoided.

comment:12 in reply to:  10 Changed 12 years ago by michelle.lynn.gill@…

Replying to howarth@…:

I can't reproduce the crash on Mountain Lion with local builds of all of the packages against Xcode 4.4.
Are you seeing this with the stock tcl build or the threads variant? I know on fink, we found that the problems
with forked threads under corefoundation would be sporadic and pop up irregularly whenever we tried to use that
feature. FYI, I am testing on a dual quad Xeon.

The tcl build I'm using does not have threads enabled:

The following ports are currently installed:
  tcl @8.5.11_0
  tcl @8.5.11_1 (active)

Revision 1 is the local copy I made to remove the core foundation flag.

Other info: my MacPorts installation is in a custom location, so all my ports are built from source. I'm using OS X 10.8 with Xcode 4.4 on a 2008 MacPro with dual quad-core Xeons (sounds similar to your system). My OS X 10.8 install was to a freshly formatted drive, so at least in my case, there is no chance that the issue is being caused (or prevented from happening) by old libraries.

I should also mention that I built everything in my MacPorts install with gcc45 (from macports) selected. And I have your PyMol Portfile setup to build against python27, with that being the only change to the PyMol port. I'll start building python26 and other deps so I can install the default PyMol just to make sure python version isn't the issue.

comment:13 in reply to:  11 Changed 12 years ago by michelle.lynn.gill@…

Replying to howarth@…:

Nore the comments in thread from https://groups.google.com/forum/?fromgroups#!msg/comp.lang.tcl/e8PR4MM7o1c/sI3auiQTas4J
Since blt uses fork() in CreateProcess() of src/bltUnixPipe.c, a tcl build using --enable-threads should be avoided.

Also, I don't know if the remainder of the comments of this nature are intended for me and, specifically if you want me to test something, but if so, you'll have to provide more specific information. I do a lot of scripting, but the internals of blt are over my head.

It's worth nothing, regarding blt, that my installation of blt was likely built with a tcl that has threading on (if that is the default, as you say above) and PyMol worked fine for me without rebuilding blt.

comment:14 Changed 12 years ago by howarth@…

I believe the issue may be that fork and threads can't co-exist in tcl (hence RedHat provides threaded and non-threaded tcl's which are selectable via alternatives).
Also I suspect that Corefoundation effectively introduces threads into the equation (see...

http://old.nabble.com/Fork-vs.-exec-in-RC-5-of-Tk-8.5-td14390131.html

comment:15 Changed 12 years ago by howarth@…

You should also read through...
https://bugzilla.redhat.com/show_bug.cgi?id=478961
where RedHat decides that forks and threads should never be allowed to mix
due to the poor thread handling design of tcl. Hence I believe anything that uses fork
should not use CoreFoundation (as Apple recommended in the past... see the previous post).

comment:17 Changed 12 years ago by michelle.lynn.gill@…

FWIW, the crash is reproducible with pymol built against python26 and fixable, as above, by disabling core foundation in tcl. Thus, my pymol built against python27 was not the cause of the problem. Just thought I'd rule out any contribution from modifications on my end.

comment:18 Changed 12 years ago by howarth@…

See http://trac.macports.org/ticket/31995#comment:6. I believe we really should just dump --enable-corefoundation into the threads variant since
both --enable-threads and --enable-corefoundation have the same requirement to avoid code that uses fork() without exec().

Changed 12 years ago by howarth@…

Attachment: Portfile.diff added

Portfile diff to update to 8.5.12 and move corefoundation usage into threads variant

comment:19 Changed 12 years ago by derekathomas@…

Cc: derekathomas@… added

Cc Me!

comment:20 Changed 12 years ago by john@…

I am having the same error message when I try to run Pymol.

Please CC me.

comment:21 Changed 12 years ago by john@…

Cc: john@… added

Cc Me!

comment:22 in reply to:  20 ; Changed 12 years ago by howarth@…

Our experience in fink has been that you can't reliably enable corefoundation in tcl without
destabilizing packages like pymol which use auxiliary packages such as blt which call fork().
As I mentioned earlier, since both the threads support and corefoundation have the same restriction
against calling fork(), it seems quite logical to fold the corefoundation usage into the threads variant of tcl.

comment:23 Changed 12 years ago by michelle.lynn.gill@…

Cc: michelle.lynn.gill@… removed

Cc Me!

comment:24 Changed 12 years ago by mich.r.mitchell@…

Cc: mich.r.mitchell@… added

Cc Me!

comment:25 Changed 12 years ago by r+macports@…

Cc: r+macports@… added

Cc Me!

comment:26 in reply to:  22 ; Changed 12 years ago by r+macports@…

It's great that somebody has identified the problem here, but is there either a fix that I can apply or (ideally!) a fix to tcl so that I can run pymol again?

comment:27 in reply to:  26 Changed 12 years ago by haianjxw@…

Please can anyone provide a fix? Mine crashed on py26.

comment:28 Changed 12 years ago by howarth@…

The tcl maintainers have broken pymol (actually most likely the required blt package) by their ill-considered removal of
--disable-corefoundation. As I have explained numerous times, the Core Foundation support in tcl is likely providing some level
of thread support which is incompatible with tcl programs that use fork() without exec(). The sensible fix is already attached to
this bug report as well as http://trac.macports.org/ticket/31995 where the removal of --disable-corefoundation. is moved to
the threads variant of tcl. Unfortunately the macports tcl maintainers seem entirely disinterested in fixing this breakage.

comment:29 in reply to:  28 Changed 12 years ago by r+macports@…

Well, you seem to have finally persuaded them to fix it. Thanks very much for your perseverance!

comment:30 Changed 12 years ago by jruhym@…

Cc: jruhym@… added

Cc Me!

comment:31 Changed 12 years ago by jmroot (Joshua Root)

Resolution: duplicate
Status: newclosed

comment:32 Changed 11 years ago by adfernandes (Andrew Fernandes)

I just updated pymol-devel to the latest SVN (1.5.0.3 revision 4007) and had the corefoundation stuff creep up again.

See #36847 and r99765 (checks that the tcl port is installed without the corefoundation variant).

FYI - this will likely bite again.

comment:33 Changed 11 years ago by adfernandes (Andrew Fernandes)

Cc: adfernandes@… added

Cc Me!

Note: See TracTickets for help on using tickets.