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

local_get_buffer() Valgrind error #11

Closed
njpillitteri opened this issue May 15, 2015 · 3 comments
Closed

local_get_buffer() Valgrind error #11

njpillitteri opened this issue May 15, 2015 · 3 comments

Comments

@njpillitteri
Copy link
Contributor

I'm trying to debug what I think it stack corruption in my program, and I came across this. I'm not sure if it's related to my problem.

==865== Thread 2:
==865== Syscall param ioctl(generic) points to uninitialised byte(s)
==865== at 0x4B8B76C: ioctl (syscall-template.S:81)
==865== by 0x487C2C7: local_get_buffer (in /usr/lib/libiio.so.0.5)
==865== Address 0x57f6d38 is on thread 2's stack
==865==

@lclausen-adi
Copy link

Hi,

What happens here is that an uninitialized memory region is passed to the ioctl function, which is OK in this case since the kernel will initialize the memory region. It's just that valgrind doesn't know about these specific semantics of the IIO ioctls.

But anyway we already fixed it a while ago by fully initializing the struct see commit cb8104b

@njpillitteri
Copy link
Contributor Author

I was up to date and had that commit and still getting a Valgrind error. I pulled a commit that fixed it by memsetting a struct to 0s.

@pcercuei
Copy link
Contributor

I merged your pull request, so I'll close this issue now.
Thanks!

rgetz added a commit that referenced this issue Dec 16, 2016
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

3 participants