Discussion:
[TCLCORE] How to debug TclStackFree: incorrect freePtr ?
Roland Schwingel
2012-04-17 10:15:47 UTC
Permalink
Hi...

I am using insight (GNU Debugger with tcl/tk frontend) together with
tcl/tk 8.6 (most recent sources from fossil) on windows 7 64bit in
64bit. Compiled using mingw-w64.

While it worked very well and stable for some weeks I am seeing now a
reproducable Tcl_Panic() when stepping thru certain c++ code using 64bit
insight (and so also 64bit tcl):

TclStackFree: incorrect freePtr (<some address> != <some other
address>). Call out of sequence?

When searching the internet I found that this should most likely be
related to multithreaded usage of the tcl interpreter. In my case this
seems not to be the case. I added some code to TclStackFree() to dump
the threadids and to alert when it changes. It is always the same
threadid. So accessing the interpreter from multiple threads is not
happening.

Moreover when debugging my application in 32bit mode (on the same
system) using the very same 32bit version of insight with the very same
tcl just compiled for 32bit it does not panic.

Has anyone any clue on how to isolate and fix that?

Thanks for your help,

Roland
miguel sofer
2012-04-17 12:23:53 UTC
Permalink
Looks like a problem with insight's C/C++ code - either it is doing
something wrong with Tcl's API, or else it is exposing a bug in Tcl.

Reading http://www.contrapositivediary.com/?p=1396, I am less than
optimistic about a simple solution.

In any case, I would recommend:
1) talk with insight's maintainers, they may be able to help
2) use the Tcl/Tk version that insight provides in its download page at
ftp://sourceware.org/pub/insight/snapshots/current/

HTH

Miguel
Post by Roland Schwingel
Hi...
I am using insight (GNU Debugger with tcl/tk frontend) together with
tcl/tk 8.6 (most recent sources from fossil) on windows 7 64bit in
64bit. Compiled using mingw-w64.
While it worked very well and stable for some weeks I am seeing now a
reproducable Tcl_Panic() when stepping thru certain c++ code using 64bit
TclStackFree: incorrect freePtr (<some address> !=<some other
address>). Call out of sequence?
When searching the internet I found that this should most likely be
related to multithreaded usage of the tcl interpreter. In my case this
seems not to be the case. I added some code to TclStackFree() to dump
the threadids and to alert when it changes. It is always the same
threadid. So accessing the interpreter from multiple threads is not
happening.
Moreover when debugging my application in 32bit mode (on the same
system) using the very same 32bit version of insight with the very same
tcl just compiled for 32bit it does not panic.
Has anyone any clue on how to isolate and fix that?
Thanks for your help,
Roland
------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Tcl-Core mailing list
https://lists.sourceforge.net/lists/listinfo/tcl-core
Roland Schwingel
2012-04-17 12:46:31 UTC
Permalink
Hi Miguel,

Thanks for your answer.
Post by miguel sofer
Looks like a problem with insight's C/C++ code - either it is doing
something wrong with Tcl's API, or else it is exposing a bug in Tcl.
It might be one or both of them. The only thing that lets me tend to say
it might be tcl itself is that it works without panic in 32bit.
Post by miguel sofer
1) talk with insight's maintainers, they may be able to help
Keith Seitz (who wrote many parts of insight) is the only one official
available. I am already in deep contact with him since a while. I need
insight to run on windows. Especially 64bit. And it looks that at
present I am the one who does some parts of this maintainer job for
windows. I am trying to resurrect insight and to push it to a releasable
state.
Post by miguel sofer
2) use the Tcl/Tk version that insight provides in its download page at
ftp://sourceware.org/pub/insight/snapshots/current/
I know. At present it uses tcl 8.4 which is IMHO a no-go for windows 7
64bit so I started out to port insight to newer tcl/tk. When everything
is done I will try to update the tcl version supplied by insight to 8.6.
I already ironed out a lot of problems and insight runs really smooth
here. Except for this one problem I uncovered yesterday.

I willing to debug that out but hoped to get some advice/hints from a
tcl developer to track that particular problem down.

Roland

Loading...