The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: An_dz on September 27, 2010, 06:59:36 PM

Title: [Bug - RESOLVED] r3825 Win7 pak96.comic - Game crash every starting month
Post by: An_dz on September 27, 2010, 06:59:36 PM
My Simutrans have a really strange bug, it crash for nothing. It happen with last stable version and also with Nightly 3825.

The bug happens at anytime, even doing nothing. The last time it occurred when I was just watching my train and it crashed, I didn't clicked anything. And happens with any pakset.

I'm uploading an edited log file with only the last few lines.
Title: Re: [Bug] r3825 Win7 pak96.comic - Random strange bug
Post by: Dwachs on September 29, 2010, 05:30:11 AM
Looks like the crash reported here:

http://forum.simutrans.com/index.php?topic=5844.0

Can you confirm that your crash happens at the beginning of a new month? The log file seems to indicate that.

Edit: Do you have the possibility to compile the program youselfes and run it inside a debugger (for instance MS Visual Studio) ?
Title: Re: [Bug] r3825 Win7 pak96.comic - Random strange bug
Post by: prissi on September 29, 2010, 07:40:05 PM
This sounds like paks with illegal definitions out there, like stations with three rotations and some else. There was also a problem with headquarter updates in the stable version, which caused such crashes.

Could you play a game with autosave and post the last save before crash?
Title: Re: [Bug] r3825 Win7 pak96.comic - Random strange bug
Post by: An_dz on September 29, 2010, 09:19:43 PM
@Dwachs
Confirmed, happens always at day 1 between 3:00 and 7:00.

@Prissi
Are you sure? I tested in pak96.comic(1.4.7), pak128(1.4.6) and pak64(nightly 321) and also tested again with Simutrans version 3036 GDI and SDL. But it can be, cause I tried doing anything, only created a world and let it run a full month, and no bug.

I uploaded a save from pak96.comic, it saved seconds before the bug. LINK (http://simutrans-germany.com/files/upload/autosave07.sve)

EDIT:Dwachs what I can do for you. I compiled Simutrans at Visual Studio, what informations you need?
Title: Re: [Bug] r3825 Win7 pak96.comic - Random strange bug
Post by: Dwachs on October 13, 2010, 12:08:27 PM
Just run simutrans from inside Visual Studio (press F5) and then report about crash (Visual Studio should inform you if something strange happens).

To execute simutrans inside Visual Studio, you have to put all simutrans data in the folder, where Visual Studio creates the .exe file.
Title: Re: [Bug] r3825 Win7 pak96.comic - Random strange bug
Post by: An_dz on October 13, 2010, 05:57:45 PM
OK Dwachs I did wat you told with Nightly 3862. I got this error:
Quote
Unhandled exception at 0x102e14cf (msvcr100d.dll) in Simutrans.exe: 0xC0000005: Access violation reading location 0xcccccccd.

Also output.c file was opened showing an arrow pointing to:

while (i-- && *p)
    ++p;
textlen = (int)(p - text.sz);    /* length of the string */


Call Stack tab shows an arrow pointing to:
Quote
>   msvcr100d.dll!_output_l(_iobuf * stream, const char * format, localeinfo_struct * plocinfo, char * argptr)  Line 1643 + 0x1f bytes   C++

I also found something special, when creating a new game with English language selected, the bug do not appear, but if I create a new world in Portuguese the error appears. I think that's how you can try reproducing the bug.
Title: Re: [Bug] r3825 Win7 pak96.comic - Random strange bug
Post by: Dwachs on October 13, 2010, 06:13:54 PM
Could you post a scrennshot of the whole call stack tab? (showing all routines that were called before output was called)

output.c is not part of simutrans ???
Title: Re: [Bug] r3825 Win7 pak96.comic - Random strange bug
Post by: prissi on October 13, 2010, 06:37:23 PM
This sounds like a problem with the translation of an ingame message. Like %s instead of %i for translation string.
Title: Re: [Bug] r3825 Win7 pak96.comic - Random strange bug
Post by: An_dz on October 13, 2010, 06:50:25 PM
Here's the screen you asked:

(http://img121.imageshack.us/img121/4152/simutransbugcallstack.th.png) (http://img121.imageshack.us/img121/4152/simutransbugcallstack.png)

And also forgot to say to reproduce bug an vehicle is needed, my tests was with a train just going from one station to another.

@Prissi
I'll take a look in Portuguese language to check.
But I started a game in English and then changed to Portuguese and bug didn't appeared, but it was probably a coincidence.
Title: Re: [Bug] r3825 Win7 pak96.comic - Random strange bug
Post by: Dwachs on October 13, 2010, 07:03:32 PM
Then maybe one of the speed-record messages is wrong in the Portuguese translation?

Edit: I looked up in translator: Both Portuguese translations of record_text in pak96.comic (not in the base texts) are wrong! There the order of %.1f and %s is switched. You have to modify these messages such that the order of these meta-strings is preserved (ie first %.1f, second %s).
Title: Re: [Bug] r3825 Win7 pak96.comic - Random strange bug
Post by: An_dz on October 13, 2010, 07:14:13 PM
I checked here and look like all are OK. But %s is before %.1f:
Quote
New world record for monorails: %.1f km/h by %s.
Novo recorde mundial para monotrilhos: %s com %.1f km/h.
Do it influence in something?

EDIT:
WOW, Thanks prissi and Dwachs it was that. The %s before %.1f was giving the bug. Thanks!
Also Changed the topic title to be more intuitive.
It was my translation file that was incorrect, in Simutranslator they are OK.
It was cause I translated whole Simutrans by myself taking reference a really old version. And I didn't translated this part yet.
Title: Re: [Bug - RESOLVED] r3825 Win7 pak96.comic - Game crash every starting month
Post by: Dwachs on October 13, 2010, 07:57:14 PM
Quote from: An_dz on October 13, 2010, 07:14:13 PM
EDIT:
WOW, Thanks prissi and Dwachs it was that. The %s before %.1f was giving the bug. Thanks!
Without the information you provided, this would not have been possible ;)
Quote
It was my translation file that was incorrect, in Simutranslator they are OK.
It was cause I translated whole Simutrans by myself taking reference a really old version. And I didn't translated this part yet.
On simutranslator, some of these strings are also part of the pak96.comic translation. There the same error appears in the Portuguese translation. Maybe you can correct them as well? The translations in the base texts are fine.
Title: Re: [Bug - RESOLVED] r3825 Win7 pak96.comic - Game crash every starting month
Post by: An_dz on October 13, 2010, 08:51:56 PM
I did it, probably you looked just before I updated it.
Title: Re: [Bug - RESOLVED] r3825 Win7 pak96.comic - Game crash every starting month
Post by: Dwachs on October 13, 2010, 09:02:19 PM
Thank you :)
Title: Re: [Bug - RESOLVED] r3825 Win7 pak96.comic - Game crash every starting month
Post by: ispero on October 14, 2010, 08:57:02 AM
I read this topic and I find the same bug in the es.tab of the spanish translation.
Is correct this new version of the record_text:

SMS-RADIO\nULTIMA HORA:%.1f ha alcanzado los \n%s km/h\n.\n¡Es un record sensacional!

SIMUTRANS-TV\nNOVEDADES:\n%.1f alcanzó los %s km/h\n.\n¡Esto supone un nuevo record!

I change this in the simutranslator and this afternoon check in my computer if the bugs not appear.

EDIT:

With this changes yhe game run perfectly.

Thanks to all support and development team. You make a great job.