malloc always fail with SIGSEGV at __get_nprocs getsysstats.c:151

Asked by de2009an

Please someone help!
I run my apps on Ubuntu 16.04.2 LTS, every time it will crash with Segmentation fault
the place is just a malloc call like
pMalloc = malloc(size); // size value is 40
really don't know why crash every time.
I check the backtrace from core file generated, get below info
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `myApp'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007fdf8f2e4de2 in __get_nprocs () at ../sysdeps/unix/sysv/linux/getsysstats.c:151
151 ../sysdeps/unix/sysv/linux/getsysstats.c: No such file or directory.
[Current thread is 1 (Thread 0x7fdf910d3700 (LWP 30525))]
(gdb) bt
#0 0x00007fdf8f2e4de2 in __get_nprocs () at ../sysdeps/unix/sysv/linux/getsysstats.c:151
#1 0x00007fdf8f25db51 in arena_get2 (size=size@entry=40, avoid_arena=avoid_arena@entry=0x0) at arena.c:856
#2 0x00007fdf8f26369a in arena_get2 (avoid_arena=0x0, size=40) at malloc.c:2909
#3 __GI___libc_malloc (bytes=40) at malloc.c:2909

glibc version is like below
GNU C Library (Ubuntu GLIBC 2.23-0ubuntu7) stable release version 2.23, by Roland McGrath et al.
Copyright (C) 2016 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.
Compiled by GNU CC version 5.4.0 20160609.
Available extensions:
        crypt add-on version 2.1 by Michael Glad and others
        GNU Libidn by Simon Josefsson
        Native POSIX Threads Library by Ulrich Drepper et al
        BIND-8.2.3-T5B
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
<https://bugs.launchpad.net/ubuntu/+source/glibc/+bugs>.

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu glibc Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
de2009an (junopark) said :
#1

besides it is a vmware workstation, CPU is Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz

Revision history for this message
de2009an (junopark) said :
#2

(gdb) info locals
cached_result = -1
timestamp = 0
now = 1508304267
prev = <optimized out>
buffer_size = <optimized out>
buffer = 0x7fdf910c3e30 ""
buffer_end = 0x7fdf910c5e30 "\260^\f\221\337\177"
cp = 0x7fdf910c5e30 "\260^\f\221\337\177"
re = 0x7fdf910c5e30 "\260^\f\221\337\177"
flags = 524288
fd = 37
l = <optimized out>
result = 0
(gdb)

Revision history for this message
Launchpad Janitor (janitor) said :
#3

This question was expired because it remained in the 'Open' state without activity for the last 15 days.