Bug 1482 - JavaCallback can throw NPE during invocation
Summary: JavaCallback can throw NPE during invocation
Status: RESOLVED FIXED
Alias: None
Product: Gluegen
Classification: JogAmp
Component: core (show other bugs)
Version: 2.6.0
Hardware: All all
: P4 normal
Assignee: Mathieu Féry (MathiusD)
URL:
Depends on:
Blocks:
 
Reported: 2023-12-06 14:25 CET by Mathieu Féry (MathiusD)
Modified: 2024-01-06 04:03 CET (History)
2 users (show)

See Also:
Type: DEFECT
SCM Refs:
d56cd13883c2af1f42906a5327c78b1a7c684012 dccb9a85e39cf82bd32ef28cb0202e2d486328ec
Workaround: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Féry (MathiusD) 2023-12-06 14:25:40 CET
When callback from native api are invoked, Gluegen dispatch event to JavaCallback registered and convert CompoundType into CompoundTypeWrapper related, but if native callback can pass NULL pointer, wrapping fail with NPE.

(Example : JOAL with ALC_SOFT_system_events, atm device parameter are always NULL)
Comment 1 Mathieu Féry (MathiusD) 2023-12-06 14:28:54 CET
I've made a patch available here : https://github.com/MathiusD/gluegen in 1482-npe-on-java-callback-call-with-native-null-ptr

Comparison link : https://github.com/JogAmp/gluegen/compare/master...MathiusD:gluegen:1482-npe-on-java-callback-call-with-native-null-ptr
Comment 2 Sven Gothel 2024-01-06 04:03:48 CET
Merged, thx