[PATCH] D86923: [llvm-readobj/elf] - Don't crash when the size of a dynamic symbol table, inferred from the hash table, is broken.
Petr Hosek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 22 00:20:50 PDT 2020
phosek added a comment.
In D86923#2287049 <https://reviews.llvm.org/D86923#2287049>, @phosek wrote:
> In D86923#2276286 <https://reviews.llvm.org/D86923#2276286>, @grimar wrote:
>
>> In D86923#2275328 <https://reviews.llvm.org/D86923#2275328>, @thakis wrote:
>>
>>> Looks like this breaks tests on mac: http://45.33.8.238/mac/20491/step_11.txt
>>>
>>> Please take a look and revert for now if it takes a while to fix.
>>
>> Thanks for letting me know. Fixed in rGef4851742de5e64a1ba9de51e375ac503d2d7ecb <https://reviews.llvm.org/rGef4851742de5e64a1ba9de51e375ac503d2d7ecb>.
>
> We're still seeing a failure on macOS:
>
> /b/s/w/ir/k/llvm-project/llvm/test/tools/llvm-readobj/ELF/dyn-symbols-size-from-hash-table.test:356:23: error: BROKEN-NCHAIN-LLVM: expected string not found in input
> # BROKEN-NCHAIN-LLVM: {{^}}[[#%u, FILESIZE:]]
> ^
> /b/s/w/ir/k/staging/llvm_build/test/tools/llvm-readobj/ELF/Output/dyn-symbols-size-from-hash-table.test.tmp4.out.llvm.txt:1:2: note: scanning from here
> 840 /b/s/w/ir/k/staging/llvm_build/test/tools/llvm-readobj/ELF/Output/dyn-symbols-size-from-hash-table.test.tmp4.1
> ^
> /b/s/w/ir/k/staging/llvm_build/test/tools/llvm-readobj/ELF/Output/dyn-symbols-size-from-hash-table.test.tmp4.out.llvm.txt:13:5: note: possible intended match here
> Name: (0)
> ^
>
> Input file: /b/s/w/ir/k/staging/llvm_build/test/tools/llvm-readobj/ELF/Output/dyn-symbols-size-from-hash-table.test.tmp4.out.llvm.txt
> Check file: /b/s/w/ir/k/llvm-project/llvm/test/tools/llvm-readobj/ELF/dyn-symbols-size-from-hash-table.test
>
> -dump-input=help explains the following input dump.
>
> Input was:
> <<<<<<
> 1: 840 /b/s/w/ir/k/staging/llvm_build/test/tools/llvm-readobj/ELF/Output/dyn-symbols-size-from-hash-table.test.tmp4.1
> check:356'0 X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
> 2: /b/s/w/ir/k/staging/llvm_build/bin/llvm-readobj: warning: '/b/s/w/ir/k/staging/llvm_build/test/tools/llvm-readobj/ELF/Output/dyn-symbols-size-from-hash-table.test.tmp4.1': hash table nchain (4294967295) differs from symbol count derived from SHT_DYNSYM section header (1)
> check:356'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 3: /b/s/w/ir/k/staging/llvm_build/bin/llvm-readobj: warning: '/b/s/w/ir/k/staging/llvm_build/test/tools/llvm-readobj/ELF/Output/dyn-symbols-size-from-hash-table.test.tmp4.1': the size (0x17ffffffe8) of the dynamic symbol table at 0xf0, derived from the hash table, goes past the end of the file (0x348) and will be ignored
> check:356'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 4:
> check:356'0 ~
> 5: File: /b/s/w/ir/k/staging/llvm_build/test/tools/llvm-readobj/ELF/Output/dyn-symbols-size-from-hash-table.test.tmp4.1
> check:356'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 6: Format: elf64-x86-64
> check:356'0 ~~~~~~~~~~~~~~~~~~~~
> 7: Arch: x86_64
> check:356'0 ~~~~~~~~~~~~
> 8: AddressSize: 64bit
> check:356'0 ~~~~~~~~~~~~~~~~~~
> 9: LoadName:
> check:356'0 ~~~~~~~~~~
> 10: Sections [
> check:356'0 ~~~~~~~~~~
> 11: Section {
> check:356'0 ~~~~~~~~~~
> 12: Index: 0
> check:356'0 ~~~~~~~~~
> 13: Name: (0)
> check:356'0 ~~~~~~~~~~
> check:356'1 ? possible intended match
> 14: Type: SHT_NULL (0x0)
> check:356'0 ~~~~~~~~~~~~~~~~~~~~~
> 15: Flags [ (0x0)
> check:356'0 ~~~~~~~~~~~~~~
> 16: ]
> check:356'0 ~~
> 17: Address: 0x0
> check:356'0 ~~~~~~~~~~~~~
> 18: Offset: 0x0
> check:356'0 ~~~~~~~~~~~~
> .
> .
> .
> >>>>>>
Never mind, looks like rGef4851742de5e64a1ba9de51e375ac503d2d7ecb <https://reviews.llvm.org/rGef4851742de5e64a1ba9de51e375ac503d2d7ecb> addressed it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86923/new/
https://reviews.llvm.org/D86923
More information about the llvm-commits
mailing list