FIFE forums

Please login or register.

Login with username, password and session length
Advanced search  

News:

FIFE 0.4.0 has been released on 15th of January, 2017!

Author Topic: Editor crashes  (Read 3885 times)

Auree

  • Newbie
  • Posts: 3
    • View Profile
Editor crashes
« on: August 17, 2010, 06:40:20 am »

Moin :)

As some of you know I experience some problems with FIFE map editor. It crashes. So I'm creating this topic to provide you with all information about the problem that I have. Because I really want this to be fixed :)

What exactly happens when I run the editor: it starts successfully. But then even the slightest mouse movement may lead to a crash. Or a mouse click. Sometimes (very rarely) it doesn't crash at once and I can open a map and edit it. But eventually it crashes at a random moment.
I don't have this problem with the demos. None of them crashed so far.

I'm running Ubuntu 10.04, 32bit, with Python 2.6.5.

Here's the gdb output (although I know you don't find it very helpful):
Code: [Select]
(gdb) run run.py
Starting program: /usr/bin/python run.py
[Thread debugging using libthread_db enabled]
Using the FIFE python module found here:  ../../engine/python/fife
Controller: log: Engine initialize start
Controller: log: Engine settings validated
[New Thread 0xb6f70b70 (LWP 2490)]
Controller: log: Creating event manager
Controller: log: Creating pools
Controller: log: Creating render backend
Controller: log: OpenGL Render backend created
Controller: log: Initializing render backend
Controller: log: Creating main screen
Controller: log: Main screen created
Controller: log: Constructing GUI manager
Controller: log: Events bind to GUI manager
Controller: log: Creating default font
Controller: log: Initializing GUI manager
Controller: log: GUI manager initialized
Controller: log: Creating sound manager
Controller: log: Creating renderers
Controller: log: Creating model
Controller: log: Adding pathers to model
Controller: log: Adding grid prototypes to model
Controller: log: Engine intialized
Importing plugin: LayerTool
Importing plugin: HistoryManager
Importing plugin: CameraEdit
Importing plugin: ObjectSelector
Importing plugin: ObjectEdit

Program received signal SIGSEGV, Segmentation fault.
0x0038d9f2 in ?? () from /lib/tls/i686/cmov/libc.so.6
(gdb) bt
#0  0x0038d9f2 in ?? () from /lib/tls/i686/cmov/libc.so.6
#1  0x0038fafd in ?? () from /lib/tls/i686/cmov/libc.so.6
#2  0x00391f9c in malloc () from /lib/tls/i686/cmov/libc.so.6
#3  0x02b39a02 in ?? () from /usr/lib/dri/fglrx_dri.so
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Yesterday I spent the entire evening trying to find the revision that broke the editor for me. And I found it. It's (drumroll) revision #3310. I'm surprised, 'cause according to the log only the shooter demo was changed in this revision. But facts are facts: if I compile FIFE rev#3309 the editor doesn't crash. If I compile #3310 or a newer revision - it crashes.

Please let me know if there's anything else I can do to help you locate and fix the problem.
Logged

chewie

  • Developer
  • Full Member
  • *
  • Posts: 123
    • View Profile
    • zero-projekt.net
Re: Editor crashes
« Reply #1 on: August 17, 2010, 08:46:13 am »

Thanks for the investigation Auree :)

The suspicious revision not only has changes regarding the shooter demo but also modified an important core module: fife_timer

http://fife.trac.cvsdude.com/engine/browser/trunk/engine/python/fife/extensions/fife_timer.py?rev=3310

Pychan uses timers all over the place for the event management (see events.py in extensions/pychan/ ), and my guess was / is that something goes very wrong here.
FIFedit makes heavy use of pychan and especially events. So it is more then likely
to me, that we have to fix the timer module.

I experience the same segfaults you do, sometimes up to 5-6 in a row. If the editor does not crash, I hit the "save map" button ...  nearly every second  :/
(Ubuntu 9.10, 32bit, Python 2.6.4, SWIG Version 1.3.36)

cheers,
chewie

Update:
Auree and I installed a self.thisown = 0 in fife_timers.py/Timer.__init__ which seems to solve our segfault-problem for now.

This is by no means a solution, but looking over FIFE::TimeManager and FIFE:TimeEvent we found that:
* TimeManager doesn't cleanup old timers, just manages his event vector for the TimeManager::update() calls
* Helios don't like the return; in the TimeEvent deconstructor
* Helios monitored the TimeEvent deconstructor - and it is called from somewhere

So as we are talking about segfaults, which part of FIFE is deleting old TimeEvents? Events are registerd by clients all over the place - but can we rely on python's gc to delete them?
« Last Edit: August 18, 2010, 12:21:28 pm by chewie »
Logged

dokinkon

  • Newbie
  • Posts: 5
    • View Profile
Re: Editor crashes
« Reply #2 on: September 13, 2010, 09:55:05 am »

May I ask did somebody else hit this bug still?
'Cause I checkout the source last weekend
I thought the version is R3426
And I got this crash now.

Please help me to solve this bug, thank you.
Logged

vtchill

  • Developer
  • Full Member
  • *
  • Posts: 206
    • View Profile
Re: Editor crashes
« Reply #3 on: September 13, 2010, 11:59:52 am »

dokinkon,

I don't believe the workaround chewie posted has been committed into the repository. You can make the change locally and see if it fixes the crash for you as well.

If you see chewie's post above:

Quote
...
Update:
Auree and I installed a self.thisown = 0 in fife_timers.py/Timer.__init__ which seems to solve our segfault-problem for now.

This is by no means a solution, but looking over FIFE::TimeManager and FIFE:TimeEvent we found that:
* TimeManager doesn't cleanup old timers, just manages his event vector for the TimeManager::update() calls
* Helios don't like the return; in the TimeEvent deconstructor
* Helios monitored the TimeEvent deconstructor - and it is called from somewhere
...

maybe chewie can post a diff of his workaround to make it easier to apply.
Logged

dokinkon

  • Newbie
  • Posts: 5
    • View Profile
Re: Editor crashes
« Reply #4 on: September 14, 2010, 08:52:29 am »

Thanks for your reply

I tried the workaround above, but seems doesn't work for me

Hope we'll have an official bug fixed version from fife core developers

thanks again
Logged

prock

  • Developer
  • Full Member
  • *
  • Posts: 236
    • View Profile
Re: Editor crashes
« Reply #5 on: September 14, 2010, 03:51:20 pm »

Hi dokinkon,

We are in working on a solution.  In the mean time I have a temporary solution that I am really unable to test on my machine (win32) because the crash does not happen for me.  I have created a ticket to track our progress... see http://fife.trac.cvsdude.com/engine/ticket/483#comment:1

There is a patch attached to the ticket that you can try if you wish.  Let us know if it works.   Thanks.

prock
Logged

dokinkon

  • Newbie
  • Posts: 5
    • View Profile
Re: Editor crashes
« Reply #6 on: September 15, 2010, 09:20:11 am »

Hi prock

This patch is work for me. (ubuntu 10.04 on macbook 7.1)

thank you very much!

btw, fife engine looks really great.
please keep going.


Logged

prock

  • Developer
  • Full Member
  • *
  • Posts: 236
    • View Profile
Re: Editor crashes
« Reply #7 on: September 15, 2010, 05:01:14 pm »

Hi dokinkon,

There was a minor problem with the patch.. I have since posted a new patch in the ticket if you want to try that one as well.
Logged