Skip to content
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

Initialisation crashes because dsymUUIDs isn't set when the bundle name contains diacritics. #1097

Closed
RyuX51 opened this issue May 23, 2021 · 2 comments
Labels
bug Confirmed bug released This feature/bug fix has been released

Comments

@RyuX51
Copy link

RyuX51 commented May 23, 2021

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 as
  • LATIN LETTER E followed by COMBINING 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. 👍

@johnkiely1
Copy link
Member

Hi @RyuX51,

Thanks for raising this. We will take a look into it.

@johnkiely1 johnkiely1 added backlog We hope to fix this feature/bug in the future bug Confirmed bug labels May 24, 2021
@xljones
Copy link
Contributor

xljones commented Jun 2, 2021

Hey @RyuX51, a fix for this has been released in https://github.com/bugsnag/bugsnag-cocoa/releases/tag/v6.9.4

@xljones xljones closed this as completed Jun 2, 2021
@xljones xljones added released This feature/bug fix has been released and removed backlog We hope to fix this feature/bug in the future labels Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bug released This feature/bug fix has been released
Projects
None yet
Development

No branches or pull requests

3 participants