Bug 93370

Summary: [clover/caicos] OpenCL atomic_cmpxchg() segmentation fault
Product: Mesa Reporter: Vedran Miletić <vedran>
Component: Drivers/Gallium/r600Assignee: Default DRI bug account <dri-devel>
Status: RESOLVED MOVED QA Contact: Default DRI bug account <dri-devel>
Severity: major    
Priority: medium    
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 99553    
Attachments: Program that segfaults

Description Vedran Miletić 2015-12-14 15:59:55 UTC
Created attachment 120495 [details]
Program that segfaults

I'm using mesa 8b52fa71ac3d706f27ccbddcb050aae4965839e9 and llvm svn revision 255468.

The code that segfaults is attached. Debugging with gdb gives:

Starting program: /home/vedranm/atomic
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff034b700 (LWP 20619)]
[New Thread 0x7fffef912700 (LWP 20620)]
[New Thread 0x7fffef111700 (LWP 20621)]
[Thread 0x7fffef111700 (LWP 20621) exited]
[Thread 0x7fffef912700 (LWP 20620) exited]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff0a4480d in radeon_lookup_buffer (csc=csc@entry=0x7ffff7f31028, bo=bo@entry=0xf103c0) at radeon_drm_cs.c:230
230         if (i == -1 || csc->relocs_bo[i].bo == bo)
(gdb) backtrace
#0  0x00007ffff0a4480d in radeon_lookup_buffer (csc=csc@entry=0x7ffff7f31028, bo=bo@entry=0xf103c0) at radeon_drm_cs.c:230
#1  0x00007ffff0a44931 in radeon_add_buffer (added_domains=<synthetic pointer>, priority=29, domains=<optimized out>, usage=<optimized out>, bo=0xf103c0, cs=0x7ffff7f31010) at radeon_drm_cs.c:269
#2  radeon_drm_cs_add_buffer (rcs=0x7ffff7f31010, buf=0xf103c0, usage=<optimized out>, domains=<optimized out>, priority=RADEON_PRIO_VERTEX_BUFFER) at radeon_drm_cs.c:333
#3  0x00007ffff0a65a79 in radeon_add_to_buffer_list (rctx=0x65c260, ring=0x65c580, rbo=<optimized out>, rbo=<optimized out>, priority=RADEON_PRIO_VERTEX_BUFFER, usage=RADEON_USAGE_READ)
    at ../../../../src/gallium/drivers/radeon/r600_cs.h:53
#4  evergreen_emit_vertex_buffers (rctx=0x65c260, state=0x65ef00, resource_offset=816, pkt_flags=<optimized out>) at evergreen_state.c:1917
#5  0x00007ffff0a62467 in r600_emit_atom (atom=0x65ef00, rctx=0x65c260) at r600_pipe.h:578
#6  compute_emit_cs (grid_layout=0xf26950, block_layout=0xf26c10, ctx=0x65c260) at evergreen_compute.c:489
#7  evergreen_launch_grid (ctx_=0x65c260, block_layout=0xf26c10, grid_layout=grid_layout@entry=0xf26950, pc=pc@entry=0, input=input@entry=0xe68850) at evergreen_compute.c:631
#8  0x00007ffff58167ac in clover::kernel::launch (this=0xf24790, q=..., grid_offset=..., grid_size=std::vector of length 1, capacity 1 = {...}, block_size=std::vector of length 1, capacity 1 = {...})
    at core/kernel.cpp:81
#9  0x00007ffff5811626 in std::function<void (clover::event&)>::operator()(clover::event&) const (__args#0=..., this=0xf26820) at /usr/include/c++/5/functional:2271
#10 clover::event::trigger (this=this@entry=0xf267e0) at core/event.cpp:55
#11 0x00007ffff58124f8 in clover::hard_event::hard_event(clover::command_queue&, unsigned int, clover::ref_vector<clover::event> const&, std::function<void (clover::event&)>) (this=0xf267e0, q=..., 
    command=<optimized out>, deps=..., action=...) at core/event.cpp:126
#12 0x00007ffff57f8ae8 in clover::create<clover::hard_event, clover::command_queue&, int, clover::ref_vector<clover::event>&, clEnqueueNDRangeKernel(cl_command_queue, cl_kernel, cl_uint, const size_t*, const size_t*, const size_t*, cl_uint, _cl_event* const*, _cl_event**)::<lambda(clover::event&)> > () at ./util/pointer.hpp:230
#13 clEnqueueNDRangeKernel (d_q=0x63d328, d_kern=0xf24798, dims=<optimized out>, d_grid_offset=<optimized out>, d_grid_size=<optimized out>, d_block_size=0x7fffffffc430, num_deps=0, d_deps=0x0, rd_ev=0x0)
    at api/kernel.cpp:293
#14 0x00000000004014a8 in main ()
(gdb)
Comment 1 Jan Vesely 2018-05-30 14:01:25 UTC
The backtrace does not look compilation related.
However, atomic ops that return the old value are not supported atm.
Comment 2 GitLab Migration User 2019-09-18 19:20:18 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/564.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.