[Bug libc/24967] New: jemalloc static linking causes runtime failure

jiangning.liu at amperecomputing dot com sourceware-bugzilla@sourceware.org
Thu Sep 5 03:09:00 GMT 2019


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

            Bug ID: 24967
           Summary: jemalloc static linking causes runtime failure
           Product: glibc
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: jiangning.liu at amperecomputing dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

Since commit 979cfed05d0ee5a9d81d310ea1eb2d590739e36b on trunk, the case below
crashed with jemalloc static linked.

$ gcc --version
gcc_new (GCC) 10.0.0 20190903 (experimental)
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ gcc -static ./test_je.c
/home/amptest/jemalloc/jemalloc-5.2.0/install_master/lib/libjemalloc.a -pthread
-ldl -Wl,-Map,xx.map
$ ./a.out
Segmentation fault (core dumped)
$ cat test_je.c 
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
        size_t i;
        void *ptr;
        unsigned long long s = 0;

        for (i=0; i<1024*1024; i++) {
                ptr = malloc(i);
                if (!ptr) {
                        printf("Failed to allocated memory!\n");
                        return -1;
                }
                s += (unsigned long long)ptr;
                memset(ptr, 0, i);
                free(ptr);
        }

        printf("%llu\n", s);
}

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


More information about the Glibc-bugs mailing list