Re: [bcachefs:header_cleanup 21/51] /bin/bash: line 1: 19420 Segmentation fault LLVM_OBJCOPY="llvm-objcopy" pahole -J --btf_gen_floats -j --lang_exclude=rust --skip_encoding_btf_inconsistent_proto --btf_gen_optimized --btf_base vmlinux drivers/misc/eeprom/at24.ko

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Em Thu, Dec 28, 2023 at 10:34:04AM -0700, Nathan Chancellor escreveu:
> On Thu, Dec 28, 2023 at 11:21:06AM -0300, Arnaldo Carvalho de Melo wrote:
> > Em Wed, Dec 27, 2023 at 03:43:38PM -0700, Nathan Chancellor escreveu:
> > > I do not get a segfault personally but there are definitely a lot of
> > > errors from pahole at the end. Arnaldo, is pahole not handling something
> > > that it should with regards to clang's debug info?

> > Possibly, would it be possible to provide the vmlinux file where pahole
> > is segfaulting when trying to encode BTF from DWARF?

> > These two files:

> > vmlinux drivers/misc/eeprom/at24.ko

> > So that I can run:
> > LLVM_OBJCOPY="llvm-objcopy" pahole -J --btf_gen_floats -j --lang_exclude=rust --skip_encoding_btf_inconsistent_proto --btf_gen_optimized --btf_base vmlinux drivers/misc/eeprom/at24.ko
 
> Sure, here you go:
 
> https://1drv.ms/u/s!AsQNYeB-IEbqqAilUuGHOU8BMLbf
 
> If you need more objects, just let me know. That series of commands in
> the previous email should also get them for you locally if you need all
> of them or want to investigate more.

llvm-dwarfdump is the only that is managing to process this file on a
fedora:39 system, more work needed to figure out if this is something
elfutils is planning to support, what amount of work would be necessary,
etc.

Mark, do you know about work on elfutils to support:

⬢[acme@toolbox hexagon-randconfig-r005-20220913-pahole-crash]$ llvm-dwarfdump at24.ko | head -22
at24.ko:        file format elf32-hexagon

.debug_info contents:
0x00000000: Compile Unit: length = 0x0000c634, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = 0x0000, addr_size = 0x04 (next unit at 0x0000c638)

Cheers,

- Arnaldo

⬢[acme@toolbox hexagon-randconfig-r005-20220913-pahole-crash]$ eu-readelf --version
eu-readelf (elfutils) 0.190
Copyright (C) 2023 The elfutils developers <http://elfutils.org/>.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
⬢[acme@toolbox hexagon-randconfig-r005-20220913-pahole-crash]

⬢[acme@toolbox hexagon-randconfig-r005-20220913-pahole-crash]$ eu-readelf -winfo at24.ko  > /dev/null
eu-readelf: DIE [c644] cannot get attribute 'addr_base' (sec_offset) value: invalid offset
eu-readelf: DIE [c644] cannot get attribute 'rnglists_base' (sec_offset) value: invalid offset
eu-readelf: DIE [c644] cannot get attribute 'loclists_base' (sec_offset) value: invalid offset
eu-readelf: DIE [c674] cannot get attribute 'name' (strx2) value: invalid offset
eu-readelf: DIE [c67e] cannot get attribute 'name' (strx2) value: invalid offset
eu-readelf: DIE [c689] cannot get attribute 'type' (ref4) value: invalid DWARF
eu-readelf: DIE [c697] cannot get attribute 'str_offsets_base' (sec_offset) value: invalid offset
eu-readelf: DIE [c697] cannot get attribute 'stmt_list' (sec_offset) value: invalid offset
eu-readelf: DIE [c697] cannot get attribute 'addr_base' (sec_offset) value: invalid offset
eu-readelf: DIE [c697] cannot get attribute 'rnglists_base' (sec_offset) value: invalid offset
eu-readelf: DIE [c697] cannot get attribute 'loclists_base' (sec_offset) value: invalid offset
eu-readelf: DIE [c6bb] cannot get attribute 'type' (ref4) value: invalid DWARF
eu-readelf: DIE [c6c3] cannot get attribute 'type' (ref4) value: invalid DWARF
eu-readelf: DIE [c6db] cannot get attribute 'type' (ref4) value: invalid DWARF
eu-readelf: DIE [c6e5] cannot get attribute 'str_offsets_base' (sec_offset) value: invalid offset
eu-readelf: DIE [c6e5] cannot get attribute 'stmt_list' (sec_offset) value: invalid offset
eu-readelf: DIE [c6e5] cannot get attribute 'addr_base' (sec_offset) value: invalid offset
eu-readelf: DIE [c6e5] cannot get attribute 'rnglists_base' (sec_offset) value: invalid offset
eu-readelf: DIE [c6e5] cannot get attribute 'loclists_base' (sec_offset) value: invalid offset
eu-readelf: DIE [c704] cannot get attribute 'name' (strx2) value: invalid offset
eu-readelf: DIE [c70e] cannot get attribute 'name' (strx2) value: invalid offset
eu-readelf: DIE [c75c] cannot get attribute 'name' (strx2) value: invalid offset
eu-readelf: DIE [c762] cannot get attribute 'type' (ref4) value: invalid DWARF
eu-readelf: DIE [c767] cannot get attribute 'type' (ref4) value: invalid DWARF
eu-readelf: DIE [c773] cannot get attribute 'type' (ref4) value: invalid DWARF
eu-readelf: DIE [c778] cannot get attribute 'str_offsets_base' (sec_offset) value: invalid offset
eu-readelf: DIE [c778] cannot get attribute 'stmt_list' (sec_offset) value: invalid offset
eu-readelf: DIE [c778] cannot get attribute 'addr_base' (sec_offset) value: invalid offset
eu-readelf: DIE [c778] cannot get attribute 'rnglists_base' (sec_offset) value: invalid offset
eu-readelf: DIE [c778] cannot get attribute 'loclists_base' (sec_offset) value: invalid offset
eu-readelf: DIE [c797] cannot get attribute 'stmt_list' (sec_offset) value: invalid offset
eu-readelf: DIE [c797] cannot get attribute 'addr_base' (sec_offset) value: invalid offset
eu-readelf: DIE [c797] cannot get attribute 'rnglists_base' (sec_offset) value: invalid offset
eu-readelf: DIE [c7b6] cannot get attribute 'type' (ref4) value: invalid DWARF
eu-readelf: DIE [c7c1] cannot get attribute 'type' (ref4) value: invalid DWARF
eu-readelf: DIE [c7c6] cannot get attribute 'type' (ref4) value: invalid DWARF
eu-readelf: DIE [c7cc] cannot get attribute 'type' (ref4) value: invalid DWARF
eu-readelf: DIE [c7d7] cannot get attribute 'type' (ref4) value: invalid DWARF
eu-readelf: cannot get tag of DIE at offset [c7de] in section '.debug_info': invalid DWARF
⬢[acme@toolbox hexagon-randconfig-r005-20220913-pahole-crash]$


⬢[acme@toolbox hexagon-randconfig-r005-20220913-pahole-crash]$ readelf --version
GNU readelf version 2.40-13.fc39
Copyright (C) 2023 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
⬢[acme@toolbox hexagon-randconfig-r005-20220913-pahole-crash]$

⬢[acme@toolbox hexagon-randconfig-r005-20220913-pahole-crash]$ readelf -wi at24.ko  > /dev/null
readelf: at24.ko: Error: Missing knowledge of 32-bit reloc types used in DWARF sections of machine number 164
readelf: at24.ko: Warning: unable to apply unsupported reloc type 6 to section .debug_info
readelf: at24.ko: Warning: string index of 10 converts to an offset of 0x2000028 which is too big for section .debug_strreadelf: at24.ko: Warning: CU @ 0xc638 has multiple rnglists_base values (0x40e0000 and 0x7e09)readelf: at24.ko: Warning: CU @ 0xc638 has multiple loclists_base values (0x300a102 and 0xd020800)readelf: at24.ko: Warning: CU @ 0xc638 has multiple str_offsets_base values 0x2000000 and 0xf000000)readelf: at24.ko: Warning: string index of 3 converts to an offset of 0xf00000c which is too big for section .debug_strreadelf: at24.ko: Warning: CU @ 0xc638 has multiple rnglists_base values (0x7e09 and 0x5104)readelf: at24.ko: Warning: CU @ 0xc638 has multiple loclists_base values (0xd020800 and 0xf0000)readelf: at24.ko: Warning: CU @ 0xc638 has multiple str_offsets_base values 0xf000000 and 0x3000003)readelf: at24.ko: Warning: string index of 33 converts to an offset of 0x3000087 which is too big for section .debug_strreadelf: at24.ko: Warning: CU @ 0xc638 has multiple rnglists_base values (0x5104 and 0x2d000312)readelf: at24.ko: Warning: CU @ 0xc638 has multiple loclists_base values (0xf0000 and 0xa2030000)readelf: at24.ko: Warning: CU @ 0xc638 has multiple str_offsets_base values 0x3000003 and 0x452)readelf: at24.ko: Warning: CU @ 0xc638 has multiple rnglists_base values (0x2d000312 and 0x3191084)readelf: at24.ko: Warning: CU @ 0xc638 has multiple loclists_base values (0xa2030000 and 0x457)readelf: at24.ko: Warning: DIE at offset 0xc7de refers to abbreviation number 5568 which does not exist
readelf: at24.ko: Warning: loc_offset 0 too big
readelf: at24.ko: Warning: loc_offset 1 too big
readelf: at24.ko: Warning: loc_offset 2 too big
readelf: at24.ko: Warning: loc_offset 3 too big
readelf: at24.ko: Warning: loc_offset 4 too big
readelf: at24.ko: Warning: loc_offset 5 too big
readelf: at24.ko: Warning: loc_offset 6 too big
readelf: at24.ko: Warning: loc_offset 7 too big
readelf: at24.ko: Warning: loc_offset 8 too big
readelf: at24.ko: Warning: loc_offset 9 too big
readelf: at24.ko: Warning: loc_offset 10 too big
readelf: at24.ko: Warning: loc_offset 11 too big
readelf: at24.ko: Warning: loc_offset 12 too big
readelf: at24.ko: Warning: loc_offset 13 too big
readelf: at24.ko: Warning: loc_offset 14 too big
readelf: at24.ko: Warning: loc_offset 15 too big
readelf: at24.ko: Warning: loc_offset 16 too big
readelf: at24.ko: Warning: loc_offset 17 too big
readelf: at24.ko: Warning: loc_offset 18 too big
readelf: at24.ko: Warning: loc_offset 19 too big
readelf: at24.ko: Warning: loc_offset 20 too big
readelf: at24.ko: Warning: loc_offset 21 too big
readelf: at24.ko: Warning: loc_offset 22 too big
readelf: at24.ko: Warning: loc_offset 23 too big
readelf: at24.ko: Warning: loc_offset 24 too big
readelf: at24.ko: Warning: loc_offset 27 too big
readelf: at24.ko: Warning: loc_offset 28 too big
readelf: at24.ko: Warning: loc_offset 29 too big
readelf: at24.ko: Warning: loc_offset 30 too big
readelf: at24.ko: Warning: loc_offset 31 too big
readelf: at24.ko: Warning: loc_offset 32 too big
readelf: at24.ko: Warning: loc_offset 33 too big
readelf: at24.ko: Warning: loc_offset 34 too big
readelf: at24.ko: Warning: loc_offset 35 too big
readelf: at24.ko: Warning: loc_offset 41 too big
readelf: at24.ko: Warning: loc_offset 40 too big
readelf: at24.ko: Warning: loc_offset 36 too big
readelf: at24.ko: Warning: loc_offset 37 too big
readelf: at24.ko: Warning: loc_offset 38 too big
readelf: at24.ko: Warning: loc_offset 39 too big
readelf: at24.ko: Warning: loc_offset 46 too big
readelf: at24.ko: Warning: loc_offset 45 too big
readelf: at24.ko: Warning: loc_offset 44 too big
readelf: at24.ko: Warning: loc_offset 47 too big
readelf: at24.ko: Warning: loc_offset 48 too big
readelf: at24.ko: Warning: loc_offset 49 too big
readelf: at24.ko: Warning: loc_offset 50 too big
readelf: at24.ko: Warning: loc_offset 51 too big
readelf: at24.ko: Warning: loc_offset 52 too big
readelf: at24.ko: Warning: loc_offset 53 too big
readelf: at24.ko: Warning: loc_offset 54 too big
readelf: at24.ko: Warning: loc_offset 55 too big
readelf: at24.ko: Warning: loc_offset 56 too big
readelf: at24.ko: Warning: loc_offset 57 too big
readelf: at24.ko: Warning: loc_offset 58 too big
readelf: at24.ko: Warning: loc_offset 59 too big
readelf: at24.ko: Warning: loc_offset 60 too big
readelf: at24.ko: Warning: loc_offset 61 too big
readelf: at24.ko: Warning: loc_offset 66 too big
readelf: at24.ko: Warning: loc_offset 65 too big
readelf: at24.ko: Warning: Unable to resolve ref form: uvalue ce020c0b + cu_offset c638 > CU size 1003e
readelf: at24.ko: Warning: string index of 35340 converts to an offset of 0x22830 which is too big for section .debug_strreadelf: at24.ko: Warning: Unable to resolve ref form: uvalue 50000 + cu_offset c638 > CU size 1003e
readelf: at24.ko: Warning: string index of 40463 converts to an offset of 0x2783c which is too big for section .debug_strreadelf: at24.ko: Warning: Unable to resolve ref form: uvalue 50000 + cu_offset c638 > CU size 1003e
readelf: at24.ko: Warning: string index of 10 converts to an offset of 0x2000028 which is too big for section .debug_strreadelf: at24.ko: Warning: Offset into section .debug_rnglists too big: 0x40e0008
readelf: at24.ko: Warning: CU @ 0xc638 has multiple rnglists_base values (0x40e0000 and 0x7e09)readelf: at24.ko: Warning: CU @ 0xc638 has multiple loclists_base values (0x300a102 and 0xd020800)readelf: at24.ko: Warning: string index of 0 converts to an offset of 0x2000000 which is too big for section .debug_strreadelf: at24.ko: Warning: Unable to resolve ref form: uvalue 9a0c + cu_offset c638 > CU size 1003e
readelf: at24.ko: Warning: string index of 154 converts to an offset of 0x2000268 which is too big for section .debug_strreadelf: at24.ko: Warning: string index of 2 converts to an offset of 0x2000008 which is too big for section .debug_strreadelf: at24.ko: Warning: string index of 0 converts to an offset of 0x2000000 which is too big for section .debug_strreadelf: at24.ko: Warning: CU @ 0xc638 has multiple str_offsets_base values 0x2000000 and 0xf000000)readelf: at24.ko: Warning: string index of 3 converts to an offset of 0xf00000c which is too big for section .debug_strreadelf: at24.ko: Warning: Offset into section .debug_rnglists too big: 0x7e19
readelf: at24.ko: Warning: CU @ 0xc638 has multiple rnglists_base values (0x7e09 and 0x5104)readelf: at24.ko: Warning: CU @ 0xc638 has multiple loclists_base values (0xd020800 and 0xf0000)readelf: at24.ko: Warning: string index of 35340 converts to an offset of 0xf022830 which is too big for section .debug_strreadelf: at24.ko: Warning: Unable to resolve ref form: uvalue 50000 + cu_offset c638 > CU size 1003e
readelf: at24.ko: Warning: string index of 57615 converts to an offset of 0xf03843c which is too big for section .debug_strreadelf: at24.ko: Warning: Unable to resolve ref form: uvalue 50000 + cu_offset c638 > CU size 1003e
readelf: at24.ko: Warning: string index of 18 converts to an offset of 0xf000048 which is too big for section .debug_strreadelf: at24.ko: Warning: string index of 19 converts to an offset of 0xf00004c which is too big for section .debug_strreadelf: at24.ko: Warning: string index of 253 converts to an offset of 0xf0003f4 which is too big for section .debug_strreadelf: at24.ko: Warning: string index of 768 converts to an offset of 0xf000c00 which is too big for section .debug_strreadelf: at24.ko: Warning: string index of 20 converts to an offset of 0xf000050 which is too big for section .debug_strreadelf: at24.ko: Warning: string index of 253 converts to an offset of 0xf0003f4 which is too big for section .debug_strreadelf: at24.ko: Warning: string index of 0 converts to an offset of 0xf000000 which is too big for section .debug_strreadelf: at24.ko: Warning: string index of 1 converts to an offset of 0xf000004 which is too big for section .debug_strreadelf: at24.ko: Warning: string index of 45583 converts to an offset of 0xf02c83c which is too big for section .debug_strreadelf: at24.ko: Warning: string index of 854 converts to an offset of 0xf000d58 which is too big for section .debug_strreadelf: at24.ko: Warning: string index of 4 converts to an offset of 0xf000010 which is too big for section .debug_strreadelf: at24.ko: Warning: string index of 138 converts to an offset of 0xf000228 which is too big for section .debug_strreadelf: at24.ko: Warning: CU @ 0xc638 has multiple str_offsets_base values 0xf000000 and 0x3000003)readelf: at24.ko: Warning: string index of 33 converts to an offset of 0x3000087 which is too big for section .debug_strreadelf: at24.ko: Warning: Offset into section .debug_rnglists too big: 0x5110
readelf: at24.ko: Warning: CU @ 0xc638 has multiple rnglists_base values (0x5104 and 0x2d000312)readelf: at24.ko: Warning: CU @ 0xc638 has multiple loclists_base values (0xf0000 and 0xa2030000)readelf: at24.ko: Warning: string index of 124 converts to an offset of 0x30001f3 which is too big for section .debug_strreadelf: at24.ko: Warning: string index of 3 converts to an offset of 0x300000f which is too big for section .debug_strreadelf: at24.ko: Warning: CU @ 0xc638 has multiple str_offsets_base values 0x3000003 and 0x452)readelf: at24.ko: Warning: Offset into section .debug_rnglists too big: 0x2d000312
readelf: at24.ko: Warning: CU @ 0xc638 has multiple rnglists_base values (0x2d000312 and 0x3191084)readelf: at24.ko: Warning: CU @ 0xc638 has multiple loclists_base values (0xa2030000 and 0x457)readelf: at24.ko: Warning: DIE at offset 0xc7de refers to abbreviation number 5568 which does not exist
⬢[acme@toolbox hexagon-randconfig-r005-20220913-pahole-crash]$


But:

⬢[acme@toolbox hexagon-randconfig-r005-20220913-pahole-crash]$ llvm-dwarfdump --version
LLVM (http://llvm.org/):
  LLVM version 17.0.6
  Optimized build.
⬢[acme@toolbox hexagon-randconfig-r005-20220913-pahole-crash]$ llvm-dwarfdump at24.ko > /dev/null
⬢[acme@toolbox hexagon-randconfig-r005-20220913-pahole-crash]$

⬢[acme@toolbox hexagon-randconfig-r005-20220913-pahole-crash]$ llvm-dwarfdump at24.ko | head -22
at24.ko:	file format elf32-hexagon

.debug_info contents:
0x00000000: Compile Unit: length = 0x0000c634, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = 0x0000, addr_size = 0x04 (next unit at 0x0000c638)

0x0000000c: DW_TAG_compile_unit
              DW_AT_producer	("ClangBuiltLinux clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)")
              DW_AT_language	(DW_LANG_C11)
              DW_AT_name	("/home/nathan/cbl/src/linux/drivers/misc/eeprom/at24.c")
              DW_AT_str_offsets_base	(0x00000008)
              DW_AT_stmt_list	(0x00000000)
              DW_AT_comp_dir	("/mnt/nvme/tmp/build/linux")
              DW_AT_low_pc	(0x00000000)
              DW_AT_ranges	(indexed (0x8) rangelist = 0x00000090
                 [0x00000000, 0x00000058)
                 [0x00000000, 0x00000014)
                 [0x00000000, 0x000008a8))
              DW_AT_addr_base	(0x00000008)
              DW_AT_rnglists_base	(0x0000000c)
              DW_AT_loclists_base	(0x0000000c)

0x0000002b:   DW_TAG_variable
⬢[acme@toolbox hexagon-randconfig-r005-20220913-pahole-crash]$





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux