[Bug 33494] crash during (or at end) of map loading in ut2004

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Jan 25 12:13:11 PST 2011


https://bugs.freedesktop.org/show_bug.cgi?id=33494

--- Comment #1 from XoD <xoddark at gmail.com> 2011-01-25 12:13:11 PST ---
If I add a sprintf before memcpy in r600_upload.c I was able to debug in
r600_upload_buffer.

The call stack was :

#0  memcpy() at ../sysdeps/x86_64/memcpy.S:267
#1  fprintf() at /usr/include/bits/string3.h:52
#2  r600_upload_buffer() at r600_upload.c:109
#3  r600_upload_user_buffers() at r600_buffer.c:239
#4  evergreen_vertex_buffer_update() at evergreen_state.c:1372
#5  st_draw_vbo() at state_tracker/st_draw.c:712
...


Patch :
diff --git a/src/gallium/drivers/r600/r600_upload.c
b/src/gallium/drivers/r600/r600_upload.c
index 44102ff..ba19185 100644
--- a/src/gallium/drivers/r600/r600_upload.c
+++ b/src/gallium/drivers/r600/r600_upload.c
@@ -103,7 +103,11 @@ int r600_upload_buffer(struct r600_upload *upload,
unsigned offset,
        }

        in_ptr = in_buffer->user_buffer;
-       memcpy(upload->ptr + upload->offset, (uint8_t *) in_ptr + offset,
size);
+       uint8_t * ptr_src = (uint8_t *) upload->ptr + upload->offset;
+       uint8_t * ptr_dest = (uint8_t *) in_ptr + offset;
+       //R600_ERR("memcpy src %d dest %d size %d\n", ptr_src, ptr_dest, size);
+       fprintf(stdout, "memcpy src %p dest %p size %d\n", ptr_src, ptr_dest,
size);
+       memcpy(ptr_src, ptr_dest, size);
        *out_offset = upload->offset;
        *out_size = upload->size;
        *out_buffer = NULL;

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the dri-devel mailing list