Re: segmentation fault in t_splay() calling Tcl_Alloc()
From: Anthony Davis (adavis_at_addpower.com)
Date: 10/07/03
- Next message: Eric Brunel: "Apparent inconsistency for bindings on key events w/ modifiers"
- Previous message: Bryan Oakley: "Re: tk X11 [font actual] bug?"
- In reply to: Ralf Fassel: "Re: segmentation fault in t_splay() calling Tcl_Alloc()"
- Next in thread: Jeff Hobbs: "Re: segmentation fault in t_splay() calling Tcl_Alloc()"
- Reply: Jeff Hobbs: "Re: segmentation fault in t_splay() calling Tcl_Alloc()"
- Reply: Ralf Fassel: "Re: segmentation fault in t_splay() calling Tcl_Alloc()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 7 Oct 2003 08:25:34 -0700
> Does your program call malloc()/free() itself besides Tcl_Alloc()?
> Have you checked the pointers there?
No I do not have any explicit calls to malloc()/free() anywhere in the
application, I use only Tcl_Alloc and Tcl_Free().
The call to Tcl_Alloc is actually being made from within
Tcl_NewStringObj if this makes a difference at all.
Here is the code snippet where the error occurs:
/* the function PVK_read() is a third party function for reading a
* proprietary data file, it returns a char*. szResult is previously
* allocated with Tcl_Alloc the length defined in the file's
dictionary +1
*/
if(PVX_ERROR==(int)(cbBytesRead=PVK_read(pclFilePtr->fh,szResult,
pclFilePtr->pvkinf->rsz,nPvxRdId))){
PclSetObjResultPvxError(interp,"pclread");
return TCL_ERROR;
}
szResult[cbBytesRead+1]='\0';
/* segmentation fault is on this line in Tcl_NewStringObj */
Tcl_SetObjResult(interp,Tcl_NewStringObj(szResult,strlen(szResult)));
Tcl_Free(szResult);
return TCL_OK;
Hope this helps, I would be glad to find out it is something I am
doing wrong if there is anything you can see let me know.
Anthony
- Next message: Eric Brunel: "Apparent inconsistency for bindings on key events w/ modifiers"
- Previous message: Bryan Oakley: "Re: tk X11 [font actual] bug?"
- In reply to: Ralf Fassel: "Re: segmentation fault in t_splay() calling Tcl_Alloc()"
- Next in thread: Jeff Hobbs: "Re: segmentation fault in t_splay() calling Tcl_Alloc()"
- Reply: Jeff Hobbs: "Re: segmentation fault in t_splay() calling Tcl_Alloc()"
- Reply: Ralf Fassel: "Re: segmentation fault in t_splay() calling Tcl_Alloc()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|