[llvm-bugs] [Bug 45746] New: LLD sometimes nondeterministically swaps _end and _edata in the string table

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Apr 29 13:17:26 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=45746

            Bug ID: 45746
           Summary: LLD sometimes nondeterministically swaps _end and
                    _edata in the string table
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: thomasanderson at google.com
                CC: llvm-bugs at lists.llvm.org, smithp352 at googlemail.com

Issue description on Chromium bug tracker:
https://bugs.chromium.org/p/chromium/issues/detail?id=1076277#c6

Repro steps:
1. In a Linux Chromium checkout, generate build files with the following gn
args:
    is_component_build = true
    is_debug = true
    symbol_level = 1
2. Build libevents_base.so
3. Move libevents_base.so to libevents_base.so.bak
4. Apply patch:
   https://chromium-review.googlesource.com/c/chromium/src/+/2164245
5. Build libevents_base.so again
6. Diff libevents_base.so and libevents_base.so.bak:
   0x820     : b51a000010001700101502000000000000000000000000005500000012000b00
'........................U.......'
               bc1a000010001700101502000000000000000000000000005500000012000b00
'........................U.......'
                ^
   0xbc0     : 9701000000000000ba1a00001000160090fe0100000000000000000000000000
'................................'
               9701000000000000b51a00001000160090fe0100000000000000000000000000
'................................'
                                ^
   0x31e0    : 005f656e64005f6564617461005f5f6273735f7374617274006c69626d2e736f
'._end._edata.__bss_start.libm.so'
               005f6564617461005f656e64005f5f6273735f7374617274006c69626d2e736f
'._edata._end.__bss_start.libm.so'
                             ++++++++++                                        
        +++++
   0x2e9e0   : 287c000012000000000000000000000000000000000000002f7c000010001700
'(|....................../|......'
               287c000012000000000000000000000000000000000000002f7c000010001600
'(|....................../|......'
                                                                            ^
   0x2ea00   : 10150200000000000000000000000000347c00001000160090fe010000000000
'................4|..............'
               90fe0100000000000000000000000000367c0000100017001015020000000000
'................6|..............'
               ^^^^                             ^           ^  ^  +++          
                 ^
   0x367a0   : 6e7600737472636d70005f656e64005f6564617461005f5f6273735f73746172
'nv.strcmp._end._edata.__bss_star'
               6e7600737472636d70005f6564617461005f656e64005f5f6273735f73746172
'nv.strcmp._edata._end.__bss_star'
                                        ^ ++ ++       ++                       
                 +++++

It looks like the only change is _edata and _end have swapped places in the
string table (and the pointers to them have therefore swapped as well).  All of
the libraries on the link line are the same except for libkeycodes_x11.so, but
this library has the same SONAME and symbol table before/after the patch so it
should not affect libevents_base.so.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200429/1e8693bf/attachment.html>


More information about the llvm-bugs mailing list