On Mon, 2008-11-10 at 10:26 +0100, [EMAIL PROTECTED] wrote: > Hello, > > I found an uninitialized memory in mesa dri that leads to a segfault, > yet I do not know how or if to file a bugreport. > > I tried to play AlienArena2008 (v7.20) and it segfaulted. By running > it in gdb I noticed the segfault happens in driReportDamage, > dri_util.c:438 of Mesa 7.2. . There is a line > "(*psp->damage->reportDamage)(...);" which makes a call to a function > pointer. By looking at the variables, I noticed that "psp->damage" has > nonsense-values. psp->damage is neither zero nor pointing to valid > memory (debuger tells me *psp->damage: memory not accessable). It > looks like uninitialized memory and obviously leads to the segfault. > AFAICS the relevant structure is created in function > driCreateNewScreen() (in dri_util.c:833). Memory is allocated there > and then part of the structure is initialzed, but psp->damage is > obviously not initialized. > > I patched that part of the driver so that the whole structure is > initialized with zeros (before any other inits). After building and > installing mesa again, the segfault in Mesa is gone and I could play > AlienArena. > > > So, is this a bug in mesa or am I just using an invalid configuration > (e.g. old xserver) ? > > System configuration: > - debian etch > - lspci|grep Display > 06:00.1 Display controller: ATI Technologies Inc RV370 [Radeon > X300SE] > - dpkg -l xserver-xorg > xserver-xorg 7.1.0-19 > - self-compiled drm from current git > - self-compiled mesa 7.2 > > If it is a bug, is my fix the correct solution ?
I think it is, though you could just use _mesa_calloc() instead of _mesa_malloc() and memset(). -- Earthling Michel Dänzer | http://tungstengraphics.com Libre software enthusiast | Debian, X and DRI developer ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Mesa3d-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mesa3d-dev
