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

Crash when calling hiddbgIsHdlsVirtualDeviceAttached() #653

Closed
cathery opened this issue Nov 3, 2024 · 1 comment
Closed

Crash when calling hiddbgIsHdlsVirtualDeviceAttached() #653

cathery opened this issue Nov 3, 2024 · 1 comment

Comments

@cathery
Copy link
Contributor

cathery commented Nov 3, 2024

Was having some trouble getting Hdls to work, I was doing everything correctly but it would always crash when calling e.g. hiddbgIsHdlsVirtualDeviceAttached().

After a bit of debugging I realized the function tries to access g_hiddbgHdlsTmem.src_addr where src_addr is NULL.
This wasn't a problem before, but the PR #601 switched from using tmemCreate to tmemCreateFromMemory to initalize g_hiddbgHdlsTmem, which seems to have thrown a wrench into things.

After I changed tmemCreateFromMemory to properly initialize t->src_addr, everything started working again.

tmem.c(52):

-    t->src_addr = NULL;
+    t->src_addr = buf;
@fincs
Copy link
Contributor

fincs commented Nov 3, 2024

t->src_addr is only non-NULL when the TransferMemory object owns its memory. tmemCreateFromMemory is used to create a TransferMemory object which does not own its memory. hiddbgIsHdlsVirtualDeviceAttached should probably be fixed to not rely on reading src_addr.

@cathery cathery changed the title tmemCreateFromMemory doesn't initialize t->src_addr Crash when calling hiddbgIsHdlsVirtualDeviceAttached() Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants