Skip to content

Conversation

@mattsinc
Copy link

@mattsinc mattsinc commented Nov 2, 2021

The malloc for the imgsrc filename in dwt2d leaks memory because it
does not allocate space for the trailing \0 to end the string. This
commit fixes that.

Matt Sinclair and others added 6 commits April 3, 2021 16:13
ParticleFilter in Rodinia fails when run on the head of GPGPU-Sim
with a memory corruption.  Looking further into the failures with
valgrind, there were numerous uninitialized values in the arrays
that were being accessed subsequently, causing the memory
corruption error.  To resolve this, all mallocs have been changed
to callocs, which intiializes all locations to 0 and removes the
error.  From looking at the code, it appears these locations
were assumed to be 0 all along, so this fix does not affect any
functionality.
Print warning occurred because %d was used instead of %ld, this
commit fixes that.
Update all cudaThreadSynchronize calls to cudaDeviceSynchronize,
which has replaced it in more modern CUDA versions.
fix particlefilter so it can run in GPGPU-Sim
The malloc for the imgsrc filename in dwt2d leaks memory because it
does not allocate space for the trailing \0 to end the string.  This
commit fixes that.
@mattsinc
Copy link
Author

mattsinc commented Nov 2, 2021

I confirmed these with valgrind -- putting in the changes made the leaks go away.

@tgrogers
Copy link
Contributor

tgrogers commented Nov 2, 2021

Thanks, Matt. Good old strlen :)
Can you merge this into dev - then we can get it in the next release?

@mattsinc mattsinc changed the base branch from release to dev November 2, 2021 01:15
@mattsinc
Copy link
Author

mattsinc commented Nov 2, 2021

Better?

@tgrogers tgrogers merged commit e2f523f into accel-sim:dev Nov 2, 2021
LAhmos pushed a commit to purdue-aalp/gpu-app-collection-public that referenced this pull request Jul 6, 2025
dwt2d: fix memory leak in filename malloc
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

Successfully merging this pull request may close these issues.

3 participants