The famous last words: "Do not worry - my change has not broken anything." How can we be sure of this?
However, there is a moderate chance that you are correct if the code runs under 4.4 and drops to 4.5.
GCC has adopted some aggressive optimizations related to code that tries to detect integer overflow and removes it. In this case, you will need to find this code in ns-2 and try to eliminate it - either by the ns-2 developers, or by yourself.
, , , , , . ( ulimit -c 0 ), , . .
:
, ? ?
, ( , AutoTools), C ++:
./configure --prefix=/opt/ns CC="gcc -Wall -Wextra" CXX="g++ -Wall -Wextra"
( , 32- 64- , -m32 -m64.)
: , . , , . , , , , 50 , , - 1, ( ), , , . , . , - , .
, , - .
, , . , . , , () . , , .
:
#5 0x00000000008d5b5a in strcpy (interp=0xd2dda0, optionIndex=<value optimized out>,
objc=<value optimized out>, objv=0x7fffffffdad0)
at /usr/include/bits/string3.h:105
#6 TraceVariableObjCmd (interp=0xd2dda0, optionIndex=<value optimized out>,
objc=<value optimized out>, objv=0x7fffffffdad0)
at /media/Linux/ns-allinone-2.35-RC7/tcl8.5.8/unix/../generic/tclTrace.c:912
strcpy(). . - , Tcl. , , 900-920 tclTrace.c , , 912. , , .
tcl8.5.8 912 tclTrace.c - strcpy() :
if ((enum traceOptions) optionIndex == TRACE_ADD) {
CombinedTraceVarInfo *ctvarPtr;
ctvarPtr = (CombinedTraceVarInfo *) ckalloc((unsigned)
(sizeof(CombinedTraceVarInfo) + length + 1
- sizeof(ctvarPtr->traceCmdInfo.command)));
ctvarPtr->traceCmdInfo.flags = flags;
if (objv[0] == NULL) {
ctvarPtr->traceCmdInfo.flags |= TCL_TRACE_OLD_STYLE;
}
ctvarPtr->traceCmdInfo.length = length;
flags |= TCL_TRACE_UNSETS | TCL_TRACE_RESULT_OBJECT;
strcpy(ctvarPtr->traceCmdInfo.command, command);
ctvarPtr->traceInfo.traceProc = TraceVarProc;
ctvarPtr->traceInfo.clientData = (ClientData)
&ctvarPtr->traceCmdInfo;
ctvarPtr->traceInfo.flags = flags;
name = Tcl_GetString(objv[3]);
if (TraceVarEx(interp,name,NULL,(VarTrace*)ctvarPtr) != TCL_OK) {
ckfree((char *) ctvarPtr);
return TCL_ERROR;
}
} else {
, GDB ; , strcpy(), .
tcl , ns-2, , (, ) . tcl - trace add varname ... AFAICT.
, , , GCC 4.6 , , ns-2 GCC 4.5.
Valgrind
Linux, Valgrind. . ns-2.