public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug dynamic-link/28491] New: ld.so doesn't work well with sanitizer run-time
@ 2021-10-24  0:52 hjl.tools at gmail dot com
  2021-10-24  7:35 ` [Bug dynamic-link/28491] " schwab@linux-m68k.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: hjl.tools at gmail dot com @ 2021-10-24  0:52 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28491

            Bug ID: 28491
           Summary: ld.so doesn't work well with sanitizer run-time
           Product: glibc
           Version: 2.34
            Status: NEW
          Severity: normal
          Priority: P2
         Component: dynamic-link
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com
  Target Milestone: ---

With glibc 2.34 on Fedora 35/x86-64, LLVM 13.0.0 rc1 gave me:

[hjl@gnu-skx-1 gcc]$ cat x.c
#include <assert.h>

struct A {
  char a[3];
  int b[3];
};

volatile int ten = 10;

__attribute__((noinline)) void foo(int index, int len) {
  volatile struct A str[len] __attribute__((aligned(32)));
  assert(!((long) str & 31L));
  str[index].a[0] = '1'; // BOOM
}

int main(int argc, char **argv) {
  foo(ten, ten);
  return 0;
}
[hjl@gnu-skx-1 gcc]$ clang -O0 -fsanitize=address x.c -shared-libasan -m32
[hjl@gnu-skx-1 gcc]$
LD_PRELOAD=/tmp/export-users-hjl-build-gnu-tools-build-gcc-debug-build-x86_64-linux-x86_64-pc-linux-gnu/libclang_rt.asan-i386.so
./a.out
AddressSanitizer: CHECK failed: asan_malloc_linux.cpp:46
"((allocated_for_dlsym)) < ((kDlsymAllocPoolSize))" (0x405, 0x400)
(tid=3485517)
    <empty stack>

[hjl@gnu-skx-1 gcc]$ 

depending on the directory length where libclang_rt.asan-i386.so is placed.

It also happened in GCC 12 test where libasan.so.8 is in a directory with a
long pathname.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-10-25 13:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-24  0:52 [Bug dynamic-link/28491] New: ld.so doesn't work well with sanitizer run-time hjl.tools at gmail dot com
2021-10-24  7:35 ` [Bug dynamic-link/28491] " schwab@linux-m68k.org
2021-10-24 11:55 ` hjl.tools at gmail dot com
2021-10-24 12:40 ` hjl.tools at gmail dot com
2021-10-25 13:11 ` fweimer at redhat dot com
2021-10-25 13:17 ` hjl.tools at gmail dot com
2021-10-25 13:51 ` schwab@linux-m68k.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).