Brian Paul <[EMAIL PROTECTED]> writes:

>> I think the above FreeResource() by CrushTree() is not addressed
>> rightly by mesa (or Xorg?).
>> 
>> I have no idea to fix this rightly. How should this problem be fixed?
>> Any idea?
>
> Where exactly is the segfault?  Are we dereferencing a NULL pointer or 
> something?  Could you send a stack trace from gdb?

Ah, sorry. I forgot to say why SEGV happened.

The original result was ramdom memory corruption. So, I changed the
xfree() for debugging where is the cause of it. My debug xfree() calls
mremap(PROT_NONE), so if someone deferenced the freed memory, the
result is SEGV.

Program received signal SIGSEGV, Segmentation fault.
0x00002aaaae8a9ac3 in get_buffer_size (buffer=0x11ec19c0, width=0x7fffd04d7814,
    height=0x7fffd04d7810) at xm_dd.c:108
108        winwidth = MIN2(xmBuffer->frontxrb->drawable->width, MAX_WIDTH);
(gdb) bt
#0  0x00002aaaae8a9ac3 in get_buffer_size (buffer=0x11ec19c0, 
width=0x7fffd04d7814,
    height=0x7fffd04d7810) at xm_dd.c:108
#1  0x00002aaaae8aaaa2 in xmesa_viewport (ctx=0x2a445df0, x=<value optimized 
out>,
    y=<value optimized out>, w=4096, h=-1346576384) at xm_dd.c:1131
#2  0x00002aaaab3d0797 in __glXRender (cl=<value optimized out>, pc=<value 
optimized out>)
    at glxcmds.c:1739
#3  0x00002aaaab3d4fb8 in __glXDispatch (client=<value optimized out>) at 
glxext.c:522
#4  0x0000000000449e4a in Dispatch () at dispatch.c:459
#5  0x000000000043277d in main (argc=4, argv=0x7fffd04d7e68, envp=<value 
optimized out>)
    at main.c:450
(gdb) l
108        winwidth = MIN2(xmBuffer->frontxrb->drawable->width, MAX_WIDTH);
109        winheight = MIN2(xmBuffer->frontxrb->drawable->height, MAX_HEIGHT);
110     #else
111        Window root;
112        Status stat;
113        int winx, winy;
114        unsigned int bw, d;
115
116        _glthread_LOCK_MUTEX(_xmesa_lock);
117        XSync(xmBuffer->xm_visual->display, 0); /* added for Chromium */
(gdb) p xmBuffer->frontxrb->drawable->width
No symbol "xmBuffer" in current context.
(gdb) p ((XMesaBuffer)buffer)->frontxrb->drawable->width
$2 = 600
(gdb) p ((XMesaBuffer)buffer)->frontxrb->drawable
$3 = (XMesaDrawable) 0x2aaaafbce000
(gdb) p free_mem_num
$5 = 10001
(gdb) check_free_list 0x2aaaafbce000
$6 = 0x2aaaafbce000

The "check_free_list" is the list of freed memory by xfree().

Thanks.
-- 
OGAWA Hirofumi <[EMAIL PROTECTED]>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to