getsentry/symbolic

debuginfo/dwarf: Deobfuscation of flutter function names fails sometimes

loewenheim opened this issue · 0 comments

We have seen a case where for equivalent events on MacOs and Android, deobfuscation works correctly in the Android case, but not the MacOs case.

  1. For simplicity, call the MacOs debug file macos.dSYM and the Android one android.debug. Both macos.dSYM and android.debug contain obfuscated names in their symbol tables and the properly deobfuscated names in the actual debug information. The difference is that in the MacOs case, the name in the symbol table is preferred, while in the Android case, it's the name in the debug info.
  2. The logic of which name to prefer is controlled by the prefer_dwarf_names flag. This flag is set in
    let prefer_dwarf_names = producer.as_deref() == Some(b"Dart VM");
    based on whether the DWARF file's DW_AT_producer attribute has the value "Dart VM".
  3. In fact we have DW_AT_producer == "Dart VM" for both macos.dSYM and android.debug. What's going on? It appears that for whatever reason, in android.debug this attribute value is an in-place string literal, while in macos.dSYM it's a reference to the string section.
  4. We don't correctly resolve the string reference, leading to everything going wrong.