firedns icon indicating copy to clipboard operation
firedns copied to clipboard

Stack smashing

Open RalfHerzog opened this issue 11 years ago • 3 comments

When I am linking the compiled library of firedns to my program a "stack smash" occurs on termination of my program. The exact message is: "*** stack smashing detected *** $(application_name)"

I got the issue fixed when I remove all CFLAGS from the Makefile and compile again. I am using gcc version 4.8.1 (from the repo) on Ubuntu 13.10 x64

RalfHerzog avatar Feb 13 '14 23:02 RalfHerzog

do you know where this message comes from ? is it from glibc? it would be helpful to know which exact flag in CFLAGS causes it, btw. would be helpful if you could remove one after the other until you found the culprit.

rofl0r avatar Feb 14 '14 09:02 rofl0r

The problem may be much deeper than I expect. I think it results from different C standards. You are using -std=c99 to compile your library. By default gcc uses -std=gnu99 (so I do), this in combination with -D_XOPEN_SOURCE flag possibly cause the issue :-/ I am really not sure ... All over, the compiler flag -DHAVE_IPV6 causes the stack smash

RalfHerzog avatar Feb 15 '14 17:02 RalfHerzog

ok thanks. i understand the issue now: if you compile the lib with different options than your app, the struct layout is diffferent. you have to add -DHAVE_IPV6 as well when you compile your app. i'll look intoit in more detail and see if we can fix it completely

rofl0r avatar Feb 17 '14 07:02 rofl0r