Test environment:
Windows XP SP3
Java SE 8u65
Using MINGW/MSYS to build TclBlend and test.
Test Tcl script:
package require java
java::import java.net.InetAddress
puts "My IP Address is: [ [ java::call InetAddress getLocalHost ] getHostAddress ] "
Test in Tcl 8.5.18, the test Tcl script do not crash, and get result
My IP Address is: 192.168.2.105
Test in Tcl 8.6.1, fail in step 3.
(I modifiied tclBlend\src\native\javaInterp.c, for support Tcl 8.6 changed (TIP #330: Eliminate interp->result from the Public Headers).
Below is my change:
if (exception) {
(env)->DeleteLocalRef(env, exception);
(void) Tcl_GetStringResult(interp);
tPtr->errMsg = (char )
ckalloc((unsigned) (strlen(Tcl_GetStringResult(interp)) + 1));
//ckalloc((unsigned) (strlen(interp->result) + 1));
//strcpy(tPtr->errMsg, interp->result);
strcpy(tPtr->errMsg, Tcl_GetStringResult(interp));
result = tPtr->errMsg;
}
And I already apply #22 Compile/Run against Tcl 8.6 patch to TclBlend (Jan Nijtmans patch for Tcl 8.6), but TclBlend still crash at Tcl 8.6.1.
I also test TclBlend 1.4.1 and Tcl 8.6.0, and execute test Tcl script is OK. So Tcl 8.6.0 -> 8.6.1 has something let TclBlend crash.
Update:
Root cause is in Tcl "generic/tclObj.c".
The way to fix it:
Within the function "Tcl_GetCommandFromObj", change
from:
if (SetCmdNameFromAny(interp, objPtr) != TCL_OK) {
return NULL;
}
to:
if (tclCmdNameType.setFromAnyProc(interp, objPtr) != TCL_OK) {
return NULL;
}
Last edit: Danilo Raynor 2016-04-11