Tcl Source Code

View Ticket
Login
Ticket UUID: c837eb353edd846b9f1b79b95432d65dd63d08cd
Title: 64 bit build of TCL coredumps in AIX
Type: Bug Created on: 2021-03-17 13:55:04
Submitter: Ayappan Assigned to: nobody
Subsystem: 47. Bytecode Compiler Severity: Severe
Priority: 5 Medium Last modified: 2021-03-22 13:12:31
Status: Open Closed by: nobody
Resolution: None Closed on:
Version: 8.6.10
Description:
I built tcl 8.6.10 in 64bit mode in AIX 7.1 with the below configuration.

export CC="cc_r -q64"
export CFLAGS="-g"
export LDFLAGS="-Wl,-blibpath:/usr/opt/tcl_64/lib:/usr/lib:/lib"
export OBJECT_MODE=64

./configure --prefix=/usr/opt/tcl_64 --enable-shared --enable-threads --enable-64bit
gmake -j4

While executing the built tclsh , it coredumps.

# ./tclsh
% ls
Segmentation fault (core dumped)

# dbx ./tclsh core
Type 'help' for help.
[using memory image in core]
reading symbolic information ...

Segmentation fault in unnamed block in TEBCresume at line 2372 in file "/final_tcl_tk_expect/tcl_64bit/tcl8.6.10/generic/tclExecute.c" ($t1)
 2372       inst = *pc;
(dbx) where
unnamed block in TEBCresume(data = 0x00000001100a8e98, interp = 0x000000011002c200, result = 0), line 2372 in "tclExecute.c"
unnamed block in TEBCresume(data = 0x00000001100a8e98, interp = 0x000000011002c200, result = 0), line 2372 in "tclExecute.c"
unnamed block in TEBCresume(data = 0x00000001100a8e98, interp = 0x000000011002c200, result = 0), line 2372 in "tclExecute.c"
unnamed block in TEBCresume(data = 0x00000001100a8e98, interp = 0x000000011002c200, result = 0), line 2372 in "tclExecute.c"
TEBCresume(data = 0x00000001100a8e98, interp = 0x000000011002c200, result = 0), line 2372 in "tclExecute.c"
unnamed block in TclNRRunCallbacks(interp = 0x0ffffffffffff690, result = 0, rootPtr = 0x09001000a116f6f8), line 4492 in "tclBasic.c"
TclNRRunCallbacks(interp = 0x0ffffffffffff690, result = 0, rootPtr = 0x09001000a116f6f8), line 4492 in "tclBasic.c"
Tcl_EvalObjv(interp = 0x09001000a116f6f8, objc = 0, objv = 0x0000000000000001, flags = 0), line 4215 in "tclBasic.c"
ReleaseData(dataPtr = (nil), ??, ??), line 172 in "tclOptimize.c"
Tcl_MainEx(argc = 150994943, argv = (nil), appInitProc = (nil), interp = (nil)), line 520 in "tclMain.c"
main(argc = 0, argv = (nil)), line 84 in "tclAppInit.c"
(dbx)

The "gmake test" also coredumps with the same stack.
User Comments:
Ayappan added on 2021-03-22 13:12:31:
Seems like the peephole optimisation code has some issue when we compile with xlc in 64bit mode in AIX.

I disabled that part of the code , then things started working fine.

--- tclExecute.c_orig   2021-03-22 08:09:52.549422690 -0500
+++ tclExecute.c        2021-03-22 06:39:19.945731992 -0500
@@ -310,7 +310,7 @@
        }                                                       \
     } while (0)
 
-#ifndef TCL_COMPILE_DEBUG
+#if !defined(TCL_COMPILE_DEBUG) && !defined(_AIX)
 #define JUMP_PEEPHOLE_F(condition, pcAdjustment, cleanup) \
     do {                                                               \
        pc += (pcAdjustment);                                           \