BISECTED- amd-staging-drm-next, xorg-server segfault A6-6310 APU - R4 Mullins.

Michel Dänzer michel at daenzer.net
Thu Jan 10 16:22:07 UTC 2019


On 2019-01-10 5:06 p.m., Przemek Socha wrote:
> Dnia czwartek, 10 stycznia 2019 12:25:01 CET piszesz:
>> On 2019-01-10 10:44 a.m., Przemek Socha wrote:
>>> Hi,
>>> after yesterday's fetch of amd-staging-drm-next tree from agd5f git repo
>>> my
>>> xorg server is segfaulting when starting up.
>>>
>>> I am using gentoo ~amd64, xorg-server 1.20.3, xf86-video-amdgpu-18.1.0.
>>> Machine is an old Lenovo g50-45 netbook with A6-6310 APU - R4 Mullins.
>>>
>>> - excerpt from Xorg.log:
>>>
>>> "[    21.878] (II) AMDGPU(0): Setting screen physical size to 700 x 270
>>> [    21.880] (EE)
>>> [    21.880] (EE) Backtrace:
>>> [    21.880] (EE) 0: /usr/bin/X (xorg_backtrace+0x4d) [0x559df051f0bd]
>>> [    21.880] (EE) 1: /usr/bin/X (0x559df0376000+0x1acc89) [0x559df0522c89]
>>> [    21.880] (EE) 2: /lib64/libpthread.so.0 (0x7f6f2edad000+0x14560)
>>> [0x7f6f2edc1560]
>>> [    21.880] (EE) 3: /usr/lib64/xorg/modules/drivers/amdgpu_drv.so
>>> (0x7f6f2f32b000+0x14fce) [0x7f6f2f33ffce]
>>> [    21.880] (EE) 4: /usr/lib64/xorg/modules/drivers/amdgpu_drv.so
>>> (0x7f6f2f32b000+0xd1c4) [0x7f6f2f3381c4]
>>> [    21.880] (EE) 5: /usr/bin/X (0x559df0376000+0xdf024) [0x559df0455024]
>>> [    21.881] (EE) 6: /usr/bin/X (InitRootWindow+0x11) [0x559df03f8761]
>>> [    21.881] (EE) 7: /usr/bin/X (0x559df0376000+0x5b574) [0x559df03d1574]
>>> [    21.881] (EE) 8: /lib64/libc.so.6 (__libc_start_main+0xee)
>>> [0x7f6f2ec054ce]
>>> [    21.881] (EE) 9: /usr/bin/X (_start+0x2a) [0x559df03bb00a]
>>> [    21.881] (EE)
>>> [    21.881] (EE) Segmentation fault at address 0x4
>>> [    21.881] (EE)
>>> Fatal server error:
>>> [    21.881] (EE) Caught signal 11 (Segmentation fault). Server aborting
>>> [    21.881] (EE)
>>> [    21.881] (EE)
>>> Please consult the The X.Org Foundation support
>>>
>>> 	 at http://wiki.x.org
>>>  
>>>  for help.
>>>
>>> [    21.881] (EE) Please also check the log file at "/var/log/Xorg.0.log"
>>> for additional information.
>>> [    21.881] (EE)
>>> [    21.881] (II) AIGLX: Suspending AIGLX clients for VT switch
>>> [    21.957] (EE) Server terminated with error (1). Closing log file."
>>>
>>>
>>> I am not sure if I didn't mess up anything, but git bisect gives the
>>> results:
>>>
>>> [...]
>>>
>>> 79c6b898011958fba7722528d567b64e1cdc8dbe is the first bad commit
>>> commit 79c6b898011958fba7722528d567b64e1cdc8dbe
>>> Author: Yu Zhao <yuzhao at google.com>
>>> Date:   Mon Jan 7 15:51:14 2019 -0700
>>>
>>>     drm/amdgpu: validate user pitch alignment
>>>     
>>>     Userspace may request pitch alignment that is not supported by GPU.
>>>     Some requests 32, but GPU ignores it and uses default 64 when cpp is
>>>     4. If GEM object is allocated based on the smaller alignment, GPU
>>>     DMA will go out of bound.
>>>     
>>>     Cc: stable at vger.kernel.org # v4.2+
>>>     Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
>>>     Signed-off-by: Yu Zhao <yuzhao at google.com>
>>> :
>>> :040000 040000 5338964e9975e461ceedb27f6342c2896f54607a
>>>
>>> ed2f04fc9b665b27b1905fd60b7d2a3933d1fdcc M      drivers
>>
>> Thanks for tracking this down. It turns out the check added by this
>> change is too strict for linear framebuffers. I've sent a patch
>> reverting it for review: https://patchwork.freedesktop.org/patch/276122/
>>
>> Sorry I didn't realize this issue when reviewing this change.
> 
> Thanks for the swift response and sorry about the delay on my side.

No worries.


> Unfortunately applying this patch does not help in my case (but could be 
> necessarily after all). 
> 
> To start xorg-server I had to apply your patch, and, on top of this, reverse 
> the  "drm/amdgpu: validate user pitch alignment" - 
> 79c6b898011958fba7722528d567b64e1cdc8dbe.
> 
> Now xorg server starts, but I have doubt about system stability because 
> description of reverted one is saying that "if GEM object is allocated based 
> on the smaller alignment, GPU
> DMA will go out of bound". 

I don't think you need to worry. If the pitch chosen by
xf86-video-amdgpu actually didn't match the one used by the hardware,
the output would be unusably distorted. So the pitch check seems too
strict in this case as well.

Please provide the full Xorg log file and the output of dmesg
corresponding to a failure. If you write 4 to
/sys/module/drm/parameters/debug before reproducing the problem (you can
write 0 to it again afterwards), dmesg should give us even more
information about why the pitch is rejected.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20190110/5109c68d/attachment.sig>


More information about the amd-gfx mailing list