with sanitizer:

$ objdump -h haproxy

haproxy:     file format elf64-x86-64

Sections:
Idx Name          Size      VMA               LMA               File off
Algn
  0 .interp       0000001c  00000000004002e0  00000000004002e0  000002e0
2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  1 .note.ABI-tag 00000020  00000000004002fc  00000000004002fc  000002fc
2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .note.gnu.build-id 00000024  000000000040031c  000000000040031c
0000031c  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  3 .gnu.hash     000062b4  0000000000400340  0000000000400340  00000340
2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .dynsym       00015918  00000000004065f8  00000000004065f8  000065f8
2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  5 .dynstr       00012388  000000000041bf10  000000000041bf10  0001bf10
2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  6 .gnu.version  00001cc2  000000000042e298  000000000042e298  0002e298
2**1
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  7 .gnu.version_r 000001d0  000000000042ff60  000000000042ff60  0002ff60
2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  8 .rela.dyn     000003f0  0000000000430130  0000000000430130  00030130
2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  9 .rela.plt     00002940  0000000000430520  0000000000430520  00030520
2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 10 .init         0000001b  0000000000433000  0000000000433000  00033000
2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 11 .plt          00001b90  0000000000433020  0000000000433020  00033020
2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 12 .text         00531882  0000000000434bb0  0000000000434bb0  00034bb0
2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 13 .fini         0000000d  0000000000966434  0000000000966434  00566434
2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 14 .rodata       000cd406  0000000000967000  0000000000967000  00567000
2**5
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 15 .eh_frame_hdr 0000a06c  0000000000a34408  0000000000a34408  00634408
2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 16 .eh_frame     00036ec8  0000000000a3e478  0000000000a3e478  0063e478
2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 17 .tdata        00000080  0000000000a77110  0000000000a77110  00676110
2**4
                  CONTENTS, ALLOC, LOAD, DATA, THREAD_LOCAL
 18 .tbss         0000a854  0000000000a77190  0000000000a77190  00676190
2**4
                  ALLOC, THREAD_LOCAL
 19 .preinit_array 00000008  0000000000a77190  0000000000a77190  00676190
2**3
                  CONTENTS, ALLOC, LOAD, DATA
 20 .init_array   000003a8  0000000000a77198  0000000000a77198  00676198
2**3
                  CONTENTS, ALLOC, LOAD, DATA
 21 .fini_array   000002f8  0000000000a77540  0000000000a77540  00676540
2**3
                  CONTENTS, ALLOC, LOAD, DATA
 22 .data.rel.ro  000003a8  0000000000a77840  0000000000a77840  00676840
2**5
                  CONTENTS, ALLOC, LOAD, DATA
 23 .dynamic      000002b0  0000000000a77be8  0000000000a77be8  00676be8
2**3
                  CONTENTS, ALLOC, LOAD, DATA
 24 .got          00000150  0000000000a77e98  0000000000a77e98  00676e98
2**3
                  CONTENTS, ALLOC, LOAD, DATA
 25 .got.plt      00000dd8  0000000000a78000  0000000000a78000  00677000
2**3
                  CONTENTS, ALLOC, LOAD, DATA
 26 .data         000825c0  0000000000a78de0  0000000000a78de0  00677de0
2**5
                  CONTENTS, ALLOC, LOAD, DATA
 27 init_STG_POOL 00000800  0000000000afb3a0  0000000000afb3a0  006fa3a0
2**5
                  CONTENTS, ALLOC, LOAD, DATA
 28 init_STG_LOCK 000002c0  0000000000afbba0  0000000000afbba0  006faba0
2**5
                  CONTENTS, ALLOC, LOAD, DATA
 29 init_STG_REGISTER 000023c0  0000000000afbe60  0000000000afbe60
006fae60  2**5
                  CONTENTS, ALLOC, LOAD, DATA
 30 init_STG_PREPARE 00000100  0000000000afe220  0000000000afe220
006fd220  2**5
                  CONTENTS, ALLOC, LOAD, DATA
 31 .bss          009c6990  0000000000afe340  0000000000afe340  006fd320
2**6
                  ALLOC
 32 .comment      00000087  0000000000000000  0000000000000000  006fd320
2**0
                  CONTENTS, READONLY
 33 .gnu.build.attributes 00038af4  00000000014c6cd0  00000000014c6cd0
006fd3a8  2**2
                  CONTENTS, READONLY
 34 .debug_info   002b4bf1  0000000000000000  0000000000000000  00735e9c
2**0
                  CONTENTS, READONLY, DEBUGGING
 35 .debug_abbrev 000142b8  0000000000000000  0000000000000000  009eaa8d
2**0
                  CONTENTS, READONLY, DEBUGGING
 36 .debug_line   001bcd73  0000000000000000  0000000000000000  009fed45
2**0
                  CONTENTS, READONLY, DEBUGGING
 37 .debug_str    0001e422  0000000000000000  0000000000000000  00bbbab8
2**0
                  CONTENTS, READONLY, DEBUGGING
 38 .debug_loc    003ef011  0000000000000000  0000000000000000  00bd9eda
2**0
                  CONTENTS, READONLY, DEBUGGING
 39 .debug_macinfo 0000006d  0000000000000000  0000000000000000  00fc8eeb
2**0
                  CONTENTS, READONLY, DEBUGGING
 40 .debug_ranges 001459c0  0000000000000000  0000000000000000  00fc8f58
2**0
                  CONTENTS, READONLY, DEBUGGING

without sanitizer:

$ objdump -h haproxy

haproxy:     file format elf64-x86-64

Sections:
Idx Name          Size      VMA               LMA               File off
Algn
  0 .interp       0000001c  00000000004002e0  00000000004002e0  000002e0
2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  1 .note.ABI-tag 00000020  00000000004002fc  00000000004002fc  000002fc
2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .note.gnu.build-id 00000024  000000000040031c  000000000040031c
0000031c  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  3 .gnu.hash     00002a9c  0000000000400340  0000000000400340  00000340
2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .dynsym       0000b3e8  0000000000402de0  0000000000402de0  00002de0
2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  5 .dynstr       000079c7  000000000040e1c8  000000000040e1c8  0000e1c8
2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  6 .gnu.version  00000efe  0000000000415b90  0000000000415b90  00015b90
2**1
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  7 .gnu.version_r 00000150  0000000000416a90  0000000000416a90  00016a90
2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  8 .rela.dyn     000002b8  0000000000416be0  0000000000416be0  00016be0
2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  9 .rela.plt     00002d48  0000000000416e98  0000000000416e98  00016e98
2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 10 .init         0000001b  000000000041a000  000000000041a000  0001a000
2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 11 .plt          00001e40  000000000041a020  000000000041a020  0001a020
2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 12 .text         00133ea2  000000000041be60  000000000041be60  0001be60
2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 13 .fini         0000000d  000000000054fd04  000000000054fd04  0014fd04
2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 14 .rodata       0003ea89  0000000000550000  0000000000550000  00150000
2**4
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 15 .eh_frame_hdr 00004b14  000000000058ea8c  000000000058ea8c  0018ea8c
2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 16 .eh_frame     0001d9b0  00000000005935a0  00000000005935a0  001935a0
2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 17 .tdata        00000080  00000000005b2bf0  00000000005b2bf0  001b1bf0
2**4
                  CONTENTS, ALLOC, LOAD, DATA, THREAD_LOCAL
 18 .tbss         0000a7f4  00000000005b2c70  00000000005b2c70  001b1c70
2**4
                  ALLOC, THREAD_LOCAL
 19 .init_array   00000038  00000000005b2c70  00000000005b2c70  001b1c70
2**3
                  CONTENTS, ALLOC, LOAD, DATA
 20 .fini_array   00000010  00000000005b2ca8  00000000005b2ca8  001b1ca8
2**3
                  CONTENTS, ALLOC, LOAD, DATA
 21 .dynamic      00000280  00000000005b2cb8  00000000005b2cb8  001b1cb8
2**3
                  CONTENTS, ALLOC, LOAD, DATA
 22 .got          000000c0  00000000005b2f38  00000000005b2f38  001b1f38
2**3
                  CONTENTS, ALLOC, LOAD, DATA
 23 .got.plt      00000f30  00000000005b3000  00000000005b3000  001b2000
2**3
                  CONTENTS, ALLOC, LOAD, DATA
 24 .data         0000f160  00000000005b3f30  00000000005b3f30  001b2f30
2**4
                  CONTENTS, ALLOC, LOAD, DATA
 25 init_STG_POOL 00000100  00000000005c3090  00000000005c3090  001c2090
2**3
                  CONTENTS, ALLOC, LOAD, DATA
 26 init_STG_LOCK 00000058  00000000005c3190  00000000005c3190  001c2190
2**3
                  CONTENTS, ALLOC, LOAD, DATA
 27 init_STG_REGISTER 00000478  00000000005c31e8  00000000005c31e8
001c21e8  2**3
                  CONTENTS, ALLOC, LOAD, DATA
 28 init_STG_PREPARE 00000020  00000000005c3660  00000000005c3660
001c2660  2**3
                  CONTENTS, ALLOC, LOAD, DATA
 29 .bss          0011cb90  00000000005c3680  00000000005c3680  001c2680
2**6
                  ALLOC
 30 .comment      00000059  0000000000000000  0000000000000000  001c2680
2**0
                  CONTENTS, READONLY
 31 .gnu.build.attributes 00001060  00000000006e2210  00000000006e2210
001c26dc  2**2
                  CONTENTS, READONLY
 32 .debug_info   002c2e36  0000000000000000  0000000000000000  001c373c
2**0
                  CONTENTS, READONLY, DEBUGGING
 33 .debug_abbrev 000148b2  0000000000000000  0000000000000000  00486572
2**0
                  CONTENTS, READONLY, DEBUGGING
 34 .debug_line   000dd30a  0000000000000000  0000000000000000  0049ae24
2**0
                  CONTENTS, READONLY, DEBUGGING
 35 .debug_str    0001e3dd  0000000000000000  0000000000000000  0057812e
2**0
                  CONTENTS, READONLY, DEBUGGING
 36 .debug_loc    00228bb9  0000000000000000  0000000000000000  0059650b
2**0
                  CONTENTS, READONLY, DEBUGGING
 37 .debug_macinfo 0000006d  0000000000000000  0000000000000000  007bf0c4
2**0
                  CONTENTS, READONLY, DEBUGGING
 38 .debug_ranges 00032110  0000000000000000  0000000000000000  007bf131
2**0
                  CONTENTS, READONLY, DEBUGGING


вс, 5 мая 2019 г. в 16:26, Willy Tarreau <w...@1wt.eu>:

> On Sun, May 05, 2019 at 03:04:22PM +0500, ???? ??????? wrote:
> > Hello,
> >
> > I run fedora 30, it includes clang-8, I built haproxy using
> >
> > make CC=clang V=1 TARGET=$TARGET $FLAGS DEBUG_CFLAGS="-fsanitize=address
> > -ggdb" LDFLAGS="-fsanitize=address"
> >
> > when running reg-tests, the following is caught
> >
> > ==6340==ERROR: AddressSanitizer: global-buffer-overflow on address
> > 0x000000ab61c8 at pc 0x0000007360f5 bp 0x7ffc56ce9f90 sp 0x7ffc56ce9f88
> > READ of size 8 at 0x000000ab61c8 thread T0
> >     #0 0x7360f4  (/home/ilia/haproxy/haproxy+0x7360f4)
> >     #1 0x7f3952660f32  (/lib64/libc.so.6+0x23f32)
> >     #2 0x434b7d  (/home/ilia/haproxy/haproxy+0x434b7d)
> >
> > 0x000000ab61c8 is located 56 bytes to the left of global variable
> > '__initcb_486' defined in 'src/task.c:486:1' (0xab6200) of size 8
> > 0x000000ab61c8 is located 0 bytes to the right of global variable
> > '__initcb_1865' defined in 'src/log.c:1865:1' (0xab61c0) of size 8
> > SUMMARY: AddressSanitizer: global-buffer-overflow
> > (/home/ilia/haproxy/haproxy+0x7360f4)
>
> This one is quite strange, it looks as if the linker had intentionally
> left holes in the init_* sections by aligning each pointer on 64 bytes.
> Maybe this is an artefact of using -fsanitize=address, though it seems
> a bit unlikely.
>
> Could you please run "objdump -h" on your haproxy executable with and
> without this build option ? I suspect we'll see "2**6" at the end of
> some init_* columns at least in one case. If so we may try to add
> "aligned(8)" or even "packed" to the attributes when declaring the
> initcalls.
>
> Thanks,
> Willy
>

Reply via email to