New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nvim failed t start with SIGABRT #4183
Comments
Is there any work around I can try first? |
Hmm, it doesn't even require the helptags command, it happens just from startup? Does it happen with |
Same result.
|
Oh, this is good ol' #223. Somewhere in your build system |
Strange that this is still happening.. can you post the output of |
Build log uploaded to https://gist.github.com/leira/2c6cfe6b6f42dc2c3322. Actually, I didn't see -D_FORTIFY_SOURCE=2 in the command line. I was using clang-703.0.21, it's internal pre-release version, maybe it started using -D_FORTIFY_SOURCE=2 as default. I changed the CMakeLists.txt file, removed "if(NOT HAS_ACCEPTABLE_FORTIFY)" check to force using "-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1", solved this issue. |
Strange.. even if it was using #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 1
#error "_FORTIFY_SOURCE > 1"
#endif
int
main(void)
{
return 0;
} |
Yes, this snippet does compile. By "maybe it started using -D_FORTIFY_SOURCE=2 as default", I didn't mean it necessarily has a predefined _FORTIFY_SOURCE=2 macro, I meant maybe clang-703.0.21 take the default behavior just like _FORTIFY_SOURCE=2 is defined, that it will replace STRCPY with a safer version doing boundary check. My question is, if "-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1" is required for certain source files to work properly, why not setting these extra flags for these source files in make files unconditionally, until they can be safely removed someday? |
I thought about that, too.. however, Is "clang-703.0.21" the 3.9.0 branch, btw? Edit: Hm, probably doesn't change anything, but what happens if you compile with just "-U_FORTIFY_SOURCE"? That we could add unconditionally (and then append a "-D_FORTIFY.." if needed). |
I think I figured it out. The check in CMakeList.txt compiles, but it failed with #include <string.h>
#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 1
#error "_FORTIFY_SOURCE > 1"
#endif
int
main(void)
{
return 0;
} I digged into #ifndef _FORTIFY_SOURCE
# if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1050)
# define _FORTIFY_SOURCE 0
# else
# define _FORTIFY_SOURCE 2 /* on by default */
# endif
#endif So I suggest, can we add |
"clang-703.0.21" is from the internal toolchain we used in our company, I'm not really sure which clang branch it is in. |
👍 |
Huh. I'd have never thought that behavior-changing constants would be set in a header file. Thanks for tracking this down! @justinmk I'll send a PR, then. |
Some toolchains apparently set _FORTIFY_SOURCE=2 in internal header files. Include <string.h> (which in turn should include such internal header files) before checking the value of _FORTIFY_SOURCE to catch that. Fixes neovim#4183.
Trying to build top of master branch on change 1ce80d8, failed with Abort trap when generating tags.
It was actually a nvim runtime error, I ran the newly built vim with lldb, and got this backtrace:
The text was updated successfully, but these errors were encountered: