Skip to content

Docs/guide about debugging crashes for java developers #683

@ktoso

Description

@ktoso

It's important to teach how java developers can debug crashes in swift.

E.g. a crash


     Stack: [0x000000016d7c8000,0x000000016d9cb000],  sp=0x000000016d9c5d10,  free space=2039k
     Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
     V  [libjvm.dylib+0x579b14]  jni_GetArrayLength+0x108
     C  [libSwiftJava.dylib+0x1a1dc4]  $sSa16SwiftJavaJNICoreAA0B5ValueRzlE7fromJNI2inSayxGSvSg_SpySPySo18JNINativeInterfaceVGSgGtcfC+0x118
     C  [libSwiftJava.dylib+0x1a4c24]  $sSayxG16SwiftJavaJNICore0B5ValueA2bCRzlAbCP7fromJNI2inx7JNITypeQz_SpySPySo18JNINativeInterfaceVGSgGtcfCTW+0x20
     C  [libSwiftJava.dylib+0x1a277c]  $sSa16SwiftJavaJNICoreAA0B5ValueRzlE7fromJNI2inSayxGSvSg_SpySPySo18JNINativeInterfaceVGSgGtcfcx7JNITypeQzXEfU2_+0xb8
     C  [libSwiftJava.dylib+0x1a27bc]  $sSa16SwiftJavaJNICoreAA0B5ValueRzlE7fromJNI2inSayxGSvSg_SpySPySo18JNINativeInterfaceVGSgGtcfcx7JNITypeQzXEfU2_TA+0x2c
     C  [libSwiftJava.dylib+0x1988]  $sSlsE3mapySayqd__Gqd__7ElementQzqd_0_YKXEqd_0_YKs5ErrorRd_0_r0_lF+0x400
     C  [libSwiftJava.dylib+0x1a2150]  $sSa16SwiftJavaJNICoreAA0B5ValueRzlE7fromJNI2inSayxGSvSg_SpySPySo18JNINativeInterfaceVGSgGtcfC+0x4a4
     C  [libMySwiftLibrary.dylib+0x36670]
     $s14MySwiftLibrary023Java_com_example_swift_abC29__00024nestedByteArray___3_3B11environment9thisClass5arraySvSgSpySPySo18JNINativeInterfaceVGSgGSg_SvAFtF+0xe8
     C  [libMySwiftLibrary.dylib+0x36580]  Java_com_example_swift_MySwiftLibrary__00024nestedByteArray___3_3B+0xc
     j  com.example.swift.MySwiftLibrary.$nestedByteArray([[B)[[B+0
     j  com.example.swift.MySwiftLibrary.nestedByteArray([[B)[[B+9
     j  com.example.swift.ArraysTest.lambda$nestedByteArray_null$1()V+24
     j  com.example.swift.ArraysTest$$Lambda+0x0000060001166dc0.execute()V+0
     j  org.junit.jupiter.api.AssertThrows.assertThrows(Ljava/lang/Class;Lorg/junit/jupiter/api/function/Executable;Ljava/lang/Object;)Ljava/lang/Throwable;+1
     j  org.junit.jupiter.api.AssertThrows.assertThrows(Ljava/lang/Class;Lorg/junit/jupiter/api/function/Executable;)Ljava/lang/Throwable;+3
     j  org.junit.jupiter.api.Assertions.assertThrows(Ljava/lang/Class;Lorg/junit/jupiter/api/function/Executable;)Ljava/lang/Throwable;+2
     j  com.example.swift.ArraysTest.nestedByteArray_null()V+18

can be demangled using cat ... | swift demangle but java developers may not know about this etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions