firebase / firebase-tools

The Firebase Command Line Tools
MIT License
3.97k stars 917 forks source link

Breakpad symbol generation failed (exit=134) for objs compiled from Go #7244

Closed ignoramous closed 1 month ago

ignoramous commented 1 month ago

Environment info

firebase-tools: 13.10.2

Platform: Ubuntu

Test case

wget "https://jitpack.io/com/github/celzero/firestack/8562868129/firestack-8562868129-debug.aar" -O "firestack.aar"

unzip firestack.aar

firebase crashlytics:symbols:upload ./jni/ --debug --app 1:<num>:android:<hex>

firebase crashlytics:symbols:upload ./jni/ --debug --generator csym --app 1:<num>:android:<hex> 

Steps to reproduce

See above and https://github.com/firebase/firebase-android-sdk/issues/4699

Expected behavior

Uploads the symbols.

Actual behavior

breakpad:

 firebase crashlytics:symbols:upload ./jni/arm64-v8a --app 1:974915159594:android:ed4f2e6c806fa816bda553 --debug                 
[2024-06-01T18:15:45.833Z] Buildtools Jar already downloaded at /home/murtaza/.cache/firebase/crashlytics/buildtools/crashlytics-buildtools-2.9.2.jar
i  Generating symbols for ./jni/arm64-v8a 
[CRASHLYTICS LOG DEBUG] Crashlytics Buildtools initialized.
[CRASHLYTICS LOG DEBUG] Skipping dumpsyms extraction, file exists: /home/murtaza/bravehub/firestack/ff/.crashlytics/dump_syms.bin
[CRASHLYTICS LOG DEBUG] Breakpad symbol generator initialized: /home/murtaza/bravehub/firestack/ff/.crashlytics/dump_syms.bin
[CRASHLYTICS LOG DEBUG] Generating native symbol files for /home/murtaza/bravehub/firestack/ff/./jni/arm64-v8a; writing output to: /tmp/crashlytics-42f1d1c0-d97f-42d8-ab86-3dea2884ce90/nativeSymbols/1-974915159594-android-ed4f2e6c806fa816bda553/breakpad
[CRASHLYTICS LOG DEBUG] 1 native libraries found at ./jni/arm64-v8a
[CRASHLYTICS LOG DEBUG] Crashlytics generating Breakpad Symbol file for: /home/murtaza/bravehub/firestack/ff/./jni/arm64-v8a/libgojni.so
[CRASHLYTICS LOG DEBUG] Extracting Breakpad symbols to temp file: /tmp/crashlytics-42f1d1c0-d97f-42d8-ab86-3dea2884ce90/nativeSymbols/1-974915159594-android-ed4f2e6c806fa816bda553/breakpad/libgojni.so14924676242701564646.tmp
[CRASHLYTICS LOG ERROR] Crashlytics execution failed.
java.io.IOException: Breakpad symbol generation failed (exit=134), see STDERR
    at com.google.firebase.crashlytics.buildtools.ndk.internal.breakpad.BreakpadSymbolGenerator.generateSymbols(BreakpadSymbolGenerator.java:133)
    at com.google.firebase.crashlytics.buildtools.Buildtools.generateNativeSymbolFiles(Buildtools.java:273)
    at com.google.firebase.crashlytics.buildtools.CommandLineHelper.executeGenerateSymbols(CommandLineHelper.java:185)
    at com.google.firebase.crashlytics.buildtools.CommandLineHelper.executeCommand(CommandLineHelper.java:118)
    at com.google.firebase.crashlytics.buildtools.CommandLineHelper.main(CommandLineHelper.java:65)
    at com.google.firebase.crashlytics.buildtools.Buildtools.main(Buildtools.java:111)

Error: java command failed with args: -jar,/home/murtaza/.cache/firebase/crashlytics/buildtools/crashlytics-buildtools-2.9.2.jar,-symbolGenerator,breakpad,-symbolFileCacheDir,/tmp/crashlytics-42f1d1c0-d97f-42d8-ab86-3dea2884ce90/nativeSymbols/1-974915159594-android-ed4f2e6c806fa816bda553/breakpad,-verbose,-generateNativeSymbols,-unstrippedLibrary,./jni/arm64-v8a,-clientName,firebase-cli;crashlytics-buildtools

csym:

firebase crashlytics:symbols:upload ./jni/arm64-v8a --app 1:974915159594:android:ed4f2e6c806fa816bda553 --debug --generator csym
[2024-06-01T18:11:18.450Z] Buildtools Jar already downloaded at /home/murtaza/.cache/firebase/crashlytics/buildtools/crashlytics-buildtools-2.9.2.jar
i  Generating symbols for ./jni/arm64-v8a 
[CRASHLYTICS LOG DEBUG] Crashlytics Buildtools initialized.
[CRASHLYTICS LOG DEBUG] Generating native symbol files for /home/murtaza/bravehub/firestack/ff/./jni/arm64-v8a; writing output to: /tmp/crashlytics-0b984900-0eb8-49f2-abf0-844f10934af3/nativeSymbols/1-974915159594-android-ed4f2e6c806fa816bda553/csym
[CRASHLYTICS LOG DEBUG] 1 native libraries found at ./jni/arm64-v8a
[CRASHLYTICS LOG DEBUG] Generating native symbol file from: ./jni/arm64-v8a/libgojni.so
[CRASHLYTICS LOG DEBUG] Using DWARF data for cSYM generation.
[CRASHLYTICS LOG ERROR] Crashlytics execution failed.
java.io.EOFException
    at com.google.firebase.crashlytics.buildtools.utils.io.ByteReader.readByte(ByteReader.java:70)
    at com.google.firebase.crashlytics.buildtools.utils.io.ByteReader.readULEB128(ByteReader.java:175)
    at com.google.firebase.crashlytics.buildtools.ndk.internal.dwarf.DwarfDataParser.readDebugAbbrevEntries(DwarfDataParser.java:238)
    at com.google.firebase.crashlytics.buildtools.ndk.internal.dwarf.DwarfDataParser.readCompilationUnit(DwarfDataParser.java:175)
    at com.google.firebase.crashlytics.buildtools.ndk.internal.dwarf.DwarfDataParser.readCompilationUnit(DwarfDataParser.java:146)
    at com.google.firebase.crashlytics.buildtools.ndk.internal.dwarf.DwarfDataParser.parse(DwarfDataParser.java:70)
    at com.google.firebase.crashlytics.buildtools.ndk.internal.elf.ElfDataParser.parseElf(ElfDataParser.java:152)
    at com.google.firebase.crashlytics.buildtools.ndk.internal.elf.ElfDataParser.parse(ElfDataParser.java:97)
    at com.google.firebase.crashlytics.buildtools.ndk.internal.elf.ElfDataParser.parse(ElfDataParser.java:42)
    at com.google.firebase.crashlytics.buildtools.ndk.internal.csym.ElfCSymFactory.createCSymFromFile(ElfCSymFactory.java:90)
    at com.google.firebase.crashlytics.buildtools.ndk.internal.csym.NdkCSymGenerator.generateSymbolFileFromFile(NdkCSymGenerator.java:39)
    at com.google.firebase.crashlytics.buildtools.ndk.internal.csym.NdkCSymGenerator.generateSymbols(NdkCSymGenerator.java:24)
    at com.google.firebase.crashlytics.buildtools.Buildtools.generateNativeSymbolFiles(Buildtools.java:273)
    at com.google.firebase.crashlytics.buildtools.CommandLineHelper.executeGenerateSymbols(CommandLineHelper.java:185)
    at com.google.firebase.crashlytics.buildtools.CommandLineHelper.executeCommand(CommandLineHelper.java:118)
    at com.google.firebase.crashlytics.buildtools.CommandLineHelper.main(CommandLineHelper.java:65)
    at com.google.firebase.crashlytics.buildtools.Buildtools.main(Buildtools.java:111)

Error: java command failed with args: -jar,/home/murtaza/.cache/firebase/crashlytics/buildtools/crashlytics-buildtools-2.9.2.jar,-symbolGenerator,csym,-symbolFileCacheDir,/tmp/crashlytics-0b984900-0eb8-49f2-abf0-844f10934af3/nativeSymbols/1-974915159594-android-ed4f2e6c806fa816bda553/csym,-verbose,-generateNativeSymbols,-unstrippedLibrary,./jni/arm64-v8a,-clientName,firebase-cli;crashlytics-buildtools
mrober commented 1 month ago

The Firebase CLI tool has not been updated to pull v3 of the Crashlytics buidltools, which does support these Go binaries. I will make that change.

For now, you can manually tell the Firebase CLI tool to use the latest Crashlytics buildtools jar by:

  1. Download v3 of the Crashlytics buildtools jar from: https://dl.google.com/android/maven2/com/google/firebase/firebase-crashlytics-buildtools/3.0.0/firebase-crashlytics-buildtools-3.0.0.jar

  2. Tell the Firebase CLI tool to use it by setting the environment variable:

    export CRASHLYTICS_LOCAL_JAR=/path/to/firebase-crashlytics-buildtools-3.0.0.jar
  3. Run the Firebase CLI tool in debug mode, but don't set the symbol generator to csym so it uses breakpad:

    firebase crashlytics:symbols:upload --debug --app=FIREBASE_APP_ID /path/to/symbols

    If you see a line in debug like "[CRASHLYTICS LOG DEBUG] Skipping dumpsyms extraction, file exists: /path/to/.crashlytics/dump_syms.bin", delete that file. It is the old dump_syms binary from the old buildtools jar. Then try this step again.

If this does not work, please let me know. Otherwise, wait for the next version of the Firebase CLI tools.