Skip to content

compile with asan:global-buffer-overflow #1386

@CR7-source

Description

@CR7-source

After compiling program at commit 68b0b6d(latest) with below options, it reports global-buffer-overflow at Dkernel.c, when I start virtuoso-t.
However, with the same options at commit 06e00b6, it can start virtuoso-t successfully.

export ASAN_OPTIONS="halt_on_error=1:abort_on_error=1:detect_leaks=0"

export CFLAGS="-g -O0 -fno-omit-frame-pointer -fsanitize=address"
export CXXFLAGS="-g -O0 -fno-omit-frame-pointer -fsanitize=address"
export LDFLAGS="-fsanitize=address"

 ./configure \
  --enable-debug \
  --disable-optimize \
  --with-debug
Thu Jan 22 2026
02:46:27 NumberOfBuffers=10000
02:46:27 MaxDirtyBuffers=6000
=================================================================
==878483==ERROR: AddressSanitizer: global-buffer-overflow on address 0x555b1e21139f at pc 0x555b1cd7cd28 bp 0x7ffed6115870 sp 0x7ffed6115860
READ of size 1 at 0x555b1e21139f thread T0
    #0 0x555b1cd7cd27 in find_service /home/virtuoso-opensource/libsrc/Dk/Dkernel.c:343
    #1 0x555b1cd974df in PrpcRegisterService /home/virtuoso-opensource/libsrc/Dk/Dkernel.c:3221
    #2 0x555b1cd97a0c in PrpcRegisterServiceDescPostProcess /home/virtuoso-opensource/libsrc/Dk/Dkernel.c:3246
    #3 0x555b1cd9b661 in PrpcInitialize1 /home/virtuoso-opensource/libsrc/Dk/Dkernel.c:3839
    #4 0x555b1b775de0 in srv_global_init /home/virtuoso-opensource/libsrc/Wi/sqlsrv.c:4075
    #5 0x555b1a7c9081 in main /home/virtuoso-opensource/binsrc/virtuoso/viunix.c:678
    #6 0x7fdd11108d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)
    #7 0x7fdd11108e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f)
    #8 0x555b1a7b5d94 in _start (/usr/local/virtuoso-opensource/bin/virtuoso-t+0x3d27d94)

0x555b1e21139f is located 1 bytes to the left of global variable '*.LC61' defined in 'Dkernel.c' (0x555b1e2113a0) of size 22
  '*.LC61' is ascii string 'caller_identification'
0x555b1e21139f is located 58 bytes to the right of global variable '*.LC60' defined in 'Dkernel.c' (0x555b1e211360) of size 5
  '*.LC60' is ascii string ' %ld'
SUMMARY: AddressSanitizer: global-buffer-overflow /home/virtuoso-opensource/libsrc/Dk/Dkernel.c:343 in find_service
Shadow bytes around the buggy address:
  0x0aabe3c3a220: f9 f9 f9 f9 05 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
  0x0aabe3c3a230: 00 05 f9 f9 f9 f9 f9 f9 00 00 00 00 05 f9 f9 f9
  0x0aabe3c3a240: f9 f9 f9 f9 00 00 00 00 00 00 00 05 f9 f9 f9 f9
  0x0aabe3c3a250: 00 00 00 00 00 00 00 00 00 00 00 00 07 f9 f9 f9
  0x0aabe3c3a260: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 05 f9 f9 f9
=>0x0aabe3c3a270: f9 f9 f9[f9]00 00 06 f9 f9 f9 f9 f9 00 00 00 00
  0x0aabe3c3a280: 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00
  0x0aabe3c3a290: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 f9
  0x0aabe3c3a2a0: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00
  0x0aabe3c3a2b0: 00 00 00 00 00 05 f9 f9 f9 f9 f9 f9 00 00 00 00
  0x0aabe3c3a2c0: 00 02 f9 f9 f9 f9 f9 f9 02 f9 f9 f9 f9 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==878483==ABORTING

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions