Bug 101330

Summary: segfault in pcsxr
Product: Mesa Reporter: Vincent B. <vb>
Component: Drivers/Gallium/radeonsiAssignee: Default DRI bug account <dri-devel>
Status: RESOLVED WORKSFORME QA Contact: Default DRI bug account <dri-devel>
Severity: normal    
Priority: medium    
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Vincent B. 2017-06-07 13:43:45 UTC
```
Thread 1 "pcsxr" received signal SIGSEGV, Segmentation fault.
st_validate_state (st=0x8a3f8c8, pipeline=ST_PIPELINE_CLEAR) at state_tracker/st_atom.c:182
182     state_tracker/st_atom.c: Aucun fichier ou dossier de ce type.
(gdb) bt
#0  st_validate_state (st=0x8a3f8c8, pipeline=ST_PIPELINE_CLEAR) at state_tracker/st_atom.c:182
#1  0xe6cc5f0e in st_Clear (ctx=<optimized out>, mask=<optimized out>) at state_tracker/st_cb_clear.c:409
#2  0xe6b2e232 in _mesa_Clear (mask=16640) at main/clear.c:225
#3  0xe77b708e in primBlkFill () from /home/vb/.pcsxr/plugins//libpeopsxgl.so
#4  0xe77adf01 in GPUwriteDataMem () from /home/vb/.pcsxr/plugins//libpeopsxgl.so
#5  0xe77ae44c in GPUdmaChain () from /home/vb/.pcsxr/plugins//libpeopsxgl.so
```
Comment 1 Nicolai Hähnle 2017-06-12 14:59:57 UTC
How can the problem be reproduced? What version of Mesa are you using? This seems more likely to be a bug in the application.
Comment 2 Vincent B. 2017-06-12 17:12:39 UTC
I'm using latest mesa git.

Latest backtrace:

                Stack trace of thread 1884:
                #0  0x00000000e66b77f2 st_validate_state (radeonsi_dri.so)
                #1  0x00000000e66bffee st_Clear (radeonsi_dri.so)
                #2  0x00000000e6528332 _mesa_Clear (radeonsi_dri.so)
                #3  0x00000000e71b708e primBlkFill (libpeopsxgl.so)
                #4  0x00000000e71adf01 GPUwriteDataMem (libpeopsxgl.so)
                #5  0x00000000e71ae44c GPUdmaChain (libpeopsxgl.so)
                #6  0x00000000080961f1 n/a (pcsxr)
                #7  0x0000000008097042 n/a (pcsxr)
                #8  0x00000000f4e4b131 n/a (n/a)
Comment 3 Vincent B. 2017-06-12 17:20:45 UTC
In order to reproduce, with Archlinux, install pcsxr, and try launching a PlayStation ISO.

I think the bug is in the driver since the segfault occurs in the driver (and that this plugin has been successfully used for years as-is with other configs).
Comment 4 Nicolai Hähnle 2017-06-12 17:36:02 UTC
The thing is, I don't have a PlayStation ISO.

Also, state_tracker/st_atom.c:182 is a line where it's impossible for a segfault to happen in current Mesa master.

Can you provide an apitrace that reproduces the crash?
Comment 5 Vincent B. 2017-06-12 18:10:23 UTC
https://github.com/htrmeira/gpu-peops-open-gl/blob/master/gpuPeopsOpenGL/src/src_plugin/prim.c#L1991-L2103

This is probably this code that made my radeonsi crash.
Comment 6 Vincent B. 2017-06-23 18:15:17 UTC
Core was generated by `pcsxr'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0xe64f8128 in radeon_bo_do_map (bo=0x931b0f8) at radeon_drm_bo.c:466
466     radeon_drm_bo.c: Aucun fichier ou dossier de ce type.
[Current thread is 1 (Thread 0xf5ab2fc0 (LWP 4362))]
(gdb) bt
#0  0xe64f8128 in radeon_bo_do_map (bo=0x931b0f8) at radeon_drm_bo.c:466
#1  0xe6529342 in r600_buffer_transfer_map (ctx=0x965c168, resource=0x955cc30, level=0, usage=3758099970, box=0xffad0cc8, ptransfer=0x9313f54) at r600_buffer_common.c:480
#2  0xe620e6d8 in tc_transfer_map (_pipe=0x9771850, resource=0x955cc30, level=0, usage=3758099970, box=0xffad0cc8, transfer=0x9313f54) at util/u_threaded_context.c:1396
#3  0xe5fd1384 in pipe_buffer_map_range (transfer=0x9313f54, access=<optimized out>, length=65536, offset=0, buffer=<optimized out>, pipe=<optimized out>) at ../../src/gallium/auxiliary/util/u_inlines.h:307
#4  st_bufferobj_map_range (ctx=0x97796c8, offset=0, length=65536, access=16438, obj=0x9313ed8, index=MAP_INTERNAL) at state_tracker/st_cb_bufferobjects.c:433
#5  0xe5fad656 in vbo_exec_vtx_map (exec=0x979dadc) at vbo/vbo_exec_draw.c:342
#6  0xe5f98114 in vbo_Vertex3fv (v=0xe6afaec0 <vertex>) at vbo/vbo_attrib_tmp.h:280
#7  0xe6ab5842 in primTileS () from /home/vb/.pcsxr/plugins//libpeopsxgl.so
#8  0xe6aacf01 in GPUwriteDataMem () from /home/vb/.pcsxr/plugins//libpeopsxgl.so
#9  0xe6aad44c in GPUdmaChain () from /home/vb/.pcsxr/plugins//libpeopsxgl.so
#10 0x080961f1 in ?? ()
#11 0x08097042 in ?? ()
#12 0xf4d77fbd in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Comment 7 Timothy Arceri 2018-04-03 05:19:28 UTC
Seems ok to me. Please re-open and ideally provide an apitrace [1] if you still have problems.

[1] https://github.com/apitrace/apitrace/blob/master/docs/USAGE.markdown

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.