Dear colleagues, I encountered the following 'weird' segmentation fault in kodi-test on mipsel/mips64el: https://buildd.debian.org/status/fetch.php?pkg=kodi&arch=mips64el&ver=2%3A18.8%2Bdfsg1-2&stamp=1599185930&raw=0 https://buildd.debian.org/status/fetch.php?pkg=kodi&arch=mipsel&ver=2%3A18.8%2Bdfsg1-2&stamp=1599180572&raw=0 and found out that the issue is the ld.gold usage. I created a minimal reproducer with only one failing test group and ran it against gdb. The reproducer code is attached as a git-am style patch over clean git repo. Also the binaries linked with bfd and gold are attached and the DWARF2 dumps made with 'llvm-dwarfdump-10 --all'. The gdb script and its output are also attached to this message. The root cause if an issue is that language-specific data (LSDA) pointer (the structure pointing to exception handler) is incorrectly encoded as an absolute pointer if ld.gold is used, and correctly encoded if linking is done with ld.bfd (see gdb script and gdb trace files) In 'llvm-dwarfdump-10' output, the correctly-linked binary has CIE structure with 'zPLR' augmentation followed by augmentation data encoded with type 0x1B: 0000014c 00000018 ffffffff CIE Version: 1 Augmentation: "zPLR" Code alignment factor: 1 Data alignment factor: -4 Return address column: 31 Personality Address: 000000000001d281 Augmentation data: 9B 81 D2 01 00 ->1B<- 1B DW_CFA_def_cfa_register: reg29 DW_CFA_nop: 00000168 0000002c 00000020 FDE cie=00000020 pc=fffa05b4...fffa06e0 LSDA Address: 00000000000190c3 DW_CFA_advance_loc: 16 DW_CFA_def_cfa_offset: +40 DW_CFA_advance_loc: 16 DW_CFA_offset: reg31 -4 DW_CFA_offset: reg30 -8 DW_CFA_offset: reg17 -12 DW_CFA_offset: reg16 -16 DW_CFA_advance_loc: 4 The ld.gold, however, encodes the CIE as absolute pointer: 00004fcc 00000018 ffffffff CIE Version: 1 Augmentation: "zPLR" Code alignment factor: 1 Data alignment factor: -4 Return address column: 31 Personality Address: 00000000000a0014 Augmentation data: 80 14 00 0A 00 ->00<- 0B DW_CFA_def_cfa_register: reg29 DW_CFA_nop: 00004fe8 0000002c 00000020 FDE cie=00000020 pc=000218d8...00021a04 LSDA Address: 00000000000a0034 DW_CFA_advance_loc: 16 DW_CFA_def_cfa_offset: +40 DW_CFA_advance_loc: 16 DW_CFA_offset: reg31 -4 DW_CFA_offset: reg30 -8 DW_CFA_offset: reg17 -12 DW_CFA_offset: reg16 -16 DW_CFA_advance_loc: 4 Rebuilding with 'gcc -fuse-ld=bfd' fixes the particular issue but overall it is not a solution because linking Kodi fails on memory exhausted. Vasyl
lowering the severity, please use the BFD linker if possible, CCing to the mips porters.
Hi Matthias! Unfortunately Octeon boards with 8GB dont play well with bfd - bfd fails allocating memory and exits with "memory exhausted" error. How should I act further? Should I file a ticket on sourceware bugzilla or send a message to their mailing list or do different things?
I have filed an upstream bug with the reproducer & its build artifacts: https://sourceware.org/bugzilla/show_bug.cgi?id=26609 -- Vasyl Gello ================================================== Certified SolidWorks Expert Mob.:+380 (98) 465 66 77 E-Mail: vasek.gello@gmail.com Skype: vasek.gello ================================================== 호랑이는 죽어서 가죽을 남기고 사람은 죽어서 이름을 남긴다
Please ask the mips porters how to proceed.
Hi Matthias! September 14, 2020 12:03:55 PM UTC, Matthias Klose <doko@debian.org> написав(-ла): Now Kodi is being built with ld.lld as linker on eller, and the results will be there in several hours. -- Vasyl Gello ================================================== Certified SolidWorks Expert Mob.:+380 (98) 465 66 77 E-Mail: vasek.gello@gmail.com Skype: vasek.gello ================================================== 호랑이는 죽어서 가죽을 남기고 사람은 죽어서 이름을 남긴다
Building with ld.lld exhausts threads, building with ld.bfd exhausts memory… So the only option is to wait for resolution of bug upstream, I guess… -- Vasyl Gello ================================================== Certified SolidWorks Expert Mob.:+380 (98) 465 66 77 E-Mail: vasek.gello@gmail.com Skype: vasek.gello ================================================== 호랑이는 죽어서 가죽을 남기고 사람은 죽어서 이름을 남긴다