ENIGMA Forums

General fluff => Announcements => Topic started by: Josh @ Dreamland on June 17, 2010, 01:05:13 am

Title: Battling
Post by: Josh @ Dreamland on June 17, 2010, 01:05:13 am
Ism reports a segfault when she runs Catch the Clown with what's uploaded of the new instance system, as does freezway. I can't reproduce this on any machine at my disposal. The new instance system is mostly done, but does not yet implement a (working) instance_destroy(). It just prints an error to the console at the moment. It is not difficult to implement, but I want to hear that people can compile Catch the Clown first.

I don't understand the problem. I checked out everything for the first time on a new Win7 machine. Downloaded RapidSVN, checked out, installed MinGW, ran. I had to edit six lines to get it to compile on Windows; after that, no segfault. No negative repercussions.

If anyone could provide useful insight into the segfault, that'd be useful. Current effective revision is 265. Catch the Clown is available from Ism's topic, ultimately from this link on her website: http://www.ismavatar.com/Catch_the_Clown.gmk (http://www.ismavatar.com/Catch_the_Clown.gmk).

Windows users can get MinGW here: http://sourceforge.net/downloads/mingw/Automated%20MinGW%20Installer/MinGW%205.1.6/MinGW-5.1.6.exe/
RapidSVN here: http://www.rapidsvn.org/download/release/0.12/RapidSVN-0.12.0-8051.exe
From RapidSVN, go to Repository->Check out. URL is https://enigma-dev.svn.sourceforge.net/svnroot/enigma-dev/trunk (https://enigma-dev.svn.sourceforge.net/svnroot/enigma-dev/trunk). Pick a directory yourself.
For the MinGW installer, select G++ Compiler and MinGW Make as well. ENIGMA needs both.
Run CMD and move to the folder containing ENIGMA. Execute `mingw32-make.exe -C CompilerSource windows`. You will need to identify where mingw32-make.exe is. It's probably `C:\MinGW\bin\mingw32-make.exe -C CompilerSource windows` for you. Windows is odd. If make errors towards the end, rename compileEGMf.exe to compileEGMf.dll yourself.

From Linux, install the following with your favorite package manager:
g++
libgl1-mesa-dev (or similar)
zlib1g-dev (tab complete is your friend)
subversion
sun-java6-jre (Or Java in general, but I -strongly- recommend this one)
Then run this:
svn co https://enigma-dev.svn.sourceforge.net/svnroot/enigma-dev/trunk enigma-test
cd enigma-test
make -C CompilerSource linux
java -jar lgm16b4.jar


In either case, when LGM loads with the ENIGMA background, load the GMK you got from http://www.ismavatar.com/Catch_the_Clown.gmk and try to compile and run it. If the game seems to compile but closes immediately on run, it probably segfaulted (Linux users, the OS will tell you if this happened). In that case... Well, just tell me it did along with your architecture and operating system and I will try to come close to it. I will be testing on my other machines. I hope I can reproduce the problem, or that perhaps the problem was magically resolved by some minor change in the meantime.

Too tired to proofread or bother further right now. Think I'll just bed.
Title: Re: Battling
Post by: MrJackSparrow2 on June 17, 2010, 01:51:41 am
Runs fine for me. :)
Title: Re: Battling
Post by: The 11th plague of Egypt on June 17, 2010, 03:54:20 am
Gets stuck on my Win7 32bits. I get a Windows error as soon as the Enigma Shell pops out.
Here's a quick translation of the error.

game.exe stopped working, what do you want to do?
Search a solution online and close the program
Close the program

Edit: Os
Title: Re: Battling
Post by: Josh @ Dreamland on June 17, 2010, 09:43:58 am
It almost seems that the problem is with 32bit systems... and with Freezway's 64bit arch. <_<" Love me some consistent data. Let me run some diagnostics...

Plague:
Yep, that's Microsoft's way of dealing with a segfault, I'd forgotten.
Title: Re: Battling
Post by: Rusky on June 17, 2010, 10:16:15 am
On WinXP 32 bit it works perfectly fine for me.

However, I get "warning: -fPIC ignored for target (all code is position independent)" on every file. Was there a reason for -fPIC (and that your makefile doesn't use implicit/pattern rules)?

And move/mv commands in the target rules... why not just build those files directly?
Title: Re: Battling
Post by: Josh @ Dreamland on June 17, 2010, 10:30:09 am
I was trying to allow for a separate target ("link") to take care of everything, then just rename the file to Dll on windows or so on Linux. That's the only part that's different (It looked much better on paper than in code).

Anyway, I found the problem, I believe; these things tend to be much easier to find when you actually experience them. So the segfault on random platforms and architectures should be resolved, as of the just-committed r266. Hopefully that's the end of our trouble; I'll proceed for now.

I'm happy to report that the new instance system is, as I'd hoped, faster. than. all. fucking. greased. lightning.
Holy. Hell.

I can safely say that this is the best idea I've had all year. Pics and code will follow.
Title: Re: Battling
Post by: The 11th plague of Egypt on June 17, 2010, 11:56:33 am
The clown goes way too fast now. And I mean, really.
Title: Re: Battling
Post by: Josh @ Dreamland on June 17, 2010, 04:21:57 pm
Sorry. Forgot to install new FPS limiter. So you're probably getting some ridiculous framerate.
Title: Re: Battling
Post by: freezway on June 17, 2010, 06:44:58 pm
yeah.... i got it work... terminal outputed a lot of mem addresses, but game ran fine (and hellla fast)
Title: Re: Battling
Post by: MrJackSparrow2 on June 18, 2010, 02:43:56 am
Windows 7, 32 bit. Works fine. (Very fast too)

The constant fps does not work, and setting the room speed does NOT change anything.
Title: Re: Battling
Post by: luiscubal on June 18, 2010, 08:11:00 am
Can't Ism compile in debug mode and then use gdb so she can tell you exactly where is ENIGMA segfaulting?
Title: Re: Battling
Post by: Josh @ Dreamland on June 18, 2010, 12:29:38 pm
Luis:
Nope, I don't think she can. Haha. Besides, it would have been more difficult to find than that, it seems.

MrJackSparrow2:
Indeed. When I had the compiler generate the segment of code responsible for event iteration, I omitted the function call that handles FPS calculation. That will be fixed after the implementation of var4 and further segfault testing today.
Title: Re: Battling
Post by: IsmAvatar on June 18, 2010, 01:14:48 pm
Quote
Can't Ism compile in debug mode and then use gdb so she can tell you exactly where is ENIGMA segfaulting?
I wouldn't know how to do that. For starters, I've never used GDB, and secondly, I'm not sure how I'd use it on a DLL.

Quote
I omitted the function call that handles FPS calculation.
That explains a few things.
Title: Re: Battling
Post by: Josh @ Dreamland on June 18, 2010, 01:23:27 pm
Yeah, it works fine for me due to hardware sync. But...
Title: Re: Battling
Post by: luiscubal on June 19, 2010, 09:05:55 am
Not sure how to deal with DLLs, but usually I'd compile my source code with option '-g', then call "gdb executablename", then use command "run" and then, after it crashed, "backtrace".
Title: Re: Battling
Post by: Rusky on June 19, 2010, 10:47:20 am
The problem is getting gdb to load the dll's symbols. I'm pretty sure it doesn't do that with dynamically loaded dlls.
Title: Re: Battling
Post by: Josh @ Dreamland on June 19, 2010, 01:29:43 pm
It will so long as the calling process has them as well. Problem is, Java explodes when groped by GDB. Even if what's called is perfectly healthy.
Title: Re: Battling
Post by: IsmAvatar on June 19, 2010, 06:00:36 pm
I think you should have the code for both EXE and DLL in there, so people could use Enigma from the command line on, e.g., an enigma file (enigma's alternative to gm6/gmk) which can then compile it. That way you can also do debugging with gdb.
Title: Re: Battling
Post by: Josh @ Dreamland on June 19, 2010, 08:01:37 pm
That may be a good idea. But we've not devised such a format. I'll wait until your versioning branch is the trunk.
Title: Re: Battling
Post by: kkg on June 20, 2010, 02:34:21 am
Ran fine on:
Ubuntu 10.04 LTS
Windows 7 Professional 64 Bit

No errors, no warnings, just hot steaming sex.