Initialisation crashes because dsymUUIDs
isn't set when the bundle name contains diacritics. #1097
Description
Dear Bugsnag team,
I just an app rejected by Apple. When looking into it, I found in BugsnagApp.m:40
the command json[@"dsymUUIDs"][0]
that failed, because json[@"dsymUUIDs"]
was nil
.
Digging a little into it, I found in BSG_KSMachHeaders.c
that if (strcmp(img->name, imageName) == 0)
didn't match because there are diacritics in it. It was the same string, but the names contained an é
, which can be represented as:
LATIN LETTER E WITH ACUTE
or asLATIN LETTER E
followed byCOMBINING ACUTE ACCENT
.
I changed my bundle name so that the diacritic only appears in the display name, now this comparison succeeds. If you want to address this, you could change the diacritics before the strcmp
into plain letters:
#include <utf8proc.h>
utf8_t *output;
ssize_t len = utf8proc_map((uint8_t*)input, 0, &output,
UTF8PROC_NULLTERM | UTF8PROC_STABLE |
UTF8PROC_STRIPMARK | UTF8PROC_DECOMPOSE |
UTF8PROC_CASEFOLD
);
Or maybe you have a better solution. :)
I had some more crashes on BugsnagApp.m:40
after fixing this and strcmp(img->name, imageName)
succeeding, but while debugging, at some point it just ran again. I suppose it was a caching problem, I don't remember if I properly cleared the build cache. But maybe wrapping that line in an if ([json[@"dsymUUIDs"] count] > 0) { }
wouldn't be a bad thing.
So long, thank you for your nice Framework that saved me countless hours of debugging. 👍