Is there possibility that segfault can occur while calling getgrouplist() with correct input params.
I am passing correct username, group id, buffer with max possible groups (_SC_NGROUPS_MAX). But segfault is happening somewhere between opening and closing of /etc/group. jemalloc lib is being used for memory management.
One case I can think of is /etc/group is corrupted due to some reason
Following is the BT. Can anyone see what can go wrong and help me out
#0 0x00007f0b0294bd4e in arena_chunk_stash_dirty (mapelms=<synthetic pointer>, all=<optimized out>, chunk=0x7f0ae2c00000, arena=0x7f0afdc88500) at jemalloc/jemalloc/src/arena.c:876
#1 arena_chunk_purge (all=<optimized out>, chunk=0x7f0ae2c00000, arena=0x7f0afdc88500) at jemalloc/jemalloc/src/arena.c:994
#2 arena_purge (arena=arena@entry=0x7f0afdc88500, all=all@entry=false) at jemalloc/jemalloc/src/arena.c:1075
#3 0x00007f0b0294ba85 in arena_maybe_purge (arena=0x7f0afdc88500) at jemalloc/jemalloc/src/arena.c:793
#4 arena_run_dalloc (arena=arena@entry=0x7f0afdc88500, run=<optimized out>, dirty=<optimized out>, dirty@entry=true, cleaned=cleaned@entry=false) at jemalloc/jemalloc/src/arena.c:1232
#5 0x00007f0b0294d620 in je_arena_dalloc_large_locked (arena=arena@entry=0x7f0afdc88500, chunk=chunk@entry=0x7f0ae2c00000, ptr=ptr@entry=0x7f0ae2cc4000) at jemalloc/jemalloc/src/arena.c:1971
#6 0x00007f0b0294d64e in je_arena_dalloc_large (arena=0x7f0afdc88500, chunk=0x7f0ae2c00000, ptr=0x7f0ae2cc4000) at jemalloc/jemalloc/src/arena.c:1979
#7 0x00007f0affceb4e1 in getgrouplist () from /lib64/libc.so.6
segfault seen at getgrouplist() + jemalloc lib
Re: segfault seen at getgrouplist() + jemalloc lib
Does it happen if you don't run with the jemalloc library?