We are developing an Xcframework that contains Objc + Cpp code. Cpp code is internal to the framework so we are stripping all the symbols.
Framework is using few build options to strip off internal symbols:
- Build PostProcessing - Yes
- Strip Style - Non-Global Symbols
- Other Cpp flags - $(OTHER_CFLAGS) -fvisibility-inlines-hidden -fvisibility=hidden
Now when a crash happens due to "abort()" function, the topmost symbol (of the framework) is symbolicated to totally different method. But if crash happens due to some other reason, then symbolication works fine. We have tried atos command as well as Mac symbolicator. Both show same behaviour.
To explain the issue in more details, here is a GitHub link. It contains all the details on how to reproduce the issue. Build settings are similar to our project settings.
Your example crash is mapping the wrong method name due to the extremely short length of your example function, for example:
void InternalCppClass::crashAppWithAbort() {
abort();
}
Due to how the addresses are mapped between the addresses recorded at the time of the crash and then the addresses in the dSYM symbol table, you can wind up with atos
returning the address of a neighboring function in the symbol table for extremely short functions.
I'm emphasizing the function length here, as from a pragmatic point of view, this is relatively rare to encounter such a short function in real world code bases that you will run into this often. If you're inquiring because you're worried about making sure your crash reports are accurate, this really only appears in this scenario. Further, if you do wind up in this scenario, it's likely the real function you're looking for is the immediate neighbor above or below the short function in the same source code file.
We're already tracking this as a bug internally (r. 24748643), but I'd still appreciate if you could file a bug report about this with your example so we have your report here recorded. If you open that report, please post the FB number here for my reference.
If you have any questions about filing a bug report, take a look at Bug Reporting: How and Why?
— Ed Ford, DTS Engineer