Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Roman Zavarnitsyn <rom4ek93@gmail.com>
Co-authored-by: Shana Matthews <shana.l.matthews@gmail.com>
  • Loading branch information
3 people authored Aug 3, 2023
1 parent 5173eb9 commit 786385a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/platforms/android/troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,11 @@ For example, the following stack traces:
at io.sentry.HubAdapter.captureEvent (HubAdapter.java:29)
```

## Kotlin
## Incorrect Line Numbers in Kotlin

Stack trace elements referring to Kotlin inline functions from files different than the call site are incorrect, due to how they are compiled.
A .class file with inline functions contains code from many source files. When the JVM generates a stacktrace, it will contain a different line number, because it doesn't substitute the class and line in which the error occurred with the original file and line number.
As a result, if an exception is thrown inside an inline function, the line number of the stack trace of the Exception could be wrong.
This is a missing feature in the JVM itself, so "Sentry can't fix this".
Stack trace elements referring to Kotlin inline functions from files different than the call site may refer to the wrong line numbers.

This is due to a missing feature in the JVM. `.class` files with inline functions contain code from many source files, and when the JVM generates a stacktrace, it doesn't replace the class and line where the error occurred with the original file and line number. So, when an exception is thrown in an inline function, the line number for the stack trace of the Exception may be wrong.

## NDK

Expand Down

0 comments on commit 786385a

Please sign in to comment.