Reputation: 21
I have memory related problem in my application on solaris9 environment where Tcl_DeleteInterp()
function calls lot of free()
and mutex_unlock()
functions. To debug the problem i followed the below steps to compile tcl on solaris server (with TCL_MEM_DEBUG
flag) but still i couldn't use the 'memory' command in my interpreter.
./configure –prefix=<directory needs to be installed> --enable-symbols=mem
)Tcl_InitMemory()
function (so that the memory command will be registered in the supplied(arg) interpreter.When i used the interpreter exe (tclsh) separately i could execute the memory command, but when i used the same exe on my application its not working. Can someone help me what could be the possible reason for this problem ?
Also help me how can i cross verify the libraries that they are compiled with TCL_MEM_DEBUG
flag.
Will the Tcl source code tar file contain Solaris directory where i have to build the libraries or should i use the unix source code for solaris platform as well ?
Thanks
Upvotes: 0
Views: 216
Reputation: 137567
You're using Tcl embedded in your code? You need to call Tcl_InitMemory
(passing in the handle to the interpreter where you want the memory
command created) after creation of the interpreter and before you run user scripts, i.e., straight after the Tcl_CreateInterp
gives you the handle (which should in turn come after the Tcl_FindExecutable
call that initializes the shared parts of the library).
You must also make sure that everything is built with that flag set so that the correct memory allocation APIs are used in both your code when it integrates with Tcl, and you must make sure that you are linking against the debugging build. It's probably the linking that has gone wrong, but I've not done that level of development on Solaris for many years.
I think you'll find that “Getting a list of used libraries by a running process (unix)” is relevant to your problems.
Upvotes: 0
Reputation: 71
Are you using [mem] interactively (which does expansion of unambiguous short command names) and forgetting to use the full name ([memory]) in your scripts?
Upvotes: 0