I have been digging into this, and I was wrong it occurred at clBuildProgram 
(was just the logs printing was deferred - sorry).

Using gdb, I have been able to see that the crash occurs inside the call 
pipe_semaphore_signal(&ws->cs_queued);
Here is the calling stack just before the hang:
(gdb) bt
#0  radeon_drm_ws_queue_cs (ws=0x60b2e0, cs=0x7ffff7f6a010) at 
radeon_drm_winsys.c:555
#1  0x00007ffff293a7e8 in radeon_drm_cs_flush (rcs=0x7ffff7f6a010, flags=2, 
cs_trace_id=0) at radeon_drm_cs.c:567
#2  0x00007ffff2950f6d in r600_context_flush (ctx=0x6251d0, flags=2) at 
r600_hw_context.c:356
#3  0x00007ffff2951f3b in r600_flush (ctx=0x6251d0, flags=0) at r600_pipe.c:88
#4  0x00007ffff2952056 in r600_flush_gfx_ring (ctx=0x6251d0, flags=0) at 
r600_pipe.c:120
#5  0x00007ffff2952034 in r600_flush_from_st (ctx=0x6251d0, 
fence=0x7fffffffb390, flags=0) at r600_pipe.c:115
#6  0x00007ffff6c0718a in clover::command_queue::flush (this=0x642000) at 
core/queue.cpp:48
#7  0x00007ffff6c182f2 in clover::hard_event::wait (this=0xaca350) at 
core/event.cpp:124
#8  0x00007ffff6c60811 in clFinish (d_q=0x642008) at api/event.cpp:268
#9  0x000000000040136c in main (argc=1, argv=0x7fffffffdd58) at 
hello_world.c:193

If I run line 563 pipe_semaphore_signal(&ws->cs_queued) the system hang.

(gdb) print *cs
$2 = {base = {cdw = 384, buf = 0x7ffff7f6a028, ring_type = RING_GFX}, csc1 = 
{buf = {3221301248, 2147483648, 2147483648, 3221243392, 1040, 3221383168, 768, 
2, 1073741824, 3221383168, 772, 0, 0, 3221317632, 867, 256, 3221317888, 659, 0, 
3221317888, 213, 15, 3221317888, 512, 0, 3221317632, 1088, 0, 3221317632, 1103, 
4, 3221645568, 576, 0, 0, 0, 0, 0, 0, 3221514496, 583, 0, 0, 0, 0, 3222104320, 
644, 0 <repeats 13 times>, 3221383424, 741, 0, 0, 3221383424, 685, 0, 0, 
3221317632, 645, 7, 3221317888, 682, 196671, 3221383424, 757, 1985229328, 
4275878552, 3221383424, 570, 0, 0, 3221317888, 572, 4294967295, 3221383424, 
256, 4294967295, 0, 3221319424, 0, 0, 3221317888, 10, 0, 3221317888, 439, 0, 
3221448960, 688, 0, 0, 0, 3221317888, 128, 0, 3221317888, 131, 65535, 
3221383424, 180, 0, 1065353216, 3221317888, 140, 2863311530, 3221317888, 518, 
1087, 3221317888, 520, 0, 3221514496, 762, 1065353216, 1065353216, 1065353216, 
1065353216, 3221383424, 144, 0, 1073758208, 3221383424, 12, 0, 1073758208, 
3221317888, 530, 0, 3221317888, 537, 0, 3221317888, 554, 0, 3222300928, 80, 0 
<repeats 16 times>, 3222300928, 96, 0 <repeats 16 times>, 3221317888, 714, 0, 
3221317888, 4, 0, 3221317888, 141, 0, 3221317888, 434, 0, 3221383424, 441, 0, 
0, 3221317888, 725, 0, 3221318656, 0, 16781311, 3221318656, 32, 16781311, 
3221301248, 2147483648, 2147483648, 3221243392, 1031, 3221383168, 768, 2, 
1073741824...}, fd = 8, cs = {num_chunks = 3, cs_id = 0, chunks = 
140737353588864, gart_limit = 0, vram_limit = 0}, chunks = {{chunk_id = 2, 
length_dw = 384, chunk_data = 140737353523240}, {chunk_id = 1, length_dw = 16, 
chunk_data = 6452160}, {chunk_id = 3, length_dw = 2, chunk_data = 
140737353588888}}, chunk_array = {140737353588816, 140737353588832, 
140737353588848}, flags = {1, 0}, cs_trace_id = 0, nrelocs = 512, crelocs = 4, 
validated_crelocs = 0, relocs_bo = 0x642c30, relocs = 0x6273c0, is_handle_added 
= '\000' <repeats 15 times>, "\001\001\001\001", '\000' <repeats 492 times>, 
reloc_indices_hashlist = {0 <repeats 16 times>, 2, 1, 3, 0 <repeats 493 
times>}, used_vram = 65640, used_gart = 1}, csc2 = {buf = {0 <repeats 16384 
times>}, fd = 8, cs = {num_chunks = 0, cs_id = 0, chunks = 140737353657120, 
gart_limit = 0, vram_limit = 0}, chunks = {{chunk_id = 2, length_dw = 0, 
chunk_data = 140737353591496}, {chunk_id = 1, length_dw = 0, chunk_data = 
6472608}, {chunk_id = 3, length_dw = 2, chunk_data = 140737353657144}}, 
chunk_array = {140737353657072, 140737353657088, 140737353657104}, flags = {0, 
0}, cs_trace_id = 0, nrelocs = 512, crelocs = 0, validated_crelocs = 0, 
relocs_bo = 0x62b390, relocs = 0x62c3a0, is_handle_added = '\000' <repeats 511 
times>, reloc_indices_hashlist = {0 <repeats 512 times>}, used_vram = 0, 
used_gart = 0}, csc = 0x7ffff7f7aac8, cst = 0x7ffff7f6a028, ws = 0x60b2e0, 
flush_cs = 0x7ffff29520c6 <r600_flush_from_winsys>, flush_data = 0x6251d0, 
flush_completed = {mutex = {__data = {__lock = 0, __count = 0, __owner = 0, 
__nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, 
__size = '\000' <repeats 39 times>, __align = 0}, cond = {__data = {__lock = 0, 
__futex = 0, __total_seq = 0, __wakeup_seq = 0, __woken_seq = 0, __mutex = 0x0, 
__nwaiters = 0, __broadcast_seq = 0}, __size = '\000' <repeats 47 times>, 
__align = 0}, counter = 0}, trace_buf = 0x0}
(gdb) 

(gdb) print *ws
$3 = {base = {reference = {count = 1}, screen = 0x0, destroy = 0x7ffff294381e 
<radeon_winsys_destroy>, query_info = 0x7ffff294395d <radeon_query_info>, 
buffer_create = 0x7ffff29385f6 <radeon_winsys_bo_create>, buffer_get_cs_handle 
= 0x7ffff29385dc <radeon_drm_get_cs_handle>, buffer_map = 0x7ffff293789c 
<radeon_bo_map>, buffer_unmap = 0x7ffff2937ad5 <radeon_bo_unmap>, 
buffer_is_busy = 0x7ffff2936ca3 <radeon_bo_is_busy>, buffer_wait = 
0x7ffff2936c27 <radeon_bo_wait>, buffer_get_tiling = 0x7ffff29382c8 
<radeon_bo_get_tiling>, buffer_set_tiling = 0x7ffff293843e 
<radeon_bo_set_tiling>, buffer_from_handle = 0x7ffff2938701 
<radeon_winsys_bo_from_handle>, buffer_get_handle = 0x7ffff2938c9f 
<radeon_winsys_bo_get_handle>, buffer_get_virtual_address = 0x7ffff2938e10 
<radeon_winsys_bo_va>, cs_create = 0x7ffff29395bc <radeon_drm_cs_create>, 
cs_destroy = 0x7ffff293a854 <radeon_drm_cs_destroy>, cs_add_reloc = 
0x7ffff2939b8b <radeon_drm_cs_add_reloc>, cs_validate = 0x7ffff2939c48 
<radeon_drm_cs_validate>, cs_memory_below_limit = 0x7ffff2939ee6 
<radeon_drm_cs_memory_below_limit>, cs_write_reloc = 0x7ffff293a025 
<radeon_drm_cs_write_reloc>, cs_flush = 0x7ffff293a2c6 <radeon_drm_cs_flush>, 
cs_set_flush_callback = 0x7ffff293a8f9 <radeon_drm_cs_set_flush>, 
cs_is_buffer_referenced = 0x7ffff293a93d <radeon_bo_is_referenced>, 
cs_request_feature = 0x7ffff29439ed <radeon_cs_request_feature>, cs_sync_flush 
= 0x7ffff293a237 <radeon_drm_cs_sync_flush>, cs_create_fence = 0x7ffff293aa1c 
<radeon_cs_create_fence>, fence_wait = 0x7ffff293aabc <radeon_fence_wait>, 
fence_reference = 0x7ffff293ab9a <radeon_fence_reference>, surface_init = 
0x7ffff2943ab3 <radeon_drm_winsys_surface_init>, surface_best = 0x7ffff2943ae7 
<radeon_drm_winsys_surface_best>, query_value = 0x7ffff2943b1b 
<radeon_query_value>}, fd = 8, num_cs = 4, allocated_vram = 253952, 
allocated_gtt = 4096, buffer_wait_time = 13909, gen = DRV_R600, info = {pci_id 
= 26393, family = CHIP_CAYMAN, chip_class = CAYMAN, gart_size = 1071505408, 
vram_size = 2147483648, drm_major = 2, drm_minor = 34, drm_patchlevel = 0, 
has_uvd = 1 '\001', r300_num_gb_pipes = 0, r300_num_z_pipes = 0, 
r600_num_backends = 8, r600_clock_crystal_freq = 27000, r600_tiling_config = 
35, r600_num_tile_pipes = 8, r600_backend_map = 0, r600_va_start = 8388608, 
r600_ib_vm_max_size = 65536, r600_max_pipes = 4, r600_backend_map_valid = 1 
'\001', r600_virtual_address = 0 '\000', r600_has_dma = 1 '\001', 
si_tile_mode_array_valid = 0 '\000', si_tile_mode_array = {0 <repeats 32 
times>}, cik_macrotile_mode_array_valid = 0 '\000', cik_macrotile_mode_array = 
{0 <repeats 16 times>}}, kman = 0x60b820, cman = 0x60b930, surf_man = 0x60b9b0, 
num_cpus = 4, hyperz_owner = 0x0, hyperz_owner_mutex = {__data = {__lock = 0, 
__count = 0, __owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = 
{__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 39 times>, __align = 
0}, cmask_owner = 0x0, cmask_owner_mutex = {__data = {__lock = 0, __count = 0, 
__owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, 
__next = 0x0}}, __size = '\000' <repeats 39 times>, __align = 0}, cs_stack_lock 
= {__data = {__lock = 0, __count = 0, __owner = 0, __nusers = 0, __kind = 0, 
__spins = 0, __list = {__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 
39 times>, __align = 0}, cs_queued = {mutex = {__data = {__lock = 0, __count = 
0, __owner = 0, __nusers = 1, __kind = 0, __spins = 0, __list = {__prev = 0x0, 
__next = 0x0}}, __size = '\000' <repeats 12 times>, "\001", '\000' <repeats 26 
times>, __align = 0}, cond = {__data = {__lock = 0, __futex = 1, __total_seq = 
1, __wakeup_seq = 0, __woken_seq = 0, __mutex = 0x60b5c0, __nwaiters = 2, 
__broadcast_seq = 0}, __size = "\000\000\000\000\001\000\000\000\001", '\000' 
<repeats 23 times>, 
"\300\265`\000\000\000\000\000\002\000\000\000\000\000\000", __align = 
4294967296}, counter = 0}, thread = 140737256597248, kill_thread = 0, ncs = 0, 
cs_stack = {0x0, 0x0, 0x0}}

                                          
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to