In my application when I try to print my logs into file at that Time facing Segmentation Error .
I am facing Fatal Signal 11 .
My log function is into Native
On side note, if you are using library it is hard to find out where in your library it caused exception seeing Logs from Logcat.
ndk-stack -sym C:\Project\libs -dump C:\Error.txt
You can find documentation in android_ndk_path/docs/NDK-STACK.html
char logMessage[5];
char tempString[5];
strcpy(logMessage, "1234");
strcpy(tempString, "1234");
strcat(logMessage, tempString);
may (!) cause the trouble?
The segmentation fault signal points to some type of memory problem and, taking into account that you set logMessage and tmpString to the same length and you're filling logMessage with several arguments plus the content in tmpString, as Peter states, is very possible that you're running into a buffer overflow.
Initially, logMessage's length should be: MAX_APPNAME_LEN + MAX_DEBUG_LEN + 4 + MAX_TIMESTAMP_LEN + MAX_MODULENAME_LEN + PATHLENGTH.