My first glean runs resulted in segfaults. Running electric fence in
gdb, I got this backtrace:

#0  mmAllocMem (heap=0x3598cfe8, size=262144, align2=0, startSearch=0)
    at mm.c:125
#1  0x0f816614 in radeonTexturesGone (rmesa=0x3552cdf8, heap=0, offset=0, 
    size=262144, in_use=1) at radeon_texmem.c:262
#2  0x0f8167a0 in radeonAgeTextures (rmesa=0x3552cdf8, heap=0)
    at radeon_texmem.c:301
#3  0x0f7ea870 in radeonGetLock (rmesa=0x3552cdf8, flags=262144)
    at radeon_lock.c:121
#4  0x0f7e87c8 in radeonFlushCmdBuf (rmesa=0x3552cdf8, 
    caller=0xf846e90 "radeonFlush") at radeon_ioctl.c:441
#5  0x0f7ea2f8 in radeonFlush (ctx=0x3598cfe8) at radeon_ioctl.c:1125
#6  0x0f7e6e98 in radeonDestroyContext (driContextPriv=0x3552d5b4)
    at radeon_context.c:568
#7  0x0f68dcf4 in driDestroyContext ()
   from /usr/local/X11R6-DRI/lib/modules/dri/radeon_dri.so
#8  0x0fe7c738 in __glXFreeContext () from /usr/lib/libGL.so.1
#9  0x0fe7c850 in glXDestroyContext () from /usr/lib/libGL.so.1
#10 0x1000b874 in GLEAN::RenderingContext::~RenderingContext (this=0x7ffff878, 
    __in_chrg=805558984) at rc.cpp:152
#11 0x10056238 in GLEAN::BaseTest<GLEAN::OPResult>::run (this=0x0, 
    environment=@0x40000) at tbase.h:273
#12 0x10009f84 in main (argc=3, argv=0x7ffffa04) at main.cpp:121
#13 0x0fa50c50 in __libc_start_main () from /lib/libc.so.6


It's trying to allocate memory from a heap that's already been destroyed
(and thus the memory freed). How does the attached patch (which avoids
the problem) look?


-- 
Earthling Michel Dänzer (MrCooper)/ Debian GNU/Linux (powerpc) developer
XFree86 and DRI project member   /  CS student, Free Software enthusiast
Index: radeon_lock.c
===================================================================
RCS file: /cvsroot/dri/xc/xc/lib/GL/mesa/src/drv/radeon/radeon_lock.c,v
retrieving revision 1.10
diff -p -u -r1.10 radeon_lock.c
--- radeon_lock.c	27 Jun 2002 18:02:59 -0000	1.10
+++ radeon_lock.c	19 Oct 2002 14:40:47 -0000
@@ -117,7 +117,7 @@ void radeonGetLock( radeonContextPtr rme
       sarea->ctxOwner = rmesa->dri.hwContext;
 
       for ( i = 0 ; i < rmesa->texture.numHeaps ; i++ ) {
-	 if ( sarea->texAge[i] != rmesa->texture.age[i] ) {
+	 if ( rmesa->texture.heap[i] && sarea->texAge[i] != rmesa->texture.age[i] ) {
 	    radeonAgeTextures( rmesa, i );
 	 }
       }
Index: radeon_context.c
===================================================================
RCS file: /cvsroot/dri/xc/xc/lib/GL/mesa/src/drv/radeon/radeon_context.c,v
retrieving revision 1.20
diff -p -u -r1.20 radeon_context.c
--- radeon_context.c	2 Oct 2002 12:32:45 -0000	1.20
+++ radeon_context.c	19 Oct 2002 14:40:50 -0000
@@ -546,6 +546,7 @@ radeonDestroyContext( __DRIcontextPrivat
                radeonDestroyTexObj( rmesa, t );
             }
             mmDestroy( rmesa->texture.heap[i] );
+	    rmesa->texture.heap[i] = NULL;
          }
 
          foreach_s ( t, next_t, &rmesa->texture.swapped ) {

Reply via email to