Faculty of Information Technology
Software Engineering Group

#96 closed defect (fixed)

Restart from snapshot crashes when initial working directory is not directory of stx.exe (Windows only)

Reported by: Jan Vrany Owned by:
Priority: major Milestone:
Component: virtual machine Keywords:
Cc: Also affects CVS HEAD (eXept version): yes

Description

i.e., following works:

stx.exe -i restart.img

whereas

cd ..
smalltalk\stx.exe -i smalltalk\restart.img

crashes, leading in a thundestorm of messages like:

VM [dump object]:43126c38 |  class:437277a8 (** invalid class: 437277a8 name: 2004a290 **)
|  size:48   flags:0x0 ()   space:0x1 (OLD)
|  code: 0x4d0429b
|  inst:1 (Integer: 0)
|  inst:0 (nil)
|  inst:0 (nil)
|  inst:1 (Integer: 0)
|  inst:d9 (Integer: 108)
|  inst:0 (nil)
|  inst:0 (nil)
|  inst:42d00888 (** invalid class: 4372ea60 name: 20016ca0 **)
IMG [warning]: uglobal at 51283f8 (val=43126c68), but not in a class or VM
IMG [info]: savedVMData: 1ffe0000..1ffe3c30; vmData: 1ffe0000..2e248900

The problem is, that before all uglobals are loaded from image, VM must load all compiled class libraries (.dll), In Windows this is done in loadAdditionalClassLibraries() which reads modules.stx. Lookup of that file is broken, therefore the file is not found, libraries not loaded and hence the crash (since not even class Object is loaded).

The solutions seems to be to fix the lookup, which should in first instance look at directory of the executable.

Change History (1)

comment:1 Changed 15 months ago by Jan Vrany

Resolution: fixed
Status: newclosed

Fixed in:

changeset: 08ad2cfe5bc8
branch: jv
user: Jan Vrany <jan.vrany@…>
date: Thu Jun 23 20:23:52 2016 +0100
description:
Issue #96: Look for modules.stx in .exe directory also when restarting from snapshot

...otherwise snapshot will fail to load. Naturally, if modules.stx is not found,
class libraries are not loaded (see loadAdditionalClassLibraries() and hence there's
no code for even the basic classes.

The problem was that upon snapshot restart, the path to .exe was not set up correctly
and thus .dlls were not loaded. This commit eliminates duplicate path to .exe in
init.c and calls __stxExecutableName__() to access .exe path. The latter
is correctly set early in __stxMain__().

This commit fixes issue #96 and also fixes SnapshotRestartTests? on Windows.

Note: See TracTickets for help on using tickets.