Sentry: Android Native Application

Hi,

I am trying to add Sentry Native Crash logging to the native portion of an Android Application. I.e. the c/c++ section that the Java Application communicates with across the JNI.

I have successfully been able to integrate the Java portion of Sentry and see crash logs and events on our project. That process was well documented and very simple.

However, I am having trouble with the sentry-native portion. I have downloaded and built the Android version of the sentry-native project using make android-build PREMAKE_DIR=gen_android. This has successfully built the libsentry_breakpad.so, libsentry_crashpad.so and libsentry.so files. I have tried linking both the libsentry.so and libsentry_breakpad.so libraries into my native C/C++ project and have successfully built the project with the following sample code:

    sentry_options_t *options = sentry_options_new();
    sentry_options_set_dsn(options, "https://XXXXX@sentry.io/XXXX");
    sentry_options_set_database_path(options, "sentry-db");
    sentry_init(options);

    sentry_value_t event = sentry_value_new_event();
    sentry_value_set_by_key(event, "message",
                            sentry_value_new_string("Hi Colin! -init"));
    sentry_capture_event(event);

    sentry_capture_event(sentry_value_new_message_event(SENTRY_LEVEL_INFO, "error", "Hi Colin"));

    sentry_shutdown();

The DSN Value that I am using is the same as on the Java side of the project. And I am seeing events get generated there.

I am never seeing any of the events on the Sentry Portal for the Native side.

I can’t see any logcat errors after the sentry_capture_event().

Does anyone have any advice on what is going wrong? Or where I should look next?

Thanks,

-Colin

Hi Colin. Thanks for giving a try to our native SDK with Android.
I wanted to mention we’re working on NDK support and planned alpha release is next week:

There’s a sample app in this repo that causes errors in C++ which is captured by the SDK.
Please note this is an alpha but we’re aiming to get the Beta (stable API) in a few weeks.

Would love feedback on that.

Hi Bruno,

Thank you for your help and direction. It is definitely helping.

I cloned the sentry-android project, updated the DSN in the AndroidManifest.xml, and built the sentry-sample project. I am seeing crash and event logs from the Java side on Sentry.io without any changes to the sentry-sample project. But nothing from the ‘Crash from Native (Segfault)’ OR ‘Capture Event From Native.’ I am running the sample on a piece of custom hardware running Android Marshmallow.

The first issue that I ran into was that the Native code didn’t have access to the context.getCacheDir() folder on my device. Changing it to context.getExternalCacheDir() fixed that issue.

The second issue that I am running into is a ‘Envelope header is missing required ‘event_id’’ message. If I set a break point in the native code right after the return of ‘sentry_envelope_write_to_file(envelope, outbox_path);’ on line 26 of sentry.c I am seeing some oddness.

  1. There appears to be an empty {} at the beginning.
  2. The contents of the envelope appears to be repeated a bunch of times.
  3. The envelope doesn’t appear to be terminated correctly. There is no trailing braces.

I don’t know if the “pre-alpha” stage of the project means that you guys aren’t ready of external input, but I thought I would throw it across the fence.

I have attached the contents here:

{}

{“event_id”:“b34bee69-8e77-4360-0496-5f7e44727587”,“length”:27498,“type”:“event”}
{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:"/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f76{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f764b27e1f082e3745261f49f219f7a”,“debug_id”:“1f764b27-e1f0-82e3-7452-61f49f219f7a”,“imag{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f764b27e1f082e3745261f49f219f7a”,“debug_id”:“1f764b27-e1f0-82e3-7452-61f49f219f7a”,“imag{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f764b27e1f082e3745261f49f219f7a”,“debug_id”:“1f764b27-e1f0-82e3-7452-61f49f219f7a”,“imag{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f764b27e1f082e3745261f49f219f7a”,“debug_id”:“1f764b27-e1f0-82e3-7452-61f49f219f7a”,“imag{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f764b27e1f082e3745261f49f219f7a”,“debug_id”:“1f764b27-e1f0-82e3-7452-61f49f219f7a”,“imag{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f764b27e1f082e3745261f49f219f7a”,“debug_id”:“1f764b27-e1f0-82e3-7452-61f49f219f7a”,“imag{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f764b27e1f082e3745261f49f219f7a”,“debug_id”:“1f764b27-e1f0-82e3-7452-61f49f219f7a”,“imag{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f764b27e1f082e3745261f49f219f7a”,“debug_id”:“1f764b27-e1f0-82e3-7452-61f49f219f7a”,“imag{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f764b27e1f082e3745261f49f219f7a”,“debug_id”:“1f764b27-e1f0-82e3-7452-61f49f219f7a”,“imag{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f764b27e1f082e3745261f49f219f7a”,“debug_id”:“1f764b27-e1f0-82e3-7452-61f49f219f7a”,“imag{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f764b27e1f082e3745261f49f219f7a”,“debug_id”:“1f764b27-e1f0-82e3-7452-61f49f219f7a”,“imag{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f764b27e1f082e3745261f49f219f7a”,“debug_id”:“1f764b27-e1f0-82e3-7452-61f49f219f7a”,“imag{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f764b27e1f082e3745261f49f219f7a”,“debug_id”:“1f764b27-e1f0-82e3-7452-61f49f219f7a”,“imag{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f764b27e1f082e3745261f49f219f7a”,“debug_id”:“1f764b27-e1f0-82e3-7452-61f49f219f7a”,“imag{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f764b27e1f082e3745261f49f219f7a”,“debug_id”:“1f764b27-e1f0-82e3-7452-61f49f219f7a”,“imag{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f764b27e1f082e3745261f49f219f7a”,“debug_id”:“1f764b27-e1f0-82e3-7452-61f49f219f7a”,“imag{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f764b27e1f082e3745261f49f219f7a”,“debug_id”:“1f764b27-e1f0-82e3-7452-61f49f219f7a”,“imag{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f764b27e1f082e3745261f49f219f7a”,“debug_id”:“1f764b27-e1f0-82e3-7452-61f49f219f7a”,“imag{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f764b27e1f082e3745261f49f219f7a”,“debug_id”:“1f764b27-e1f0-82e3-7452-61f49f219f7a”,“imag{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f764b27e1f082e3745261f49f219f7a”,“debug_id”:“1f764b27-e1f0-82e3-7452-61f49f219f7a”,“imag{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f764b27e1f082e3745261f49f219f7a”,“debug_id”:“1f764b27-e1f0-82e3-7452-61f49f219f7a”,“imag{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f764b27e1f082e3745261f49f219f7a”,“debug_id”:“1f764b27-e1f0-82e3-7452-61f49f219f7a”,“imag{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f764b27e1f082e3745261f49f219f7a”,“debug_id”:“1f764b27-e1f0-82e3-7452-61f49f219f7a”,“imag{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f764b27e1f082e3745261f49f219f7a”,“debug_id”:“1f764b27-e1f0-82e3-7452-61f49f219f7a”,“imag{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:“1f764b27e1f082e3745261f49f219f7a”,“debug_id”:“1f764b27-e1f0-82e3-7452-61f49f219f7a”,“imag{“NDK verification event”:“The NDK integration works!”,“contexts”:{},“debug_meta”:{“images”:[{“code_file”:“io.sentry.sample”,“code_id”:“69ff07c28ab0e218ccd2e4db0a0bb344”,“debug_id”:“69ff07c2-8ab0-e218-ccd2-e4db0a0bb344”,“image_addr”:“0x7f87ca2000”,“image_size”:89168,“type”:“elf”},{“code_file”:”/system/lib64/libdirect-coredump.so",“code_id”:“2cf9d688b078cf8be2d66a771f0116fc”,“debug_id”:“2cf9d688-b078-cf8b-e2d6-6a771f0116fc”,“image_addr”:“0x7f87c27000”,“image_size”:69640,“type”:“elf”},{“code_file”:"/system/lib64/libcutils.so",“code_id”:“d0227f66942c2df82e774c56d79118f7”,“debug_id”:“d0227f66-942c-2df8-2e77-4c56d79118f7”,“image_addr”:“0x7f87bff000”,“image_size”:160832,“type”:“elf”},{“code_file”:"/system/lib64/libutils.so",“code_id”:“d015e121d3b86c8942f6de5585b69330”,“debug_id”:“d015e121-d3b8-6c89-42f6-de5585b69330”,“image_addr”:“0x7f87bc9000”,“image_size”:217224,“type”:“elf”},{“code_file”:"/system/lib64/liblog.so",“code_id”:"1f764b27e1f082e3745261f4

Sorry I forgot to mention that stuff is on a separate branch. We’re working on it right now and it also requires a branch from sentry native.

We’ll be releasing a working solution by next week. Published to bintray so you can try it out.

Thanks Bruno,

I will put this effort on ice until our next sprint then.

Thanks,

-Colin

Hey Bruno,

I just updated to the ‘io.sentry:sentry-android:2.0.0-alpha07’ build and I am now able to track native events! Awesome! Thanks! Nice Work!

The stack trace is a bit limited though. Do you have suggestions about how to or where to upload native library symbols so that I can see a symbolicated stack trace?

Thanks,

-Colin

1 Like

I’ve spent some more time debugging why my symbols are not getting populated correctly from native crashes with the 2.0.0-alpha07 tag on an Android Marshmallow platform.

I think the issue is that the debug_id is not getting correctly updated from the code_id in the “Images Loaded” section of a crash event.

This image is from the crash event showing the Debug ID/ Code ID for the expected symbol library and is in the event panel.

It is my understanding that the debug id for elf images is the little-endian UUID representation fo the first 16 bytes of the code_id identifier. The image makes it appear that the Debug ID is not getting updated correctly and results in a failed debug source lookup.

This following image shows the expected Debug ID from the Debug Files section of my project.

This image shows the first 16 bytes flipped from the code_id.

This seems like it is an issue with the sentry native part of the chain that is uploading the module information.

Can someone more intimate with the sentry-native project verify my conclusions?

Thanks,

-Colin

Hey Colinp.
Thanks for raising this and sorry for the inconvinience.
We’ve tracked down that issue last Friday but failed to update sentry-android with the fix done on sentry-native.

Once this PR is merged; https://github.com/getsentry/sentry-android/pull/162 we’ll make a new release that will have this fix.

Once again thanks a lot for trying our alphas!!

Thanks Bruno! I appreciate you working on this feature!

-Colin

1 Like

We’ve released alpha8 on bintray and jcenter.
Cheers!