Segmentation fault at getenv.c:85

Asked by tomdean

I have a large application that gets a seg fault on exit. I do not call getenv() , this seems to be part of exit code. How do I trace this or what do I bug report?

Breakpoint 2, main (argc=3, argv=0x7fffffffe2d8) at testeph.c:192
192 return 0;
(gdb) bt
#0 main (argc=3, argv=0x7fffffffe2d8) at testeph.c:192
(gdb) n
193 }
(gdb) n

Program received signal SIGSEGV, Segmentation fault.
__GI_getenv (name=0x7ffff788cb1e "BC_FATAL_STDERR_",
    name@entry=0x7ffff788cb1c "LIBC_FATAL_STDERR_") at getenv.c:85
85 getenv.c: No such file or directory.
(gdb) bt
#0 __GI_getenv (name=0x7ffff788cb1e "BC_FATAL_STDERR_",
    name@entry=0x7ffff788cb1c "LIBC_FATAL_STDERR_") at getenv.c:85
#1 0x00007ffff774b172 in __GI___libc_secure_getenv (
    name=name@entry=0x7ffff788cb1c "LIBC_FATAL_STDERR_") at secure-getenv.c:30
#2 0x00007ffff778211d in __libc_message (do_abort=do_abort@entry=1,
    fmt=fmt@entry=0x7ffff788e52b "*** %s ***: %s terminated\n")
    at ../sysdeps/posix/libc_fatal.c:80
#3 0x00007ffff7819c9c in __GI___fortify_fail (msg=<optimized out>,
    msg@entry=0x7ffff788e513 "stack smashing detected") at fortify_fail.c:37
#4 0x00007ffff7819c40 in __stack_chk_fail () at stack_chk_fail.c:28
#5 0x0000000000400eeb in main (argc=3, argv=0x7fffffffe2d8) at testeph.c:193
(gdb)

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
tomdean
Solved:
Last query:
Last reply:
Revision history for this message
tomdean (tomdean) said :
#1

Buffer overflow.

Sorry for the noise.