Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling logging on Android crashes the app #1120

Closed
matejdro opened this issue Jan 13, 2022 · 0 comments
Closed

Enabling logging on Android crashes the app #1120

matejdro opened this issue Jan 13, 2022 · 0 comments

Comments

@matejdro
Copy link

Report

Issues and Steps to Reproduce

  1. Create a YogaConfig with a logger
  2. Create a YogaNode with that config
  3. Attempt to layout it

Expected Behavior

Logger should work

Actual Behavior

Whole app crashes with

signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
Abort message: 'JNI DETECTED ERROR IN APPLICATION: illegal class name 'Lcom/facebook/yoga/YogaLogLevel;'
        (should be of the form 'package/Class', [Lpackage/Class;' or '[[B')
        in call to FindClass
        from void com.facebook.ckage/Class', [Lpackage/Class;' or '[[B')
        in call to FindClass
        from void com.facebook.yoga.YogaNative.jni_YGNodeCalculateLayoutJNI(long, float, float, long[], com.facebook.yoga.YogaNodeJNIBase[])'
    x0  0000000000000000  x1  0000000000002c71  x2  0000000000000006  x3  0000007fdd736130
    x4  fefeff7edc724f04  x5  fefeff7edc724f04  x6  fefeff7edc724f04  x7  7f7f7f7fff7f7f7f
    x8  00000000000000f0  x9  0000007e4e49a118  x10 0000000000000000  x11 ffffff80fffffbdf
    x12 0000000000000001  x13 0000000019c11820  x14 0000007fdd734f40  x15 ffffffffffffffff
    x16 0000007e4e56fd20  x17 0000007e4e54a130  x18 0000007e5cace000  x19 0000000000002c71
    x20 0000000000002c71  x21 00000000ffffffff  x22 0000000000000000  x23 0000000000000000
    x24 0000007dba8b5ed6  x25 0000000000000001  x26 0000000000000000  x27 0000007dbb217000
    x28 b400007e5c3076c0  x29 0000007fdd7361b0
    lr  0000007e4e4fb938  sp  0000007fdd736110  pc  0000007e4e4fb968  pst 0000000000000000
@matejdro matejdro changed the title Enabling logging on Java version crashes the app Enabling logging on Android crashes the app Jan 13, 2022
evancharlton added a commit to evancharlton/yoga that referenced this issue Aug 11, 2022
`JNIEnv`'s `FindClass(..)` function takes the classes in the standard
`foo/bar/Baz` class specification (unless they're special, like arrays).
Specifying them with `Lfoo/bar/Baz;` results in a
`ClassNotFoundException` being raised -- which is especially unhelpful
when intending to re-throw an exception.

Fixes: facebook/issues/1120
evancharlton added a commit to evancharlton/react-native that referenced this issue Aug 30, 2022
`JNIEnv`'s `FindClass(..)` function takes the classes in the standard
`foo/bar/Baz` class specification (unless they're special, like arrays).
Specifying them with `Lfoo/bar/Baz;` results in a
`ClassNotFoundException` being raised -- which is especially unhelpful
when intending to re-throw an exception.

Fixes: facebook/yoga#1120
evancharlton added a commit to evancharlton/react-native that referenced this issue Aug 30, 2022
`JNIEnv`'s `FindClass(..)` function takes the classes in the standard
`foo/bar/Baz` class specification (unless they're special, like arrays).
Specifying them with `Lfoo/bar/Baz;` results in a
`ClassNotFoundException` being raised -- which is especially unhelpful
when intending to re-throw an exception.

Fixes: facebook/yoga#1120
dmytrorykun pushed a commit to facebook/react-native that referenced this issue Sep 14, 2022
Summary:
`JNIEnv`'s `FindClass(..)` function takes the classes in the standard
`foo/bar/Baz` class specification (unless they're special, like arrays).
Specifying them with `Lfoo/bar/Baz;` results in a
`ClassNotFoundException` being raised -- which is especially unhelpful
when intending to re-throw an exception.

The docs for `JNIEnv#FindClass(..)` can be found [here][jnienv].

[jnienv]:
  https://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/functions.html#:~:text=The%20name%20argument,java/lang/String%22

## Changelog

[Android] [Fixed] - Correctly resolve classes with FindClass(..)

Pull Request resolved: #34533

Test Plan:
No exact test plan. However, if an exception is thrown during the
rendering process, a fatal `ClassNotFoundException` is raised, rather
than having the error be passed up to the `ReactNativeManager`.

Fixes: facebook/yoga#1120

Reviewed By: amir-shalem

Differential Revision: D39133326

Pulled By: jacdebug

fbshipit-source-id: 86283b7d21aed49ed0e9027b2aef85f0108cdf9a
Titozzz pushed a commit to facebook/react-native that referenced this issue Sep 26, 2022
Summary:
`JNIEnv`'s `FindClass(..)` function takes the classes in the standard
`foo/bar/Baz` class specification (unless they're special, like arrays).
Specifying them with `Lfoo/bar/Baz;` results in a
`ClassNotFoundException` being raised -- which is especially unhelpful
when intending to re-throw an exception.

The docs for `JNIEnv#FindClass(..)` can be found [here][jnienv].

[jnienv]:
  https://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/functions.html#:~:text=The%20name%20argument,java/lang/String%22

## Changelog

[Android] [Fixed] - Correctly resolve classes with FindClass(..)

Pull Request resolved: #34533

Test Plan:
No exact test plan. However, if an exception is thrown during the
rendering process, a fatal `ClassNotFoundException` is raised, rather
than having the error be passed up to the `ReactNativeManager`.

Fixes: facebook/yoga#1120

Reviewed By: amir-shalem

Differential Revision: D39133326

Pulled By: jacdebug

fbshipit-source-id: 86283b7d21aed49ed0e9027b2aef85f0108cdf9a
Titozzz pushed a commit to facebook/react-native that referenced this issue Oct 10, 2022
Summary:
`JNIEnv`'s `FindClass(..)` function takes the classes in the standard
`foo/bar/Baz` class specification (unless they're special, like arrays).
Specifying them with `Lfoo/bar/Baz;` results in a
`ClassNotFoundException` being raised -- which is especially unhelpful
when intending to re-throw an exception.

The docs for `JNIEnv#FindClass(..)` can be found [here][jnienv].

[jnienv]:
  https://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/functions.html#:~:text=The%20name%20argument,java/lang/String%22

## Changelog

[Android] [Fixed] - Correctly resolve classes with FindClass(..)

Pull Request resolved: #34533

Test Plan:
No exact test plan. However, if an exception is thrown during the
rendering process, a fatal `ClassNotFoundException` is raised, rather
than having the error be passed up to the `ReactNativeManager`.

Fixes: facebook/yoga#1120

Reviewed By: amir-shalem

Differential Revision: D39133326

Pulled By: jacdebug

fbshipit-source-id: 86283b7d21aed49ed0e9027b2aef85f0108cdf9a
diegolmello pushed a commit to RocketChat/react-native that referenced this issue Feb 2, 2023
Summary:
`JNIEnv`'s `FindClass(..)` function takes the classes in the standard
`foo/bar/Baz` class specification (unless they're special, like arrays).
Specifying them with `Lfoo/bar/Baz;` results in a
`ClassNotFoundException` being raised -- which is especially unhelpful
when intending to re-throw an exception.

The docs for `JNIEnv#FindClass(..)` can be found [here][jnienv].

[jnienv]:
  https://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/functions.html#:~:text=The%20name%20argument,java/lang/String%22

## Changelog

[Android] [Fixed] - Correctly resolve classes with FindClass(..)

Pull Request resolved: facebook#34533

Test Plan:
No exact test plan. However, if an exception is thrown during the
rendering process, a fatal `ClassNotFoundException` is raised, rather
than having the error be passed up to the `ReactNativeManager`.

Fixes: facebook/yoga#1120

Reviewed By: amir-shalem

Differential Revision: D39133326

Pulled By: jacdebug

fbshipit-source-id: 86283b7d21aed49ed0e9027b2aef85f0108cdf9a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant