Opened 17 years ago

Closed 17 years ago

Last modified 5 years ago

#3250 closed defect (fixed)

All: Module player unstable, with Protracker

Reported by: Kirben Owned by: DrMcCoy
Priority: blocker Component: Audio
Version: Keywords:
Cc: Game: Simon the Sorcerer 1

Description

ScummVM 0.11.0svn (Jun 15 2007 14:20:12) Compiled under mingw with GCC 3.4.5 Running on Windows XP Media Center 2005 Edition English Amiga of Nippon Safes (Multi-Language). English Amiga CD32 of Simon the Sorcerer 1.

The current module player in ScummVM doesn't seem stable,
as I often get random crashes in Amiga versions of games, especially when switching music. The Amiga versions of these games, specifically use Protracker modules.

I thought the issue might be specific to the AOGS engine, when using Amiga versions. But I produced similar crash in Parallaction engine, when trying out the Amiga version of Nippon Safes.

GDB always reports similar heap corruption: Program received signal SIGTRAP, Trace/breakpoint trap. 0x7c901231 in ntdll!DbgUiConnectToDbg () from ntdll.dll (gdb) warning: HEAP[scummvm.exe]: warning: Heap block at 031894C8 modified at 03189B6A past requested size of 698

But doesn't give a useful backtrace, due to the heap corruption.

When I tried the games under ScummVM in Topologilinux, I'm unable to reproduce the crashes and Valgrind doesn't report any issues. I don't have sound support under Topologilinux though, so that could be why.

Ticket imported from: #1737609. Ticket imported from: bugs/3250.

Attachments (1)

bt.txt (10.9 KB ) - added by Kirben 17 years ago.
Full back trace

Download all attachments as: .zip

Change History (9)

comment:1 by fingolfin, 17 years ago

At first I thought that this sounds like it might be a threading issue. At least that would explain the randomness, the fact that it doesn't occur on Linux (different scheduler) and the odd crash/heap corruption.

But then again, at least in the AGOS code it seems as if a ProTracker stream is created via makeProtrackerStream() and then handed to the mixer, after which the AGOS code doesn't "touch" it again. Is that correct? If yes, it *seems* impossible that threading could a play here... Hmm.

Could you provide some more details, like a stack trace? Also, is there any demo or so which I could use to try to reproduce the issue over here, just in case the bug "works" on OS X, too?

by Kirben, 17 years ago

Attachment: bt.txt added

Full back trace

comment:2 by Kirben, 17 years ago

Yes, the AGOS engine simply passes the Protracker stream to the mixer, and stops the current stream, when the music changes.

The Amiga CD32 version of Simon the Sorcerer 1 will play sound effects and speech via mixer, during the music play back. I'm not sure if that could cause any threading issues though.

In the Amiga versions of Simon the Sorcerer 1, the crash point is always when loading a saved game. Loading a saved game triggers a switch of the current music been played, via the playTune script opcode.

I attached a back trace, of a crash that ocured when quick loading saved game in the Amiga CD32 version of Simon the Sorcerer 1. But most of the back trace, is outside of the ScummVM source code.

The following demos uses Protracker modules for the music, and are available on the demos page of the web site: Amiga demo of Elvira 1. Amiga demo of Nippon Safes. Amiga demo of Simon the Sorcerer 1.

The Amiga demos of Elvira 1 and Simon the Sorcerer 1 only use a single music track though, and never change the music currently been played. File Added: bt.txt

comment:3 by fingolfin, 17 years ago

OK, I'll get those demos then.

Hm, I wonder how accurate that stack trace is. It looks as if the crash occured while deleting a mutex (which would indeed be a good cause for a crash). Odd...

comment:4 by fingolfin, 17 years ago

I just commited a fix to a baaad bug in the protracker code (spotted by DrMcCoy), see revision 27764. Maybe that was the cause for this crash?

comment:5 by fingolfin, 17 years ago

Owner: set to DrMcCoy

comment:6 by Kirben, 17 years ago

Yes, that out of bounds issue was the cause, and the crashes no longer occur.

comment:7 by Kirben, 17 years ago

Resolution: fixed
Status: newclosed

comment:8 by digitall, 5 years ago

Component: --Unset--Audio
Game: Simon the Sorcerer 1
Note: See TracTickets for help on using tickets.