[Verse-dev] Silly Win32 Persuade timer bug

Emil Brink emil at obsession.se
Thu Aug 17 08:28:49 CEST 2006


Hello.

We've been looking into a problem with some of Eskil's clients when
running on Windows. The problem manifested itself as a total lock-
up in e.g. Loq Airou when connecting to a server containing one of
the test scenes (such as the Jorma bird from "Elephants Dream").

We (me and Slas, mainly, with Eskil nearby) started looking into it
yesterday evening, but didn't get very far before I had to leave.

So, I resumed the investigation this morning, and solved it within
three minutes or so. I guess that's the good news. The bad news (heh)
is that is was "my" bug; I wrote the broken code. In the interests of
education and hopefully helping others avoid this kind of silliness,
here's a short explanation of what went wrong.

It's actually pretty self-explanatory, once you read the proper line of
code. The symptoms where:

1. Loq froze
2. Stopping it with a debugger (after re-building with debug info)
    showed it sitting in p_timer_elapsed()
3. Adding watchpoints showed the timer_period global to be zero,
    which is an "impossible" value for it to have, causing breakage

That was as far as we took it yesterday. Today, I looked at the defi-
nition of timer_period (p_task.c:143 for the curious) and saw this:

#if defined _WIN32
static timer_period = -1.0;
#endif

(Comment edited out for brevity).

So ... What type is that variable, now? Bleh. *Blushes*.

The fix is in CVS, and preliminiary testing shows Loq to run much better
on the same scene now, so I think it's fixed. I guess I will rebuild the
binary release for Windows, next.

Apologies for any inconvenience caused by this bug, I guess my only
excuse is that I don't run the apps on Windows very much.

Regards,

/Emil


More information about the Verse-dev mailing list