Opened 9 years ago

Closed 9 years ago

#6837 closed defect (invalid)

MADS: Rex Nebular Stack Smashing Detected

Reported by: SF/ruehmann Owned by: dreammaster
Priority: normal Component: Engine: MADS
Version: Keywords:
Cc: Game: Rex Nebular

Description

Can´t start Rex Nebular User picked target 'nebular' (gameid 'nebular')... Looking for a plugin supporting this gameid... MADS Engine Starting 'Rex Nebular and the Cosmic Gender Bender' stack smashing detected : scummvm terminated

Kubuntu 14.04 LTS ScummVM 1.8.0git2915-g478fae2 (Apr 3 2015 01:05:37) Features compiled in: TAINTED Vorbis FLAC MP3 ALSA SEQ TiMidity RGB zLib FluidSynth Theora JPEG PNG

Rex Nebular Dos English

Ticket imported from: bugs/6837.

Attachments (3)

md5sum.txt (3.7 KB ) - added by SF/ruehmann 9 years ago.
configure.txt (3.5 KB ) - added by SF/ruehmann 9 years ago.
make.txt (12.0 KB ) - added by SF/ruehmann 9 years ago.

Download all attachments as: .zip

Change History (31)

comment:1 by dreammaster, 9 years ago

Is this something that happens immediately? If so, it may be data corruption in your local game causing it. I tried running the latest codebase through Valgrind (which detects invalid memory writes and corruptions), and the only problem it detected within the engine was a memory leak in the copy protection dialog.

comment:2 by SF/ruehmann, 9 years ago

It happens immediately With DosBox everything works fine.

comment:3 by dreammaster, 9 years ago

Hmmm.. definitely strange, although the fact that it works in DosBox doesn't necessarily mean that there's not some problem with the data that isn't as obvious in DosBox. Some extra details would help. Are you using the GOG release or an original copy. It would also help if you could provide an md5 listing for all the files in your files that I can compare against my own versions.

comment:4 by SF/ruehmann, 9 years ago

I´ve tried the abandonware and the GOG Version, both the same. If you could tell me how to create such an md5 listing I will provide it.

Thanks,

comment:5 by dreammaster, 9 years ago

I'm afraid I'm not familiar with any specific programs in Linux for generating md5 hashes of files, but if you Google for one, it should be easy enough to find out how to do it.

I set up a Ubuntu 14.04 virtual VM and tried running my own version on a fresh build without any errors. So it's best to confirm that you're data files are all correct.

by SF/ruehmann, 9 years ago

Attachment: md5sum.txt added

comment:6 by SF/ruehmann, 9 years ago

Here are the MD5 Hashes of the Data Files in the REX Folder.

Thanks,

comment:7 by bluegr, 9 years ago

I've just tried compiling the latest daily version of ScummVM under Ubuntu (not Kubuntu), and Rex Nebular works fine - no stack smashing.

Today, I've made a commit that plugs some memory leaks... perhaps it's somehow related?

If all else fails, try "make clean" and "make"

comment:8 by dreammaster, 9 years ago

That may help, hopefully. I've verified that your files under Linux match my own copy locally, so there's no issue about them being corrupted. Failing that, I'm not sure if I can suggest anything else.. it works on two laptops I have locally, and Filippos ran it okay as well. I also tried running it with Valgrind, a tool for detecting memory leaks or invalid writes, and I didn't notice any write errors being detected, although there were some memory leaks which hopefully Filippos's commits will have fixed already.

So it may unfortunately be an issue with just your own system. I wonder if there's anyone else running Kubuntu that we can get to try it, and see if it crashes for them as well.

comment:9 by SF/ruehmann, 9 years ago

I´ve tried the new Version

ScummVM 1.8.0git2933-gec03857 (Apr 10 2015 01:05:40) Features compiled in: TAINTED Vorbis FLAC MP3 ALSA SEQ TiMidity RGB zLib FluidSynth Theora JPEG PNG

But still got the same.

WARNING: SDL mixer output buffer size: 2048 differs from desired: 4096! User picked target 'nebular' (gameid 'nebular')... Looking for a plugin supporting this gameid... MADS Engine Starting 'Rex Nebular and the Cosmic Gender Bender' stack smashing detected : scummvm terminated zsh: abort scummvm

Thanks,

What Librarys are used I have some updatet such as libpng and libIrrlicht.

comment:10 by bluegr, 9 years ago

You got some local changes in your version (it's labelled as TAINTED). Try reverting those changes.

Do other games work OK under ScummVM on your system?

comment:11 by SF/ruehmann, 9 years ago

First step I had taken was rm -R -f ~/scummvm git clone https://github.com/scummvm/scummvm.git

The only local change I can think of is wintermute.zip in /usr/local/share/scummvm. I deleted it than make clean, configure --enable-all-engines, make, sudo make install but nothing changes (still tainted)

How do I find out what tainted means?

All other Games work fine (about 80) only Rex Nebular is not working.

Thanks,

comment:12 by digitall, 9 years ago

Summary: Rex Nebular stack smashing detectedMADS: Rex Nebular Stack Smashing Detected

comment:13 by digitall, 9 years ago

@ruehmann: Tainted Build is set by configure if you enable all engines or more specifically if you enable an WIP/Unstable (not set as build by default) engines in your build.

Thus since MADS is currently WIP/Unstable, it will set the TAINTED flag.

comment:14 by digitall, 9 years ago

@ruehmann: Can you try recompiling the crashing build using -f-no-stack-protector and then run under gdb and/or valgrind and try to get a crash and backtrace. See: http://stackoverflow.com/questions/1345670/stack-smashing-detected and http://wiki.scummvm.org/index.php/Debugging_ScummVM#Unix_.28Linux.2C_Solaris.2C_Mac_OS_X.2C_MinGW_....29

comment:15 by SF/ruehmann, 9 years ago

as configure or make parameter?

comment:16 by SF/ruehmann, 9 years ago

gdb scummvm ──(So,Apr12)─┘ GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from scummvm...done. (gdb) run Starting program: /home/ruehmann/scummvm/scummvm [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1". [New Thread 0xb2b18b40 (LWP 20821)] [Thread 0xb2b18b40 (LWP 20821) exited] [New Thread 0xb2b18b40 (LWP 20822)] WARNING: SDL mixer output buffer size: 2048 differs from desired: 4096! [New Thread 0xb21ffb40 (LWP 20823)] User picked target 'nebular' (gameid 'nebular')... Looking for a plugin supporting this gameid... MADS Engine Starting 'Rex Nebular and the Cosmic Gender Bender' stack smashing detected : /home/ruehmann/scummvm/scummvm terminated

Program received signal SIGABRT, Aborted. 0xb7fdd424 in __kernel_vsyscall () (gdb)

comment:17 by digitall, 9 years ago

Sigh. That is of no use as it only shows that the stack protector has been invoked and the backtrace shows the kernel abort syscall.

As that stack overflow article indicates, you need to compile with -f-no-stack-protector in the GCC flags. Examples of this are in our configure script i.e. when Android builds are built as debug.

To be painfully clear, do the following: CXXFLAGS="-f-no-stack-protector" ./configure --disable-all-engines --enable-engines=mads && make clean && make && gdb ./scummvm

When the result crashes with a SEGFAULT (instead of the stack smashing detected), do a "bt" for backtrace at the gdb command line and post the result here.

comment:18 by SF/ruehmann, 9 years ago

sorry but that did not work.

CXXFLAGS="-f-no-stack-protector" ./configure --disable-all-engines --enable-engines=mads && make clean && make && gdb ./scummvm
Running ScummVM configure... Looking for C++ compiler... none found!

by SF/ruehmann, 9 years ago

Attachment: configure.txt added

comment:19 by SF/ruehmann, 9 years ago

here is the configure output of my default run.

By the Way all Freetype2 packets are installed but won´t be found by scummvm. But I think thats another Bug.

thanks,

by SF/ruehmann, 9 years ago

Attachment: make.txt added

comment:20 by SF/ruehmann, 9 years ago

Here is the Output of the make with only MADS

comment:21 by wjp, 9 years ago

The option is -fno-stack-protector.

You may as well do 'bt' in gdb from the crash you get with the stack protector enabled, by the way. It should at least point at the right function.

comment:22 by digitall, 9 years ago

@ruehmann: Mea culpa. As @wjp said, this needs to be as follows: CXXFLAGS="-fno-stack-protector" ./configure --disable-all-engines --enable-engines=mads && make clean && make && gdb ./scummvm

In either case, a "bt" output from gdb is what is required. Also, if you could please not post huge slabs of text. These are better as text files via "Add Attachments" below.

comment:23 by SF/ruehmann, 9 years ago

Now it works Midi Volume is extrmely low (at 100% barely hearable) and voice takes a long time to load, but it runs.

Here is the output of gdb (no chrashes happened.

(gdb) run Starting program: /home/ruehmann/scummvm/scummvm [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1". [New Thread 0xb5176b40 (LWP 21851)] [New Thread 0xb04ccb40 (LWP 21852)] [Thread 0xb04ccb40 (LWP 21852) exited] [New Thread 0xb04ccb40 (LWP 21853)] WARNING: SDL mixer output buffer size: 2048 differs from desired: 4096! [New Thread 0xafaffb40 (LWP 21854)] User picked target 'nebular' (gameid 'nebular')... Looking for a plugin supporting this gameid... MADS Engine Starting 'Rex Nebular and the Cosmic Gender Bender' WARNING: [UnityTaskbarManager::addRecent] Not implemented! WARNING: Read beyond end of loaded sound data! WARNING: Read beyond end of loaded sound data! WARNING: Read beyond end of loaded sound data! [WARNING: Read beyond end of loaded sound data! [Thread 0xb04ccb40 (LWP 21853) exited] [Thread 0xafaffb40 (LWP 21854) exited] [Thread 0xb5176b40 (LWP 21851) exited] [Inferior 1 (process 21850) exited normally]

Thanks

comment:24 by SF/ruehmann, 9 years ago

sorry

I hope it is better this Way.

comment:25 by SF/ruehmann, 9 years ago

where are the Engine Options Gone? Ingame Menus don´t work, can´t save or load. the game starts directly in the Game not the Main Menu anymore.

Is rhere a way to make at least the Main Menu work?

Thanks,

comment:26 by SF/ruehmann, 9 years ago

I am so dumb (look at the Version). Newly cloning configuring (with -fno-stack-protector) and make has make it work again. the only problem that is not dissapeared is the extremely low Volume for the Music. Thanks,

comment:27 by dreammaster, 9 years ago

Okay then, I'm going to mark this bug as closed. I'm not entirely happy with your mention about having to compile with '-fno-stack-protector'.. I'd normally be a bit wary of simply closing the problem in such a case, but since we can't replicate any problem on other systems, I've decided it's fine to close it. We can always re-open the bug if others also experience it.

As for the music, I'd suggest creating a separate bug for it. Unfortunately, the sound code I wrote for sound effects/music playback is essentially a re-implementation of the original's raw port access, so I'm not sure if there's something in the code that's causing the volume problem or not. All I can say is that I don't notice any major problems with the volume under Windows.

comment:28 by dreammaster, 9 years ago

Owner: set to dreammaster
Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.