tcl-related segfault in NAMD

From: FX (fxcoudert_at_gmail.com)
Date: Wed Mar 06 2013 - 09:32:39 CST

Hi all,

After patching NAMD (the Langevin piston code, see my earlier email today), I have had to compile my own binaries based on the NAMD-2.9 code, on my 64-bit Intel Mac OS 10.8.2 machine. I have successfully compiled FFTW (no problem), CHARM++ (took a lot of time to figure out, but it compiled okay and test programs ran fine), and TCL is already installed on the machine.

So, I compiled NAMD with this configuration: "./config MacOSX-x86_64-g++ --charm-arch net-darwin-x86_64-gfortran-gcc --with-debug"
Problem is, I now get a segfault at the beginning of the run. The backtrace, obtained from gdb, is the following:

> Program received signal EXC_BAD_ACCESS, Could not access memory.
> Reason: KERN_INVALID_ADDRESS at address: 0x00007fff02f47fb8
> 0x00000001008d2660 in setJcontext () at stl_algo.h:2831
> 2831 std::__final_insertion_sort(__first, __last);
> (gdb) bt
> #0 0x00000001008d2660 in setJcontext () at stl_algo.h:2831
> #1 0x00000001008d26d1 in swapJcontext () at stl_algo.h:2831
> #2 0x000000010095243b in CsdScheduleForever () at ckreduction.h:700
> #3 0x00000001009524cd in CsdScheduler () at ckreduction.h:700
> #4 0x000000010006c3f6 in BackEnd::suspend () at BackEnd.C:234
> #5 0x000000010080aca1 in ScriptTcl::suspend (this=0x10115a5c0) at ScriptTcl.C:63
> #6 0x0000000100811448 in ScriptTcl::initcheck (this=0x10115a5c0) at ScriptTcl.C:89
> #7 0x000000010080c7ed in ScriptTcl::Tcl_minimize (clientData=0x10115a5c0, interp=0x101860a10, argc=2, argv=0x10186e450) at ScriptTcl.C:466
> #8 0x0000000100f5a59d in TclInvokeStringCommand ()
> #9 0x0000000100f5b9cf in Tcl_ListMathFuncs ()
> #10 0x0000000100f5ca7a in Tcl_EvalEx ()
> #11 0x0000000100f5c444 in Tcl_EvalEx ()
> #12 0x0000000100fb8e85 in Tcl_FSEvalFileEx ()
> #13 0x0000000100fb7cbb in Tcl_EvalFile ()
> #14 0x000000010080af25 in ScriptTcl::load (this=0x10115a5c0, scriptFile=0x7fff5fbffbef "md.conf") at ScriptTcl.C:1139
> #15 0x0000000100066f4c in after_backend_init (argc=2, argv=0x7fff5fbffa98) at mainfunc.C:147
> #16 0x00000001000666a1 in main (argc=2, argv=0x7fff5fbffa98) at mainfunc.C:44

Does anyone have a clue what is happening? How can I debug this further? Are there special tricks to get NAMD to compile correctly on Mac OS X?

Thanks in advance,
François-Xavier

PS: I am compiling with Mac OS's native g++ compiler, which identifies itself as "gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)".

This archive was generated by hypermail 2.1.6 : Wed Dec 31 2014 - 23:21:00 CST