gnash-dev
[Top][All Lists]
Advanced

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

[Gnash-dev] dangerous use of global data


From: strk
Subject: [Gnash-dev] dangerous use of global data
Date: Sat, 11 Nov 2006 12:21:18 +0100

Hunting for bug #18100 I built with 'mudflap' support activated and
found many issues. Since issues araise even when the main() function
body is EMPTY, I belive these are due to static initializations.

In order to reduce these issue, we should make sure that *every*
global object is properly initialized before use. This can only
be ensured (in a portable way) by accessing the global *only*
trough a non-inlined function defined inside the same file
that defines the global function OR by *creating* the static
inside the accessor function itsef.

I took the second path and already committed a patch for
removing the global 'rcfile' object, replacing it with
a RcInitFile::getDefaultInstance() static method that initialize
the LogFile in it's body (as a function-static). This removes
the mudflap reports about RcInitFile.

I'm now working on LogFile, which is another one.
This mail is just to let you know what I'm up to, and to warn
you about other such cases.
Gnash currently uses way too much globals, and we should protect
all of them inside ad-hoc classes with the sole purpose of providing
the global in a safe way.
Eventually, these classes could be stored in yet another container
object to represent a "run environment". This would allow us, for example,
to play multiple movies by the same exectutable file (not impossible).

--strk;

 /"\    ASCII Ribbon Campaign
 \ /    Respect for low technology.
  X     Keep e-mail messages readable by any computer system.
 / \    Keep it ASCII. 





reply via email to

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