problem occur running starpack on Mac when tcl files are compiled

Posted by alex2017 on 2017-03-06 23:28
Forums: TDK discussion | OS: Windows 8

I'm trying to generate a standalone Tcl application using tclapp. The generated runtime works as long as I don't compile the Tcl code.

The error I get when I run the compiled runtime is:

test.tcl: The TclPro ByteCode Loader is not available or does not support the correct version -- dlopen(/var/tmp/tclwNROwK, 6): no suitable image found. Did find:
/var/tmp/tclwNROwK: file too short
while executing
"source $startup"
(file "main.tcl" line 38)

I'm using TDK 5.3 build 295349 (but tclapp reports it is build 295336) and I have reinstalled it and verified the files were updated properly. I have tried several different prefix files all with the same result.

I also tried running tclvfse an received the following error:

can't find package splash
while executing
"# Compiled -- no source code available
error "called a copy of a compiled script""
(procedure "::splash_hook" line 1)
invoked from within
"# Compiled -- no source code available
error "called a copy of a compiled script""
(procedure "go" line 1)
invoked from within
"# Compiled -- no source code available
error "called a copy of a compiled script""
invoked from within
"tbcload::bceval {
TclPro ByteCode 2 0 1.7 8.5
27 0 232 35 0 0 120 0 9 27 31 -1 -1
232
w0E6#2)>6#3,>6#6G:3w<&5p..."
(file "/Applications/ActiveState ActiveTcl/tclvfse.app/Contents/MacOS/tclvfse/main.tcl" line 7)
invoked from within
"source {/Applications/ActiveState ActiveTcl/tclvfse.app/Contents/MacOS/tclvfse/main.tcl}"
("uplevel" body line 1)
invoked from within
"uplevel [list source [file join $self main.tcl]]"

I'm running on Lion 10.7.3 and have run teacup update for the latest versions.

grahams
ActiveState Staff
Wed, 2017-03-08 14:54

The dynamic loader dlopen is reporting that the binary object it is looking for can't be found. While this could be procedural (using TclCompiler8.6 and then wrapping with an 8.5 prefix for example), the following elaboration of the error message indicates that extracted file in tmp no longer matches it's internally reported size. That would throw out the internal pointer maps, and make the library extracted to tmp unusable.

In the tclvfse case, a portion of the Tcl code used for tclvsfe has been removed.

When bytecode is wrapped, additional modules are included in the wrapped file and are written to tmp because they cannot be loaded directly from memory. Your sample file and the tclvfse command that we supply are both examples of files that have wrapped bytecode.

There are only a small number of processes that can alter the size and contents of a file while it's being extracted. Antivirus software is the leading contender.