adonthell-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-devel] Bugs, bugs, bugs ...


From: Kai Sterker
Subject: [Adonthell-devel] Bugs, bugs, bugs ...
Date: Tue, 13 Aug 2002 18:18:52 +0200

As usually when I'm out of ideas I send a mail to the list, hoping that
a solution presents itself while I'm writing ;).

Well, everything was fairly okay until I started to rewrite the
schedules of Oliver and Orloth. First of all, Oliver needs to be
notified to enter the common room at a certain point in Orloth's
dialogue. So I added a mapcharacter::do_stuff method that allows to call
a method of the mapcharacter's current schedule. No problem!

Next, after teleporting to the player's room, Oliver needs to start
talking. Again that's no longer possible to do from the schedule. But we
could for example raise a map_event. Problem was, map_character::jump_to
does not raise enter_events for the new position. That was easily
corrected. A new event was quickly added to init.py and from then on it
started to get really weird.

The speech_bubbles worked no more. Instead the game crashed.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 2569)]
0x402fc751 in chunk_alloc () from /lib/libc.so.6
(gdb) bt
#0  0x402fc751 in chunk_alloc () from /lib/libc.so.6
#1  0x402fc5a4 in malloc () from /lib/libc.so.6
#2  0x8112088 in dictresize (mp=0x8220ea4, minused=0)
    at Objects/dictobject.c:404
[...]

A similar thing when loading. Either it crashed, or everything remained
black instead of drawing the map. However, dialogues continued working.

Everything points towards a memory corruption problem. So I added some
debug code to the events to see if they are freed more than once or
something like this. Well, there are some that aren't freed, but none
got freed twice.

Next thing was a debug session with efence. Unlike before efence worked
(maybe due to a new kernel?), however my old PC didn't have enough
memory. Even after killing everything save X and adonthell, the 64MB RAM
and 128MB swap weren't enough. I got through the initial dialogue, but
ran out of memory before it got interesting.

Then I tried memprof instead. That just showed what I already expected.
Some events are not freed at all. I imagine the problem is a circular
reference in Python. The events are members of the python class, and
contain a callback that points to a method of the same class. So when
PY_DECREF'ing the class, it won't get deleted since more references
point to it. Because of this, the events will also be left over.

There's still the problem with the memory corruption. I'm certain it is
related to the events, but I'm not seeing the problem. Well, first of
all I'll get rid of those circular references. Then I see if the problem
remains and, if it does, try to figure it out.

So no good news for now :(. But I'll keep you informed.

Kai




reply via email to

[Prev in Thread] Current Thread [Next in Thread]