You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm a big fan of the malgo package! While exploring the io_api example, I encountered an error related to a nil pointer dereference. The issue seems to stem from stream() using malgo.DefaultContext, which is initially nil. This triggers the error "invalid memory address or nil pointer dereference" when calling malgo.InitDevice() in
While this workaround solves the immediate problem, it feels a bit like a hack. Is there a recommended approach to avoid this nil pointer issue in the io_api example?
The text was updated successfully, but these errors were encountered:
wjkoh
changed the title
Nil pointer dereference in io_api example
Nil pointer dereference in io_api example
Oct 23, 2024
Hi @gen2brain,
I'm a big fan of the malgo package! While exploring the
io_api
example, I encountered an error related to a nil pointer dereference. The issue seems to stem fromstream()
usingmalgo.DefaultContext
, which is initiallynil
. This triggers the error "invalid memory address or nil pointer dereference" when callingmalgo.InitDevice()
inmalgo/_examples/io_api/stream.go
Line 10 in d802981
Temporary Fix:
I was able to work around this by initializing a context and setting
malgo.DefaultContext
before callingio_api
functions:Question:
While this workaround solves the immediate problem, it feels a bit like a hack. Is there a recommended approach to avoid this nil pointer issue in the
io_api
example?The text was updated successfully, but these errors were encountered: