Skip to content

Commit

Permalink
Version 3.7.0 (#121)
Browse files Browse the repository at this point in the history
* .NET 3.5 backward compatibility (#93)

* Backward compatibility

* Annotations test isolation

* Removed not used anymore variable

* Version bump

* iOS Support

* Safe enum comparision x64 vs x86

* variable name improvements

* Version bump

* client side unwinding (#95)

* Client side unwinding

* Client side unwinding - initialze client side unwinding with the crashpad database path

* Adjust client side unwinding to the newest api

* Libraries update

* Removed new lines

* removed unused function

* Update CHANGELOG.md

* Update README.md

* Expose unwinding in the Backtrace UI

* native client updates - ignore anrs on the debug mode, don't generate oom reports when memory warning occurred + fixed structure calculation

* 3.6.0-preview.0

* Added client side unwinding details.

* Update CHANGELOG.md

* Add files via upload

* Delete Backtrace Panel Native Crashes.png

* Add files via upload

* Update README.md

* Add files via upload

* Update README.md

* Windows native support (#97)

* Windows native support

* Removed debugging information from native libraries, improved scoped attributes for unity crash reporting tool, improved attributes support for minidump/json query params, native client improvements + tests

* Breadcrumbs support from previous session (when multiple crashes occurred in the previous session

* Removed comment

* Attribute cache

* Source Code integration (#98)

* Bring back source code support

* .NET 3.5 support

* Fixed every typo 'Untiy'

* Include source code in each frame

* Version bump

* Preview 3: Fixes compilation issues on platforms without native client

* Preview 3: version bump

* Remove class instance on OnDestroy method and move disabing native integration code outside #ifdef

* Enable by default metrics support

* event agg documentation clarification (#99)

Updated a few bits in the readme to clarify a question a customer had.

* Enable client side unwinding + CSU switch

* Enable client side unwinding flag available outside Android env

* Adjusted .meta files

* Adjusted win libraries

* Client side unwinding only for unity 2019

* Version bump

* Update README.md

* Update README.md

* Client side unwinding improvements (#107)

* Version 3.6.1 preparation

* Changelog update

* Changelog typo

* Multiselect dropdown support (#111)

* Multiselect dropdown support

* Typo

* Typo

* Escape control characters (#109)

* Escape control characters

* Test JSON escaping

* Keep unicode function private

* Backtrace thread API improvements (#110)

* Do not use unity api in background threads or in methods that can use background threads

* Handle database path invalid initialization

* Typo

* Changelog and version update

* Handle enum flag options that can generate bigger value than int32 (#113)

* Prevent from changing source code collection while jobject iterate over it (#112)

* Readme update to include Windows specific information

* Update README.md

Reference to released NDK16b version

* Update README.md

* Update CHANGELOG.md

* Print warning when filter is set to all (#116)

* Unity 2018 and older ndk warning (#115)

* Unity 2018 and older ndk warning

* Uncommented ifdef

* Correct warning message

* Update BacktraceConfigurationEditor.cs

* Apply warning only to unity version older than 2019

* Editor sampling (#118)

* Disable error reporting in editor mode (#119)

* Disable Backtrace reporting in Editor

* Do not send crashes on the editor startup

* Test

* Moved tests to separated file + added tests for unhandled exceptions

* Background exception handler (#117)

* Background exception handler

* Correct ANR disable message

* CrashHelper funcitons

* Code review suggestions

* Set database path by default and create database directory (#124)

* Disable NDK integration on Application.Exit (#120)

* Disable NDK integration on Application.Exit

* The latest verison of the backtrace-android binaries

* Memory attributes (#122)

* Fixed unit tests after merge + fixed .meta file creation + improved code comments

* Version 3.7.0-preview.1 changelog + version bump

* Binaries update (#126)

* Remove Android dependencies on non-Android platforms (#125)

* Removed android dependencies + preprocesor directive for android native client

* Update NativeClient.cs

* Do the same for WindowS

* Version update

* Prevent from using modern C# API (#127)

* Decrease default texture quality (#129)

* Texture quality

* Always apply quality settings

* Formatting changes

* Breadcrumbs initialization improvements (#128)

* Breadcrumbs initialization improvements

* Do not ignore EnableBreadcurmbsSupport flag

* Address code review suggestions + support for None

* Label update

* Breadcrumbs ANR support (#130)

* Breadcrumbs ANR support

* Keep things private

* Update CHANGELOG.md

* Code review suggestions

Co-authored-by: Vincent Lussenburg <[email protected]>

* New preview version

* Disable integration on app.exit (#131)

* Disable integration on app.exit

* Update ios binaries after cr

* Version 3.7.0 update

Co-authored-by: jasoncdavis0 <[email protected]>
Co-authored-by: Drake Autery <[email protected]>
Co-authored-by: Vincent Lussenburg <[email protected]>
  • Loading branch information
4 people authored Nov 10, 2021
1 parent 971d552 commit c9704d1
Show file tree
Hide file tree
Showing 52 changed files with 1,053 additions and 381 deletions.
4 changes: 2 additions & 2 deletions Android/BacktraceANRWatchdog.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ public static void printStackTrace(StackTraceElement[] stackTrace, PrintWriter p
}
}

public void stopMonitoringAnr() {
Log.d(LOG_TAG, "Stop monitoring ANR");
public void stopMonitoring() {
Log.d(LOG_TAG, "ANR handler has been disabled.");
shouldStop = true;
}
}
69 changes: 69 additions & 0 deletions Android/BacktraceAndroidBackgroundUnhandledExceptionHandler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package backtrace.io.backtrace_unity_android_plugin;

import android.os.Build;
import android.os.Looper;
import android.util.Log;

import com.unity3d.player.UnityPlayer;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
* Handle unhandled Android exceptions from background threads.
*/
public class BacktraceAndroidBackgroundUnhandledExceptionHandler implements Thread.UncaughtExceptionHandler{
private final static transient String LOG_TAG = BacktraceAndroidBackgroundUnhandledExceptionHandler.class.getSimpleName();
private final Thread.UncaughtExceptionHandler mRootHandler;

/**
* Check if data shouldn't be reported.
*/
private volatile boolean shouldStop = false;

private final String _gameObject;
private final String _methodName;

public BacktraceAndroidBackgroundUnhandledExceptionHandler(String gameObject, String methodName) {
Log.d(LOG_TAG, "Initializing Android unhandled exception handler");
this._gameObject = gameObject;
this._methodName = methodName;

mRootHandler = Thread.getDefaultUncaughtExceptionHandler();
Thread.setDefaultUncaughtExceptionHandler(this);
}

@Override
public void uncaughtException(Thread thread, Throwable exception) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE && mRootHandler != null && shouldStop == false) {
if(Looper.getMainLooper().getThread().getId() == thread.getId()) {
// prevent from sending exception happened to main thread - we will catch them via unity logger
return;
}
String exceptionType = exception.getClass().getName();
Log.d(LOG_TAG, "Detected unhandled background thread exception. Exception type: " + exceptionType + ". Reporting to Backtrace");
ReportThreadException(exceptionType + " : " + exception.getMessage(), stackTraceToString(exception.getStackTrace()));
}
}

public void ReportThreadException(String message, String stackTrace) {
UnityPlayer.UnitySendMessage(this._gameObject, this._methodName, message + '\n' + stackTrace);
}

private static String stackTraceToString(StackTraceElement[] stackTrace) {
StringWriter sw = new StringWriter();
printStackTrace(stackTrace, new PrintWriter(sw));
return sw.toString();
}

private static void printStackTrace(StackTraceElement[] stackTrace, PrintWriter pw) {
for(StackTraceElement stackTraceEl : stackTrace) {
pw.println(stackTraceEl);
}
}

public void stopMonitoring() {
Log.d(LOG_TAG, "Uncaught exception handler has been disabled.");
shouldStop = true;
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions Android/BacktraceCrashHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@


public class BacktraceCrashHelper {

public void throwRuntimeException() {
Log.d("BacktraceCrashHelper", "Throwing runtime exception");
throw new RuntimeException("Unity-test: Uncaught JVM exception");
}

public void throwBackgroundJavaException() {
Log.d("BacktraceCrashHelper", "throwing an unhandled background java exception");
new Thread(new Runnable() {
@Override
public void run() {
int[] numbers = {10, 20, 30, 40};
Log.d("BacktraceCrashHelper", String.valueOf(numbers[5]));
}
}).start();
}

public static void StartAnr() {
Log.d("BacktraceCrashHelper", "Starting ANR");
Handler handler = new Handler(Looper.getMainLooper());
Expand Down
Binary file modified Android/lib/arm64-v8a/libbacktrace-native.so
Binary file not shown.
Binary file modified Android/lib/arm64-v8a/libcrashpad_handler.so
Binary file not shown.
Binary file modified Android/lib/arm64-v8a/libnative-lib.so
Binary file not shown.
Binary file modified Android/lib/armeabi-v7a/libbacktrace-native.so
Binary file not shown.
Binary file modified Android/lib/armeabi-v7a/libcrashpad_handler.so
Binary file not shown.
Binary file modified Android/lib/armeabi-v7a/libnative-lib.so
Binary file not shown.
Binary file modified Android/lib/x86/libbacktrace-native.so
Binary file not shown.
Binary file modified Android/lib/x86/libnative-lib.so
Binary file not shown.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Backtrace Unity Release Notes

## Version 3.7.0

- When an ANR/Hang is detected, it is now added to the Breadcrumbs on all the platforms we support ANRs for
- Sampling has been enabled in the editor mode.
- Disable API available in the editor mode. API allows to ignore all reports generated in the Unity editor.
- Disable NDK integration when Application.Exit API has been invoked.
- Java background exception handler
- BacktraceConfiguration default options change for DatabasePath and CreateDatabaseDirectory properties.
- Updated Backtrace-Android dependencies to version 3.6.0

## Version 3.6.2

Bugfixes
Expand Down
3 changes: 3 additions & 0 deletions Editor/BacktraceConfigurationEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ public override void OnInspectorGUI()
{
EditorGUILayout.HelpBox("Please insert value greater or equal -1", MessageType.Error);
}
EditorGUILayout.PropertyField(
serializedObject.FindProperty("DisableInEditor"),
new GUIContent(BacktraceConfigurationLabels.DISABLE_IN_EDITOR));
}

#if !UNITY_WEBGL
Expand Down
1 change: 1 addition & 0 deletions Editor/BacktraceConfigurationLabels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ internal static class BacktraceConfigurationLabels
internal static string LABEL_SERVER_URL = "Server Address";
internal static string LABEL_REPORT_PER_MIN = "Reports per minute";
internal static string LABEL_HANDLE_UNHANDLED_EXCEPTION = "Handle unhandled exceptions";
internal static string DISABLE_IN_EDITOR = "Disable error reporting integration in editor";

internal static string LABEL_DESTROY_CLIENT_ON_SCENE_LOAD = "Destroy client on new scene load (false - Backtrace managed)";
internal static string LABEL_SAMPLING = "Log random sampling rate";
Expand Down
Loading

0 comments on commit c9704d1

Please sign in to comment.