Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#2644 closed defect (fixed)

AGOS: Itemheap overflow on 64bit systems

Reported by: lordhoto Owned by: eriktorbjorn
Priority: normal Component: Engine: AGOS
Keywords: Cc:
Game: Simon the Sorcerer 1

Description

I always get 'Itemheap overflow!' when I'm trying to
start Simon 1. Using German Talkie (DOS) version on
linux/amd64.

Md5sums:
tbllist.: d198a80de2c59e4a0cd24b98814849e8
simon.gme: 7db9912acac4f1d965a64bdcfc370ba1
stripped.txt: 40d68bec54042ef930f084ad9a4342a1
icon.dat: 22107c24dfb31b66ac503c28a6e20b19
gamepc: 48b1f3499e2e0d731047f4d481ff7817
tbllist: d198a80de2c59e4a0cd24b98814849e8
gamepc.: 48b1f3499e2e0d731047f4d481ff7817

Ticket imported from: #1498158. Ticket imported from: bugs/2644.

Attachments (1)

itemsheap.diff (2.0 KB ) - added by eriktorbjorn 13 years ago.
Patch against current SVN

Download all attachments as: .zip

Change History (15)

comment:1 by lordhoto, 13 years ago

Ok I just checked on WinXP running on x86, it works, so I
guess it's an amd64 specific issue.

comment:2 by eriktorbjorn, 13 years ago

Looks like the size of the item heap is constant, but at
least one part of what we allocate on it are pointers, so I
guess it would need more space on 64-bit architectures.

Also the pointers returned from it seem to be aligned on
4-byte boundaries, which I guess could be a problem as well.

The tables heap may have similar problems; I haven't checked.

comment:3 by Kirben, 13 years ago

The problem also effects the Feeble Files, see closed bug
#1507514.

comment:4 by Kirben, 13 years ago

Summary: SIMON1: German/Talkie/DOS doesn't startSIMON: Itemheap overflow on 64bit systems

comment:5 by lordhoto, 13 years ago

Strangly Simon2 starts up without any problems though.
Anyway I guess just increasing the size should fix this?

comment:6 by eriktorbjorn, 13 years ago

I guess increasing the size would work. From what I
understand, the "item heap" is just a 10,000 byte array, and
allocateItem() works pretty much like malloc(). (Or
calloc(), sinze memory is filled with zeroes.)

Though by how much it should be increased is anyone's guess.
Another way would be to simply dump the current approach and
replace _itemHeap with an array of pointers. (I'm attaching
a patch to demonstrate what I mean. It's not well tested.)

But then we should probably do the same thing with the
tables heap, and I'm not as sure how that one works...

by eriktorbjorn, 13 years ago

Attachment: itemsheap.diff added

Patch against current SVN

comment:7 by SF/pwigren, 13 years ago

I had that same problem on AMD64 Linux. Torbjörn's patch
fixed it for me, now both Simon the Sorcerer and The Feeble
Files work! I used it on svn trunk from 2006-07-02.

comment:8 by SF/khalek, 13 years ago

This fixes the problem for me on OpenBSD/amd64. I went to
test on OpenBSD/sparc64 and discovered that
simon1win/simon2win segfault with the libc calls in the
trace being toupper. I'll build a debug build later to see
what is causing that. SCUMM games seem perfectly fine on
sparc64 though.

comment:9 by fingolfin, 13 years ago

What is the status of this item?

comment:10 by fingolfin, 13 years ago

Based on previous comments made on this tracker item, it appears the original
issue was fixed.

@khalek: If the new problem on sparc64 is reproducible, please open a separate
bug report (or if you can, just fix 'em directly *g*).

comment:11 by fingolfin, 13 years ago

Owner: changed from Kirben to eriktorbjorn
Resolution: fixed
Status: newclosed

comment:12 by Kirben, 13 years ago

Component: Engine: AGIEngine: AGOS
Game: Space Quest 1Simon the Sorcerer 1

comment:13 by Kirben, 12 years ago

This problem has been reported for Elvira 1/2 too, recently in forums too. So adding eriktorbjorn's patch to solve this problem, as it covers all AGOS engine games, and makes much more efficient use of memory for items.

comment:14 by Kirben, 12 years ago

Summary: SIMON: Itemheap overflow on 64bit systemsAGOS: Itemheap overflow on 64bit systems
Note: See TracTickets for help on using tickets.