Short: dev.20x dies with invalid pop_n_elems
Date: Tue, 06 Jun 2000 21:37:15 +0200
From: Kees Leune <C.J.Leune@kub.nl>
Type: Bug
State: Done - fixed in 3.2.8-dev.213
The bug shows up when the following snippet is executed:
mixed fname, rc;
fname = "players/quantos/plateau/junk2";
rc = catch(fname->__foo()) ? 0 : find_object(fname);
The .../junk2 file doesn't exist, and the crash occurs in branch of the
F_CATCH which recovers from the runtime error.
The error occurs ONLY if interpret.c is compiled with optimization and
inlining activated. It seems that the optimizer looses track which
registers are valid and which invalid. The solution is to put the
catch() handling into a separate, non-inlineable function.
Maybe it is a good idea to add a remark to a documentation file
somewhere; the platform (Hyperborea) is:
- Machine: Sun SparcStation4
- Operating System: Linux 2.2.15
- Distribution: RedHat Linux 6.2 for Sparc
- C-compiler: egcs-2.91.66
The typical bug symptoms are as follows:
-------------------------------------------------------------------------
debug.log:
2000.06.06 14:08:59 Caught error: Failed to load file
'players/quantos/plateau/junk2'.
' move' in ' room/room.c'
('players/quantos/plateau/wplat')line 249
' move_player' in ' obj/living.c' (' obj/player#692')line
767
' binhook' in ' obj/living.c' (' obj/player#692')line
632
' main' in 'bincmds/player/look.c' ('
bincmds/player/look')line 19
' display_env' in 'bincmds/player/look.c' ('
bincmds/player/look')line 159
' map' in ' obj/map.c' (' obj/map')line
179
' writeMap' in ' obj/map.c' (' obj/map')line
627
'getRoomWithExit' in ' obj/map.c' (' obj/map')line
354
' CATCH' in ' obj/map.c' (' obj/map')line
354
2000.06.06 14:08:59 ... execution continues.
2000.06.06 14:08:59 pop_n_elems: -96661 elements.
2000.06.06 14:08:59 Current object was obj/map
2000.06.06 14:08:59 Dump of the call chain:
' move' in ' room/room.c'
('players/quantos/plateau/wplat')line 249
' move_player' in ' obj/living.c' (' obj/player#692')line
767
' binhook' in ' obj/living.c' (' obj/player#692')line
632
' main' in 'bincmds/player/look.c' ('
bincmds/player/look')line 19
' display_env' in 'bincmds/player/look.c' ('
bincmds/player/look')line 159
' map' in ' obj/map.c' (' obj/map')line
179
' writeMap' in ' obj/map.c' (' obj/map')line
627
'getRoomWithExit' in ' obj/map.c' (' obj/map')line
354
' CATCH' in ' obj/map.c' (' obj/map')line
354
stdout.log
2000.06.06 14:08:59 Caught error: Failed to load file
'players/quantos/plateau/junk2'.
' move' in ' room/room.c'
('players/quantos/plateau/wplat')line 249
' move_player' in ' obj/living.c' (' obj/player#692')line
767
' binhook' in ' obj/living.c' (' obj/player#692')line
632
' main' in 'bincmds/player/look.c' ('
bincmds/player/look')line 19
' display_env' in 'bincmds/player/look.c' ('
bincmds/player/look')line 159
' map' in ' obj/map.c' (' obj/map')line
179
' writeMap' in ' obj/map.c' (' obj/map')line
627
'getRoomWithExit' in ' obj/map.c' (' obj/map')line
354
' CATCH' in ' obj/map.c' (' obj/map')line
354
2000.06.06 14:08:59 ... execution continues.
obj/map obj/map.c line 725
' move' in ' room/room.c'
('players/quantos/plateau/wplat')line 249
' move_player' in ' obj/living.c' (' obj/player#692')line
767
' binhook' in ' obj/living.c' (' obj/player#692')line
632
' main' in 'bincmds/player/look.c' ('
bincmds/player/look')line 19
' display_env' in 'bincmds/player/look.c' ('
bincmds/player/look')line 159
' map' in ' obj/map.c' (' obj/map')line
179
' writeMap' in ' obj/map.c' (' obj/map')line
627
'getRoomWithExit' in ' obj/map.c' (' obj/map')line
354
' CATCH' in ' obj/map.c' (' obj/map')line
354
stderr.log
2000.06.06 14:08:59 Could not load descr for
'players/quantos/plateau/junk2'
2000.06.06 14:08:59 pop_n_elems: -96661 elements.
2000.06.06 14:08:59 Current object was obj/map
2000.06.06 14:09:00 [erq] read: EOF
2000.06.06 14:09:00 [erq] Read 0, should be 9!
2000.06.06 14:09:00 [erq] Giving up.
2000.06.06 14:09:00 [erq] read: EOF
2000.06.06 14:09:00 [erq] read 0, should be 9!
2000.06.06 14:09:00 [erq] Subserver giving up.
-------------------------------------------------------------------------