a user submitted a bug-report, where my application segfaults in “__fortify_fail()”.
i understand that this is related to building my application with Debian’s “hardening” flags -D_FORTIFY_SOURCE=2 -fstack-protector.
unfortunately the backtrace of the user does not tell me much yet, and the user is not super responsive (right now).
in order to understand better what is going on, i would like to know, what __fortify_fail actually does.
This function is normally just an error reporter. Sample code from glibc is:
It may be called here and there where sources is preferred to be fortified. “Fortification” itself is just a couple of run-time checks. Sample usage in
openatfunction fromio/openat.cis:Without fortification,
O_CREATis acceptable without mode (still this case is highly suspicious, it is legal).Think about
__fortify_faillike about printf+abort.Turning telepathy on about your question, I may suggest that user have some problems with using libc in user code.
/lib/x86_64-linux-gnu/libc.so.6(+0xebdf0)[0x7f75d3576df0]is a place inside libc where some runtime-check fails, sopd[0x49b5c0]is a place where libc incorrectly called from.