Loading a .tcl file results in 'Bad exe format.' message

46 views
Skip to first unread message

Helmut Giese

unread,
Jun 6, 2022, 3:18:00 PMJun 6
to
Hello out there,
for a while I have been receiving error messages like the above. I was
able to reduce the scenario to a tiny package which lead to this
result:
:\>tclsh
% package require XYZ
couldn't load library
"D:/devtools/Tcl8.6.10(64)/lib/AddonsX/XYZ/xyz.tcl": Bad exe format.
Possibly a 32/64-bit mismatch.
%
I blieve this error merits a ticket - however I have completetly
forgotten where and how this is done.
If someone could refresh my memory this would be helpful. Thanks
Helmut

Christian Gollwitzer

unread,
Jun 6, 2022, 4:35:49 PMJun 6
to
Am 06.06.22 um 21:17 schrieb Helmut Giese:
> Hello out there,
> for a while I have been receiving error messages like the above. I was
> able to reduce the scenario to a tiny package which lead to this
> result:
> :\>tclsh
> % package require XYZ
> couldn't load library
> "D:/devtools/Tcl8.6.10(64)/lib/AddonsX/XYZ/xyz.tcl": Bad exe format.
> Possibly a 32/64-bit mismatch.
> %

Are you sure that it says "xyz.tcl" and not "xyz.dll"? If the former, it
is an error in the package - if you try to do "load xyz.tcl" this must
fail. If, however, it does "load xyz.dll", then the most likely reason
is the one given in the message - you are running a 32 bit tclsh and try
to load a 64 bit extension or vice versa. There are other possibilities,
but they are less likely (like trying to load a Linux package under
Windows etc.)

Christian

Siri Cruise

unread,
Jun 6, 2022, 4:48:41 PMJun 6
to
In article <t7lof1$oqq$1...@dont-email.me>,
Christian Gollwitzer <auri...@gmx.de> wrote:

> > "D:/devtools/Tcl8.6.10(64)/lib/AddonsX/XYZ/xyz.tcl": Bad exe format.
> > Possibly a 32/64-bit mismatch.
> > %
>
> Are you sure that it says "xyz.tcl" and not "xyz.dll"? If the former, it
> is an error in the package - if you try to do "load xyz.tcl" this must
> fail. If, however, it does "load xyz.dll", then the most likely reason
> is the one given in the message - you are running a 32 bit tclsh and try
> to load a 64 bit extension or vice versa. There are other possibilities,
> but they are less likely (like trying to load a Linux package under
> Windows etc.)

It's unlikely a unix path would begin with 'D:'.

--
:-<> Siri Seal of Disavowal #000-001. Disavowed. Denied. Deleted. @
'I desire mercy, not sacrifice.' /|\
Discordia: not just a religion but also a parody. This post / \
I am an Andrea Chen sockpuppet. insults Islam. Mohammed

Robert Heller

unread,
Jun 6, 2022, 5:43:14 PMJun 6
to
What is package XYZ? Is there a .dll file associated with it? Was that dll
file compiled for 64 bit or 32 bit? I presume the tclsh executable is 64 bit.
If the dll for package XYZ was compiled for 32-bit, this is a legit error
message. I would look in xyz.tcl -- does it contain a line like:

load [file join $dir xyz[info sharedlibextension]]

???

MS-Windows considers dlls as "exe" files, so a baddly formed dll (such as one
for the arch.) will result in a "Bad exe format" error message (even though
that might seem strange and misleading
).
--
Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
hel...@deepsoft.com -- Webhosting Services

Christian Gollwitzer

unread,
Jun 7, 2022, 4:47:45 AMJun 7
to
Am 06.06.22 um 20:17 schrieb Helmut Giese:
> Hello out there,
> for a while I have been receiving error messages like the above. I was
> able to reduce the scenario to a tiny package which lead to this
> result:
> :\>tclsh
> % package require XYZ
> couldn't load library
> "D:/devtools/Tcl8.6.10(64)/lib/AddonsX/XYZ/xyz.tcl": Bad exe format.
> Possibly a 32/64-bit mismatch.

Re-reading your question it seems to me that you made this "xyz" package
yourself - correct? Maybe you are looking for the command "source" which
runs a Tcl script instead of the command "load" which loads a binary
extension (C compiled code)? If that is correct, it would have been
helpful to post the contents of this XYZ package so that we could see
what you are doing.

As to your question, the bug tracker for Tcl is on fossil:

https://core.tcl-lang.org/index.html

Go to the corresponding project, i.e. Tcl, and then select "Tickets" in
the nav bar at the top.

Christian

Helmut Giese

unread,
Jun 7, 2022, 12:12:11 PMJun 7
to
Arrgh,
what a blunder. I was attempting to install a package via "copy 'n
paste" but evidently didn't pay attention and started from a pkgIndex
file which 'loaded' a dll - instead of one that 'sourced' a Tcl file.
Thanks a lot for spotting it - and sorry for the noise.
Helmut
Reply all
Reply to author
Forward
0 new messages