This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/19767] vdso is not used with static linking


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

Jiangning Liu <jiangning.liu at amperecomputing dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jiangning.liu@amperecomputi
                   |                            |ng.com

--- Comment #19 from Jiangning Liu <jiangning.liu at amperecomputing dot com> ---
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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]