[-- Attachment #1: Type: text/plain, Size: 4693 bytes --] New issue by ackalker on void-packages repository https://github.com/void-linux/void-packages/issues/12760 Description: ### System * xuname: Void 5.1.15_1 x86_64 GenuineIntel uptodate rrrrmdFFFFFFFFF * package: mesa-nouveau-dri-dbg-19.1.1_1 ### Expected behavior `gdb` should load debug symbols for the right file, i.e. `/usr/lib/debug/vdpau/libvdpau_nouveau.so.1` should match `/usr/lib/vdpau/libvdpau_nouveau.so.1`, etc., backtrace should contain symbols for all loaded libraries, etc. ### Actual behavior `gdb` gives debug information mismatch warning, backtrace is missing details ### Steps to reproduce the behavior (trying to debug void-linux/void-packages#12717) * On a system using `nouveau` X graphics driver and `gdb` installed, run the following in a terminal: ```sh # xbps-install vdpauinfo{,-dbg} glibc-dbg mesa-nouveau-dri-dbg ``` * Run `vdpauinfo` under GDB Results on my system: ```sh $ gdb -q vdpauinfo Reading symbols from vdpauinfo... Reading symbols from /usr/lib/debug//usr/bin/vdpauinfo... (gdb) set pagination off (gdb) run Starting program: /usr/bin/vdpauinfo [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". display: :0 screen: 0 warning: the debug information found in "/usr/lib/vdpau/libvdpau_r300.so.1.0.0" does not match "/usr/lib/vdpau/libvdpau_nouveau.so.1" (CRC mismatch). warning: the debug information found in "/usr/lib/vdpau/libvdpau_r300.so.1.0.0" does not match "/usr/lib/vdpau/libvdpau_nouveau.so.1" (CRC mismatch). [New Thread 0x7fffefbda700 (LWP 11586)] Thread 1 "vdpauinfo" received signal SIGSEGV, Segmentation fault. 0x00007ffff72b2937 in ?? () from /usr/lib/vdpau/libvdpau_nouveau.so.1 (gdb) bt full #0 0x00007ffff72b2937 in ?? () from /usr/lib/vdpau/libvdpau_nouveau.so.1 No symbol table info available. #1 0x00007ffff72c1696 in ?? () from /usr/lib/vdpau/libvdpau_nouveau.so.1 No symbol table info available. #2 0x00007ffff7288210 in ?? () from /usr/lib/vdpau/libvdpau_nouveau.so.1 No symbol table info available. #3 0x00007ffff72882bf in ?? () from /usr/lib/vdpau/libvdpau_nouveau.so.1 No symbol table info available. #4 0x00007ffff72b0deb in ?? () from /usr/lib/vdpau/libvdpau_nouveau.so.1 No symbol table info available. #5 0x00007ffff72859b7 in ?? () from /usr/lib/vdpau/libvdpau_nouveau.so.1 No symbol table info available. #6 0x00007ffff72ddceb in ?? () from /usr/lib/vdpau/libvdpau_nouveau.so.1 No symbol table info available. #7 0x00007ffff72e5dac in ?? () from /usr/lib/vdpau/libvdpau_nouveau.so.1 No symbol table info available. #8 0x00007ffff70034f3 in ?? () from /usr/lib/vdpau/libvdpau_nouveau.so.1 No symbol table info available. #9 0x00007ffff6ffcf2a in ?? () from /usr/lib/vdpau/libvdpau_nouveau.so.1 No symbol table info available. #10 0x00007ffff6fecdcb in vdp_imp_device_create_x11 () from /usr/lib/vdpau/libvdpau_nouveau.so.1 No symbol table info available. #11 0x00007ffff7e6daf5 in vdp_device_create_x11 () from /usr/lib/libvdpau.so.1 No symbol table info available. #12 0x00005555555554ad in main (argc=<optimized out>, argv=0x7fffffffe198) at vdpauinfo.cpp:488 o = { display_name = 0x7fffffffeb53 ":0", screen = <optimized out> } display = 0x55555576ce70 screen = 0 device = 1 get_proc_address = 0x1 rv = <optimized out> impl = <optimized out> (gdb) ``` Running `objdump -g` on the debug information file confirms the incorrect link: ```sh $ objdump -g /usr/lib/debug/usr/lib/vdpau/libvdpau_nouveau.so.1.0.0 /usr/lib/debug/usr/lib/vdpau/libvdpau_nouveau.so.1.0.0: file format elf64-x86-64 objdump: Warning: could not find separate debug file 'libvdpau_r300.so.1.0.0' objdump: Warning: tried: /lib/debug/libvdpau_r300.so.1.0.0 objdump: Warning: tried: /usr/lib/debug/usr/libvdpau_r300.so.1.0.0 objdump: Warning: tried: /usr/lib/debug/libvdpau_r300.so.1.0.0 objdump: Warning: tried: /usr/lib/debug/usr/lib/vdpau/.debug/libvdpau_r300.so.1.0.0 objdump: Warning: tried: /usr/lib/debug/usr/lib/vdpau/libvdpau_r300.so.1.0.0 objdump: Warning: tried: .debug/libvdpau_r300.so.1.0.0 objdump: Warning: tried: libvdpau_r300.so.1.0.0 Section '.eh_frame' has an invalid size: 0x8bfb0. Contents of the .gnu_debuglink section (loaded from /usr/lib/debug/usr/lib/vdpau/libvdpau_nouveau.so.1.0.0): Separate debug info file: libvdpau_r300.so.1.0.0 CRC value: 0x69940ea ``` My guess is that something went wrong during build or packaging. I haven't looked into it, so I don't know if the problem is with the recipe or with `xbps-src` itself.
[-- Attachment #1: Type: text/plain, Size: 910 bytes --] New comment by ackalker on void-packages repository https://github.com/void-linux/void-packages/issues/12760#issuecomment-507165792 Comment: The problem appears to be with how the build system installs 'megadrivers', i.e. a bunch of filenames all get symlinked to the same master file. For this issue, on my system, this output from `xbps-src install` step seems relevant (full `xbps-src` install log [here](https://gist.github.com/ackalker/8377b789b50ee6e3b17ccb642e040dd1)): ``` Running custom install script '/usr/bin/python3 /builddir/mesa-19.1.1/bin/install_megadrivers.py /builddir/mesa-19.1.1/build/src/gallium/targets/vdpau/libvdpau_gallium.so.1.0.0 lib/vdpau libvdpau_r300.so.1.0.0 libvdpau_r600.so.1.0.0 libvdpau_radeonsi.so.1.0.0 libvdpau_nouveau.so.1.0.0' ``` This results in a bunch of symlinks, including `libvdpau_nouveau.so.1.0.0`, all eventually pointing to `libvdpau_gallium.so.1.0.0`.
[-- Attachment #1: Type: text/plain, Size: 954 bytes --] New comment by ackalker on void-packages repository https://github.com/void-linux/void-packages/issues/12760#issuecomment-507165792 Comment: The problem appears to be with how the build system installs 'megadrivers', i.e. a bunch of filenames all get symlinked to the same master file by `${wrksrc}/bin/install_megadrivers.py`. For this issue, on my system, this output from `xbps-src install` step seems relevant (full `xbps-src` install log [here](https://gist.github.com/ackalker/8377b789b50ee6e3b17ccb642e040dd1)): ``` Running custom install script '/usr/bin/python3 /builddir/mesa-19.1.1/bin/install_megadrivers.py /builddir/mesa-19.1.1/build/src/gallium/targets/vdpau/libvdpau_gallium.so.1.0.0 lib/vdpau libvdpau_r300.so.1.0.0 libvdpau_r600.so.1.0.0 libvdpau_radeonsi.so.1.0.0 libvdpau_nouveau.so.1.0.0' ``` This results in a bunch of symlinks, including `libvdpau_nouveau.so.1.0.0`, all eventually pointing to `libvdpau_gallium.so.1.0.0`.
[-- Attachment #1: Type: text/plain, Size: 1084 bytes --] New comment by ackalker on void-packages repository https://github.com/void-linux/void-packages/issues/12760#issuecomment-507165792 Comment: The problem appears to be with how the build system installs 'megadrivers', i.e. a bunch of filenames all get symlinked to the same master file by `${wrksrc}/bin/install_megadrivers.py`. For this issue, on my system, this output from `xbps-src install` step seems relevant (full `xbps-src` install log [here](https://gist.github.com/ackalker/8377b789b50ee6e3b17ccb642e040dd1)): ``` Running custom install script '/usr/bin/python3 /builddir/mesa-19.1.1/bin/install_megadrivers.py /builddir/mesa-19.1.1/build/src/gallium/targets/vdpau/libvdpau_gallium.so.1.0.0 lib/vdpau libvdpau_r300.so.1.0.0 libvdpau_r600.so.1.0.0 libvdpau_radeonsi.so.1.0.0 libvdpau_nouveau.so.1.0.0' ``` This results in a bunch of symlinks, including `libvdpau_nouveau.so.1.0.0`, all eventually pointing to `libvdpau_gallium.so`. It appears that `xbps-src`'s `common/hooks/post-install/06-strip-and-debug-pkgs.sh` doesn't know how to deal with those multi-symlinks.
[-- Attachment #1: Type: text/plain, Size: 1064 bytes --] New comment by ackalker on void-packages repository https://github.com/void-linux/void-packages/issues/12760#issuecomment-507165792 Comment: The problem appears to be with how the build system installs 'megadrivers', i.e. a bunch of filenames all get symlinked to the same master file by `${wrksrc}/bin/install_megadrivers.py`. For this issue, on my system, this output from `xbps-src install` step seems relevant (full `xbps-src` install log [here](https://gist.github.com/ackalker/8377b789b50ee6e3b17ccb642e040dd1)): ``` Running custom install script '/usr/bin/python3 /builddir/mesa-19.1.1/bin/install_megadrivers.py /builddir/mesa-19.1.1/build/src/gallium/targets/vdpau/libvdpau_gallium.so.1.0.0 lib/vdpau libvdpau_r300.so.1.0.0 libvdpau_r600.so.1.0.0 libvdpau_radeonsi.so.1.0.0 libvdpau_nouveau.so.1.0.0' ``` This results in a bunch of symlinks, including `libvdpau_nouveau.so.1.0.0`, all eventually pointing to `libvdpau_gallium.so`. It appears that `xbps-src`'s `common/hooks/post-install/06-strip-and-debug-pkgs.sh` doesn't handle these correctly.
[-- Attachment #1: Type: text/plain, Size: 3345 bytes --] New comment by ackalker on void-packages repository https://github.com/void-linux/void-packages/issues/12760#issuecomment-507331014 Comment: Anyway, after installing the `mesa-ati-dri-dbg` package, I get the following backtrace with a bit more detail: ```sh $ gdb -q vdpauinfo Reading symbols from vdpauinfo... Reading symbols from /usr/lib/debug//usr/bin/vdpauinfo... (gdb) set pagination off (gdb) run Starting program: /usr/bin/vdpauinfo [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". display: :0 screen: 0 warning: the debug information found in "/usr/lib/vdpau/libvdpau_r300.so.1.0.0" does not match "/usr/lib/vdpau/libvdpau_nouveau.so.1" (CRC mismatch). [New Thread 0x7fffefbda700 (LWP 22843)] Thread 1 "vdpauinfo" received signal SIGSEGV, Segmentation fault. nv50_ir::AlgebraicOpt::handleCVT_CVT (this=<optimized out>, cvt=0x555555802590) at ../src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp:2085 2085 ../src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp: No such file or directory. (gdb) bt #0 nv50_ir::AlgebraicOpt::handleCVT_CVT (this=<optimized out>, cvt=0x555555802590) at ../src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp:2085 #1 0x00007ffff72c1696 in nv50_ir::AlgebraicOpt::visit (this=0x7fffffffc140, bb=<optimized out>) at ../src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp:2351 #2 0x00007ffff7288210 in nv50_ir::Pass::doRun (this=0x7fffffffc140, func=<optimized out>, ordered=<optimized out>, skipPhi=false) at ../src/gallium/drivers/nouveau/codegen/nv50_ir_bb.cpp:500 #3 0x00007ffff72882bf in nv50_ir::Pass::doRun (this=0x7fffffffc140, prog=<optimized out>, ordered=false, skipPhi=false) at ../src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h:413 #4 0x00007ffff72b0deb in nv50_ir::Program::optimizeSSA (this=this@entry=0x5555557ecdb0, level=3) at ../src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp:4005 #5 0x00007ffff72859b7 in nv50_ir_generate_code (info=info@entry=0x5555558440b0) at ../src/gallium/drivers/nouveau/codegen/nv50_ir.cpp:1267 #6 0x00007ffff72ddceb in nvc0_program_translate (prog=prog@entry=0x55555582b5a0, chipset=<optimized out>, debug=debug@entry=0x5555557e7798) at ../src/gallium/drivers/nouveau/nvc0/nvc0_program.c:638 #7 0x00007ffff72e5dac in nvc0_cp_state_create (pipe=0x5555557e73d0, cso=0x7fffffffce20) at ../src/gallium/drivers/nouveau/nvc0/nvc0_context.h:292 #8 0x00007ffff70034f3 in vl_compositor_cs_create_shader (c=c@entry=0x5555557c18b8, compute_shader_text=<optimized out>) at ../src/gallium/auxiliary/vl/vl_compositor_cs.c:433 #9 0x00007ffff6ffcf2a in init_shaders (c=0x5555557c18b8) at ../src/gallium/auxiliary/vl/vl_compositor.c:74 #10 vl_compositor_init (c=c@entry=0x5555557c18b8, pipe=<optimized out>) at ../src/gallium/auxiliary/vl/vl_compositor.c:767 #11 0x00007ffff6fecdcb in vdp_imp_device_create_x11 (display=<optimized out>, screen=<optimized out>, device=0x7fffffffe03c, get_proc_address=0x7fffffffdfd8) at ../src/gallium/state_trackers/vdpau/device.c:129 #12 0x00007ffff7e6daf5 in vdp_device_create_x11 () from /usr/lib/libvdpau.so.1 #13 0x00005555555554ad in main (argc=<optimized out>, argv=0x7fffffffe168) at vdpauinfo.cpp:488 ``` Although there's still a warning, at least the symbol names look somewhat reasonable.
[-- Attachment #1: Type: text/plain, Size: 3416 bytes --] New comment by ackalker on void-packages repository https://github.com/void-linux/void-packages/issues/12760#issuecomment-507331014 Comment: Anyway, after installing the `mesa-ati-dri-dbg` package, I get the following backtrace with a bit more detail: ```sh $ gdb -q vdpauinfo Reading symbols from vdpauinfo... Reading symbols from /usr/lib/debug//usr/bin/vdpauinfo... (gdb) directory /masterdir/builddir/mesa-19.1.1/build Source directories searched: /masterdir/builddir/mesa-19.1.1/build:$cdir:$cwd (gdb) set pagination off (gdb) run Starting program: /usr/bin/vdpauinfo [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". display: :0 screen: 0 warning: the debug information found in "/usr/lib/vdpau/libvdpau_r300.so.1.0.0" does not match "/usr/lib/vdpau/libvdpau_nouveau.so.1" (CRC mismatch). [New Thread 0x7fffefbda700 (LWP 23390)] Thread 1 "vdpauinfo" received signal SIGSEGV, Segmentation fault. nv50_ir::AlgebraicOpt::handleCVT_CVT (this=<optimized out>, cvt=0x555555802590) at ../src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp:2085 2085 if (insn->saturate || (gdb) bt #0 nv50_ir::AlgebraicOpt::handleCVT_CVT (this=<optimized out>, cvt=0x555555802590) at ../src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp:2085 #1 0x00007ffff72c1696 in nv50_ir::AlgebraicOpt::visit (this=0x7fffffffc140, bb=<optimized out>) at ../src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp:2351 #2 0x00007ffff7288210 in nv50_ir::Pass::doRun (this=0x7fffffffc140, func=<optimized out>, ordered=<optimized out>, skipPhi=false) at ../src/gallium/drivers/nouveau/codegen/nv50_ir_bb.cpp:500 #3 0x00007ffff72882bf in nv50_ir::Pass::doRun (this=0x7fffffffc140, prog=<optimized out>, ordered=false, skipPhi=false) at ../src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h:413 #4 0x00007ffff72b0deb in nv50_ir::Program::optimizeSSA (this=this@entry=0x5555557ecdb0, level=3) at ../src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp:4005 #5 0x00007ffff72859b7 in nv50_ir_generate_code (info=info@entry=0x5555558440b0) at ../src/gallium/drivers/nouveau/codegen/nv50_ir.cpp:1267 #6 0x00007ffff72ddceb in nvc0_program_translate (prog=prog@entry=0x55555582b5a0, chipset=<optimized out>, debug=debug@entry=0x5555557e7798) at ../src/gallium/drivers/nouveau/nvc0/nvc0_program.c:638 #7 0x00007ffff72e5dac in nvc0_cp_state_create (pipe=0x5555557e73d0, cso=0x7fffffffce20) at ../src/gallium/drivers/nouveau/nvc0/nvc0_context.h:292 #8 0x00007ffff70034f3 in vl_compositor_cs_create_shader (c=c@entry=0x5555557c18b8, compute_shader_text=<optimized out>) at ../src/gallium/auxiliary/vl/vl_compositor_cs.c:433 #9 0x00007ffff6ffcf2a in init_shaders (c=0x5555557c18b8) at ../src/gallium/auxiliary/vl/vl_compositor.c:74 #10 vl_compositor_init (c=c@entry=0x5555557c18b8, pipe=<optimized out>) at ../src/gallium/auxiliary/vl/vl_compositor.c:767 #11 0x00007ffff6fecdcb in vdp_imp_device_create_x11 (display=<optimized out>, screen=<optimized out>, device=0x7fffffffe03c, get_proc_address=0x7fffffffdfd8) at ../src/gallium/state_trackers/vdpau/device.c:129 #12 0x00007ffff7e6daf5 in vdp_device_create_x11 () from /usr/lib/libvdpau.so.1 #13 0x00005555555554ad in main (argc=<optimized out>, argv=0x7fffffffe168) at vdpauinfo.cpp:488 ``` Although there's still a warning, at least the symbol names now look reasonable.
[-- Attachment #1: Type: text/plain, Size: 3521 bytes --] New comment by ackalker on void-packages repository https://github.com/void-linux/void-packages/issues/12760#issuecomment-507331014 Comment: Anyway, after installing the `mesa-ati-dri-dbg` package, I get the following backtrace with a bit more detail: ```sh $ gdb -q vdpauinfo Reading symbols from vdpauinfo... Reading symbols from /usr/lib/debug//usr/bin/vdpauinfo... (gdb) directory /masterdir/builddir/mesa-19.1.1/build Source directories searched: /masterdir/builddir/mesa-19.1.1/build:$cdir:$cwd (gdb) set pagination off (gdb) run Starting program: /usr/bin/vdpauinfo [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". display: :0 screen: 0 warning: the debug information found in "/usr/lib/vdpau/libvdpau_r300.so.1.0.0" does not match "/usr/lib/vdpau/libvdpau_nouveau.so.1" (CRC mismatch). [New Thread 0x7fffefbda700 (LWP 23390)] Thread 1 "vdpauinfo" received signal SIGSEGV, Segmentation fault. nv50_ir::AlgebraicOpt::handleCVT_CVT (this=<optimized out>, cvt=0x555555802590) at ../src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp:2085 2085 if (insn->saturate || (gdb) bt #0 nv50_ir::AlgebraicOpt::handleCVT_CVT (this=<optimized out>, cvt=0x555555802590) at ../src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp:2085 #1 0x00007ffff72c1696 in nv50_ir::AlgebraicOpt::visit (this=0x7fffffffc140, bb=<optimized out>) at ../src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp:2351 #2 0x00007ffff7288210 in nv50_ir::Pass::doRun (this=0x7fffffffc140, func=<optimized out>, ordered=<optimized out>, skipPhi=false) at ../src/gallium/drivers/nouveau/codegen/nv50_ir_bb.cpp:500 #3 0x00007ffff72882bf in nv50_ir::Pass::doRun (this=0x7fffffffc140, prog=<optimized out>, ordered=false, skipPhi=false) at ../src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h:413 #4 0x00007ffff72b0deb in nv50_ir::Program::optimizeSSA (this=this@entry=0x5555557ecdb0, level=3) at ../src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp:4005 #5 0x00007ffff72859b7 in nv50_ir_generate_code (info=info@entry=0x5555558440b0) at ../src/gallium/drivers/nouveau/codegen/nv50_ir.cpp:1267 #6 0x00007ffff72ddceb in nvc0_program_translate (prog=prog@entry=0x55555582b5a0, chipset=<optimized out>, debug=debug@entry=0x5555557e7798) at ../src/gallium/drivers/nouveau/nvc0/nvc0_program.c:638 #7 0x00007ffff72e5dac in nvc0_cp_state_create (pipe=0x5555557e73d0, cso=0x7fffffffce20) at ../src/gallium/drivers/nouveau/nvc0/nvc0_context.h:292 #8 0x00007ffff70034f3 in vl_compositor_cs_create_shader (c=c@entry=0x5555557c18b8, compute_shader_text=<optimized out>) at ../src/gallium/auxiliary/vl/vl_compositor_cs.c:433 #9 0x00007ffff6ffcf2a in init_shaders (c=0x5555557c18b8) at ../src/gallium/auxiliary/vl/vl_compositor.c:74 #10 vl_compositor_init (c=c@entry=0x5555557c18b8, pipe=<optimized out>) at ../src/gallium/auxiliary/vl/vl_compositor.c:767 #11 0x00007ffff6fecdcb in vdp_imp_device_create_x11 (display=<optimized out>, screen=<optimized out>, device=0x7fffffffe03c, get_proc_address=0x7fffffffdfd8) at ../src/gallium/state_trackers/vdpau/device.c:129 #12 0x00007ffff7e6daf5 in vdp_device_create_x11 () from /usr/lib/libvdpau.so.1 #13 0x00005555555554ad in main (argc=<optimized out>, argv=0x7fffffffe168) at vdpauinfo.cpp:488 (gdb) print insn $1 = (nv50_ir::Instruction *) 0x0 (gdb) # boom! that's guaranteed to blow up yeah... ``` Although there's still a warning, at least the symbol names now look reasonable.
[-- Attachment #1: Type: text/plain, Size: 3521 bytes --] New comment by ackalker on void-packages repository https://github.com/void-linux/void-packages/issues/12760#issuecomment-507331014 Comment: Anyway, after installing the `mesa-ati-dri-dbg` package, I get the following backtrace with a bit more detail: ```sh $ gdb -q vdpauinfo Reading symbols from vdpauinfo... Reading symbols from /usr/lib/debug//usr/bin/vdpauinfo... (gdb) directory /masterdir/builddir/mesa-19.1.1/build Source directories searched: /masterdir/builddir/mesa-19.1.1/build:$cdir:$cwd (gdb) set pagination off (gdb) run Starting program: /usr/bin/vdpauinfo [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". display: :0 screen: 0 warning: the debug information found in "/usr/lib/vdpau/libvdpau_r300.so.1.0.0" does not match "/usr/lib/vdpau/libvdpau_nouveau.so.1" (CRC mismatch). [New Thread 0x7fffefbda700 (LWP 23390)] Thread 1 "vdpauinfo" received signal SIGSEGV, Segmentation fault. nv50_ir::AlgebraicOpt::handleCVT_CVT (this=<optimized out>, cvt=0x555555802590) at ../src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp:2085 2085 if (insn->saturate || (gdb) bt #0 nv50_ir::AlgebraicOpt::handleCVT_CVT (this=<optimized out>, cvt=0x555555802590) at ../src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp:2085 #1 0x00007ffff72c1696 in nv50_ir::AlgebraicOpt::visit (this=0x7fffffffc140, bb=<optimized out>) at ../src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp:2351 #2 0x00007ffff7288210 in nv50_ir::Pass::doRun (this=0x7fffffffc140, func=<optimized out>, ordered=<optimized out>, skipPhi=false) at ../src/gallium/drivers/nouveau/codegen/nv50_ir_bb.cpp:500 #3 0x00007ffff72882bf in nv50_ir::Pass::doRun (this=0x7fffffffc140, prog=<optimized out>, ordered=false, skipPhi=false) at ../src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h:413 #4 0x00007ffff72b0deb in nv50_ir::Program::optimizeSSA (this=this@entry=0x5555557ecdb0, level=3) at ../src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp:4005 #5 0x00007ffff72859b7 in nv50_ir_generate_code (info=info@entry=0x5555558440b0) at ../src/gallium/drivers/nouveau/codegen/nv50_ir.cpp:1267 #6 0x00007ffff72ddceb in nvc0_program_translate (prog=prog@entry=0x55555582b5a0, chipset=<optimized out>, debug=debug@entry=0x5555557e7798) at ../src/gallium/drivers/nouveau/nvc0/nvc0_program.c:638 #7 0x00007ffff72e5dac in nvc0_cp_state_create (pipe=0x5555557e73d0, cso=0x7fffffffce20) at ../src/gallium/drivers/nouveau/nvc0/nvc0_context.h:292 #8 0x00007ffff70034f3 in vl_compositor_cs_create_shader (c=c@entry=0x5555557c18b8, compute_shader_text=<optimized out>) at ../src/gallium/auxiliary/vl/vl_compositor_cs.c:433 #9 0x00007ffff6ffcf2a in init_shaders (c=0x5555557c18b8) at ../src/gallium/auxiliary/vl/vl_compositor.c:74 #10 vl_compositor_init (c=c@entry=0x5555557c18b8, pipe=<optimized out>) at ../src/gallium/auxiliary/vl/vl_compositor.c:767 #11 0x00007ffff6fecdcb in vdp_imp_device_create_x11 (display=<optimized out>, screen=<optimized out>, device=0x7fffffffe03c, get_proc_address=0x7fffffffdfd8) at ../src/gallium/state_trackers/vdpau/device.c:129 #12 0x00007ffff7e6daf5 in vdp_device_create_x11 () from /usr/lib/libvdpau.so.1 #13 0x00005555555554ad in main (argc=<optimized out>, argv=0x7fffffffe168) at vdpauinfo.cpp:488 (gdb) print insn $1 = (nv50_ir::Instruction *) 0x0 (gdb) # boom! that's guaranteed to blow up yeah... ``` Although there's still a warning, at least the symbol names now look reasonable.
[-- Attachment #1: Type: text/plain, Size: 1064 bytes --] New comment by ackalker on void-packages repository https://github.com/void-linux/void-packages/issues/12760#issuecomment-507165792 Comment: The problem appears to be with how the build system installs 'megadrivers', i.e. a bunch of filenames all get symlinked to the same master file by `${wrksrc}/bin/install_megadrivers.py`. For this issue, on my system, this output from `xbps-src install` step seems relevant (full `xbps-src` install log [here](https://gist.github.com/ackalker/8377b789b50ee6e3b17ccb642e040dd1)): ``` Running custom install script '/usr/bin/python3 /builddir/mesa-19.1.1/bin/install_megadrivers.py /builddir/mesa-19.1.1/build/src/gallium/targets/vdpau/libvdpau_gallium.so.1.0.0 lib/vdpau libvdpau_r300.so.1.0.0 libvdpau_r600.so.1.0.0 libvdpau_radeonsi.so.1.0.0 libvdpau_nouveau.so.1.0.0' ``` This results in a bunch of symlinks, including `libvdpau_nouveau.so`, all eventually pointing to `libvdpau_gallium.so.1.0.0`. It appears that `xbps-src`'s `common/hooks/post-install/06-strip-and-debug-pkgs.sh` doesn't handle these correctly.
[-- Attachment #1: Type: text/plain, Size: 1070 bytes --] New comment by ackalker on void-packages repository https://github.com/void-linux/void-packages/issues/12760#issuecomment-507165792 Comment: The problem appears to be with how the build system installs 'megadrivers', i.e. a bunch of filenames all get symlinked to the same master file by `${wrksrc}/bin/install_megadrivers.py`. For this issue, on my system, this output from `xbps-src install` step seems relevant (full `xbps-src` install log [here](https://gist.github.com/ackalker/8377b789b50ee6e3b17ccb642e040dd1)): ``` Running custom install script '/usr/bin/python3 /builddir/mesa-19.1.1/bin/install_megadrivers.py /builddir/mesa-19.1.1/build/src/gallium/targets/vdpau/libvdpau_gallium.so.1.0.0 lib/vdpau libvdpau_r300.so.1.0.0 libvdpau_r600.so.1.0.0 libvdpau_radeonsi.so.1.0.0 libvdpau_nouveau.so.1.0.0' ``` This results in a bunch of symlinks, including `libvdpau_nouveau.so.1.0.0`, all eventually pointing to `libvdpau_gallium.so.1.0.0`. It appears that `xbps-src`'s `common/hooks/post-install/06-strip-and-debug-pkgs.sh` doesn't handle these correctly.
[-- Attachment #1: Type: text/plain, Size: 1069 bytes --] New comment by ackalker on void-packages repository https://github.com/void-linux/void-packages/issues/12760#issuecomment-507165792 Comment: The problem appears to be with how the build system installs 'megadrivers', i.e. a bunch of filenames all get symlinked to the same master file by `${wrksrc}/bin/install_megadrivers.py`. For this issue, on my system, this output from `xbps-src install` step seems relevant (full `xbps-src` install log [here](https://gist.github.com/ackalker/8377b789b50ee6e3b17ccb642e040dd1)): ``` Running custom install script '/usr/bin/python3 /builddir/mesa-19.1.1/bin/install_megadrivers.py /builddir/mesa-19.1.1/build/src/gallium/targets/vdpau/libvdpau_gallium.so.1.0.0 lib/vdpau libvdpau_r300.so.1.0.0 libvdpau_r600.so.1.0.0 libvdpau_radeonsi.so.1.0.0 libvdpau_nouveau.so.1.0.0' ``` This results in a bunch of symlinks, including `libvdpau_nouveau.so.1.0.0`, all eventually leading to `libvdpau_gallium.so.1.0.0`. It appears that `xbps-src`'s `common/hooks/post-install/06-strip-and-debug-pkgs.sh` doesn't handle these correctly.
[-- Attachment #1: Type: text/plain, Size: 229 bytes --] New comment by st3r4g on void-packages repository https://github.com/void-linux/void-packages/issues/12760#issuecomment-540189552 Comment: The fact that these megadrivers get split into different subpackages complicate this...
[-- Attachment #1: Type: text/plain, Size: 230 bytes --] New comment by st3r4g on void-packages repository https://github.com/void-linux/void-packages/issues/12760#issuecomment-540189552 Comment: The fact that these megadrivers get split into different subpackages complicates this...
[-- Attachment #1: Type: text/plain, Size: 717 bytes --] New comment by st3r4g on void-packages repository https://github.com/void-linux/void-packages/issues/12760#issuecomment-546682897 Comment: @ackalker you can test my branch if you like and see if it updates successfully and solves the issue: 1. checkout branch and build libGL 2. `xi -u` 3. additionally install `mesa-vdpau` with `xi` because it is now an optional subpackage, and also install the debug symbols To revert to the initial state in case something goes wrong: 1. `xbps-remove -F mesa-classic-dri mesa-gallium-dri mesa-vdpau` 2. `xbps-install -f <updated-pkgs>` where `<updated-pkgs>` are the packages updated in previous step 2) and can be obtained by something like `xilog | grep 19.2.2_2`
[-- Attachment #1: Type: text/plain, Size: 200 bytes --] New comment by xtraeme on void-packages repository https://github.com/void-linux/void-packages/issues/12760#issuecomment-546683110 Comment: I'm really interested on this one... I'll test myself :-)
[-- Attachment #1: Type: text/plain, Size: 188 bytes --] New comment by st3r4g on void-packages repository https://github.com/void-linux/void-packages/issues/12760#issuecomment-569520418 Comment: @xtraeme should be fixed by the reorganization
[-- Attachment #1: Type: text/plain, Size: 4697 bytes --] Closed issue by ackalker on void-packages repository https://github.com/void-linux/void-packages/issues/12760 Description: ### System * xuname: Void 5.1.15_1 x86_64 GenuineIntel uptodate rrrrmdFFFFFFFFF * package: mesa-nouveau-dri-dbg-19.1.1_1 ### Expected behavior `gdb` should load debug symbols for the right file, i.e. `/usr/lib/debug/vdpau/libvdpau_nouveau.so.1` should match `/usr/lib/vdpau/libvdpau_nouveau.so.1`, etc., backtrace should contain symbols for all loaded libraries, etc. ### Actual behavior `gdb` gives debug information mismatch warning, backtrace is missing details ### Steps to reproduce the behavior (trying to debug void-linux/void-packages#12717) * On a system using `nouveau` X graphics driver and `gdb` installed, run the following in a terminal: ```sh # xbps-install vdpauinfo{,-dbg} glibc-dbg mesa-nouveau-dri-dbg ``` * Run `vdpauinfo` under GDB Results on my system: ```sh $ gdb -q vdpauinfo Reading symbols from vdpauinfo... Reading symbols from /usr/lib/debug//usr/bin/vdpauinfo... (gdb) set pagination off (gdb) run Starting program: /usr/bin/vdpauinfo [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". display: :0 screen: 0 warning: the debug information found in "/usr/lib/vdpau/libvdpau_r300.so.1.0.0" does not match "/usr/lib/vdpau/libvdpau_nouveau.so.1" (CRC mismatch). warning: the debug information found in "/usr/lib/vdpau/libvdpau_r300.so.1.0.0" does not match "/usr/lib/vdpau/libvdpau_nouveau.so.1" (CRC mismatch). [New Thread 0x7fffefbda700 (LWP 11586)] Thread 1 "vdpauinfo" received signal SIGSEGV, Segmentation fault. 0x00007ffff72b2937 in ?? () from /usr/lib/vdpau/libvdpau_nouveau.so.1 (gdb) bt full #0 0x00007ffff72b2937 in ?? () from /usr/lib/vdpau/libvdpau_nouveau.so.1 No symbol table info available. #1 0x00007ffff72c1696 in ?? () from /usr/lib/vdpau/libvdpau_nouveau.so.1 No symbol table info available. #2 0x00007ffff7288210 in ?? () from /usr/lib/vdpau/libvdpau_nouveau.so.1 No symbol table info available. #3 0x00007ffff72882bf in ?? () from /usr/lib/vdpau/libvdpau_nouveau.so.1 No symbol table info available. #4 0x00007ffff72b0deb in ?? () from /usr/lib/vdpau/libvdpau_nouveau.so.1 No symbol table info available. #5 0x00007ffff72859b7 in ?? () from /usr/lib/vdpau/libvdpau_nouveau.so.1 No symbol table info available. #6 0x00007ffff72ddceb in ?? () from /usr/lib/vdpau/libvdpau_nouveau.so.1 No symbol table info available. #7 0x00007ffff72e5dac in ?? () from /usr/lib/vdpau/libvdpau_nouveau.so.1 No symbol table info available. #8 0x00007ffff70034f3 in ?? () from /usr/lib/vdpau/libvdpau_nouveau.so.1 No symbol table info available. #9 0x00007ffff6ffcf2a in ?? () from /usr/lib/vdpau/libvdpau_nouveau.so.1 No symbol table info available. #10 0x00007ffff6fecdcb in vdp_imp_device_create_x11 () from /usr/lib/vdpau/libvdpau_nouveau.so.1 No symbol table info available. #11 0x00007ffff7e6daf5 in vdp_device_create_x11 () from /usr/lib/libvdpau.so.1 No symbol table info available. #12 0x00005555555554ad in main (argc=<optimized out>, argv=0x7fffffffe198) at vdpauinfo.cpp:488 o = { display_name = 0x7fffffffeb53 ":0", screen = <optimized out> } display = 0x55555576ce70 screen = 0 device = 1 get_proc_address = 0x1 rv = <optimized out> impl = <optimized out> (gdb) ``` Running `objdump -g` on the debug information file confirms the incorrect link: ```sh $ objdump -g /usr/lib/debug/usr/lib/vdpau/libvdpau_nouveau.so.1.0.0 /usr/lib/debug/usr/lib/vdpau/libvdpau_nouveau.so.1.0.0: file format elf64-x86-64 objdump: Warning: could not find separate debug file 'libvdpau_r300.so.1.0.0' objdump: Warning: tried: /lib/debug/libvdpau_r300.so.1.0.0 objdump: Warning: tried: /usr/lib/debug/usr/libvdpau_r300.so.1.0.0 objdump: Warning: tried: /usr/lib/debug/libvdpau_r300.so.1.0.0 objdump: Warning: tried: /usr/lib/debug/usr/lib/vdpau/.debug/libvdpau_r300.so.1.0.0 objdump: Warning: tried: /usr/lib/debug/usr/lib/vdpau/libvdpau_r300.so.1.0.0 objdump: Warning: tried: .debug/libvdpau_r300.so.1.0.0 objdump: Warning: tried: libvdpau_r300.so.1.0.0 Section '.eh_frame' has an invalid size: 0x8bfb0. Contents of the .gnu_debuglink section (loaded from /usr/lib/debug/usr/lib/vdpau/libvdpau_nouveau.so.1.0.0): Separate debug info file: libvdpau_r300.so.1.0.0 CRC value: 0x69940ea ``` My guess is that something went wrong during build or packaging. I haven't looked into it, so I don't know if the problem is with the recipe or with `xbps-src` itself.