Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2015-09-28
10:57 • Closed ticket [93081e9a84]: crash in PushProcCallFrame due to nullpointer derefe... artifact: b9a490dc35 user: anonymous
2015-09-23
10:59 • New ticket [93081e9a84]. artifact: 6c65d7a039 user: anonymous

crash in PushProcCallFrame due to nullpointer derefence

Closed93081e9a8404270e45eadf642c4cdfbff6ef968bCreated 11 years agoUpdated 11 years ago
Descriptionplain2015-09-23 10:59:13
Windows 7, Tcl 8.5.18

My app runs for some length of time and then crashes in tclProc.c #1583 in PushProcCallFrame()

	codePtr = procPtr->bodyPtr->internalRep.twoPtrValue.ptr1;
=> 	if (((Interp *) *codePtr->interpHandle != iPtr)
		|| (codePtr->compileEpoch != iPtr->compileEpoch)
		|| (codePtr->nsPtr != nsPtr)
		|| (codePtr->nsEpoch != nsPtr->resolverEpoch)) {
	    goto doCompilation;
	}
where codePtr->interpHandle == 0.

The call stack is short enough:
  Tcl_EvalObjv()
  TclEvalObjvInternal()
  TclObjInterpProc()
  PushProcCallFrame() *crash*
with 2 objects passed to Tcl_EvalObjv:
- one Tcl_NewStringObj which denotes a routine to call and is reused (I've checked that the refCount == 1 before reusing it)
- one Tcl_NewIntObj() the argument for the routine, fresh on each call

The code in question is repeatedly called many times, so I'm wondering whether I'm looking at memory corruption of some sort or some hideous bug. 

I would be glad if someone could point me at a place where the object in question is changed, especially where the interphandle is possibly intentionally reset to 0.

TNX
R'
anonymousplain2015-09-28 10:57:02
Ok, found the problem in my code unrelated to TCL: classical buffer overrun thrashing the codePtr memory.  Case closed.
TNX
R'
Log in (anonymous is fine) to add a comment.