Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stripped .so files in mesa-*-dri-dbg #15104

Closed
blah1 opened this issue Oct 5, 2019 · 3 comments
Closed

Stripped .so files in mesa-*-dri-dbg #15104

blah1 opened this issue Oct 5, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@blah1
Copy link

blah1 commented Oct 5, 2019

System

  • xuname:
    Void 5.2.18_1 x86_64-musl GenuineIntel uptodate rrrnFFFFFF
  • package:
    mesa-intel-dri-dbg-19.1.7_3
    possibly also:
    mesa-ati-dri-dbg-19.1.7_3
    mesa-nouveau-dri-dbg-19.1.7_3
    mesa-vmwgfx-dri-dbg-19.1.7_3

Expected behavior

Using gdb to debug a crash in /usr/lib/xorg/modules/drivers/i915_dri.so shows the relevant functions where the crash occured.
/usr/lib/debug/usr/lib/xorg/modules/i915_dri.so is more than a megabyte in size and not stripped

Actual behavior

gdb shows "#0 0x00007ffff6d86cd9 in ?? () from /usr/lib/xorg/modules/drivers/i915_dri.so" and similar lines for relevant functions
file /usr/lib/debug/usr/lib/xorg/modules/drivers/i915_dri.so says that the file is stripped
ls -l /usr/lib/debug/usr/lib/xorg/modules/drivers/i915_dri.so says that the file is only 2768 bytes

Steps to reproduce the behavior

Run file /usr/lib/debug/usr/lib/xorg/modules/drivers/i915_dri.so and see if the file is stripped of debugging symbols
A list of stripped files in mesa-*-dri-dbg packages can be acquired with for j in ati nouveau intel vmwgfx ; do xbps-query -f mesa-"$j"-dri-dbg ; done |while read -r i ; do ls -l "$i" ; file "$i" ; done |grep -B1 ', stripped' |grep -v '^--$' |sed '2~2d'
These are the mesa-*-dri-dbg files that I found that are stripped:
/usr/lib/debug/usr/lib/dri/nouveau_drv_video.so
/usr/lib/debug/usr/lib/libXvMCnouveau.so.1.0.0
/usr/lib/debug/usr/lib/vdpau/libvdpau_nouveau.so.1.0.0
/usr/lib/debug/usr/lib/xorg/modules/drivers/nouveau_dri.so
/usr/lib/debug/usr/lib/xorg/modules/drivers/nouveau_vieux_dri.so
/usr/lib/debug/usr/lib/dri/r600_drv_video.so
/usr/lib/debug/usr/lib/vdpau/libvdpau_r300.so.1.0.0
/usr/lib/debug/usr/lib/vdpau/libvdpau_r600.so.1.0.0
/usr/lib/debug/usr/lib/xorg/modules/drivers/r200_dri.so
/usr/lib/debug/usr/lib/xorg/modules/drivers/r300_dri.so
/usr/lib/debug/usr/lib/xorg/modules/drivers/r600_dri.so
/usr/lib/debug/usr/lib/xorg/modules/drivers/i915_dri.so
/usr/lib/debug/usr/lib/xorg/modules/drivers/i965_dri.so
/usr/lib/debug/usr/lib/xorg/modules/drivers/vmwgfx_dri.so
Take this with a grain of salt because I'm a novice at debugging and for all I know some of those are supposed to be stripped.

Workaround(?)

In testing mesa-ati-dri-dbg for completeness, I found that using gdb to debug the same crash as before gave the message warning: the debug information found in "/usr/lib/xorg/modules/drivers/radeon_dri.so" does not match "/usr/lib/xorg/modules/drivers/i915_dri.so" (CRC mismatch).
gdb then gives backtrace lines such as #0 0x00007ffff6d86cd9 in _mesa_reallocate_registers (prog=prog@entry=0x55555590b230) at ..src/mesa/program/prog_optimize.c:1103
I don't know if these are the right function names and line numbers exactly, but it seems like installing mesa-ati-dri-dbg is a workaround?

I think my bug still stands, you shouldn't need to install mesa-ati-dri-dbg and mesa-ati-dri in order to debug mesa-intel-dri. It also seems suspicious that a number of debug object files are stripped.

@blah1 blah1 changed the title stripped .so files in mesa-*-dri-dbg Stripped .so files in mesa-*-dri-dbg Oct 5, 2019
@Duncaen Duncaen added the bug Something isn't working label Oct 5, 2019
@st3r4g
Copy link
Contributor

st3r4g commented Oct 7, 2019

I think this is due to the fact that the xorg/modules/drivers/*.so are created as hard links by Mesa. Output of ls masterdir/usr/lib/xorg/modules/drivers/ -i1:

394315 i915_dri.so
394315 i965_dri.so
394316 kms_swrast_dri.so
394316 nouveau_dri.so
394315 nouveau_vieux_dri.so
394315 r200_dri.so
394316 r300_dri.so
394316 r600_dri.so
394315 radeon_dri.so
394316 radeonsi_dri.so
394316 swrast_dri.so
394316 virtio_gpu_dri.so
394316 vmwgfx_dri.so

They result from https://gitlab.freedesktop.org/mesa/mesa/blob/master/src/mesa/drivers/dri/meson.build and https://gitlab.freedesktop.org/mesa/mesa/blob/master/bin/install_megadrivers.py. This causes xbps-src to output lines like objcopy: /destdir//mesa-ati-dri-19.2.0/usr/lib/xorg/modules/drivers/stDAOeBg: debuglink section already exists because of a previous attach_debug which refers to the same underlying file.

@st3r4g
Copy link
Contributor

st3r4g commented Oct 8, 2019

Duplicate of #12760

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants
@Duncaen @blah1 @st3r4g and others