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

Fix fatal crash on 64 bit Linux #687

Merged
merged 2 commits into from
Jan 6, 2016
Merged

Fix fatal crash on 64 bit Linux #687

merged 2 commits into from
Jan 6, 2016

Conversation

stweil
Copy link
Contributor

@stweil stweil commented Jan 6, 2016

No description provided.

stweil added 2 commits January 6, 2016 21:40
Some lines ended with spaces. Remove them.

Signed-off-by: Stefan Weil <[email protected]>
By default, OpenJPEG uses the function memalign to allocate aligned
memory on Linux systems. That function needs malloc.h which was
missing. This results in a compiler warning:

openjpeg/src/lib/openjp2/opj_malloc.c:63:3: warning:
 implicit declaration of function ‘memalign’
 [-Wimplicit-function-declaration]

On hosts where sizeof(int) < sizeof(void *) the return value of memalign
will be truncated which results in an invalid pointer.

That caused "make test" to produce lots of segmentation faults when
running on a 64 bit Linux host.

Signed-off-by: Stefan Weil <[email protected]>
@stweil
Copy link
Contributor Author

stweil commented Jan 6, 2016

I did not notice this bug earlier because I normally work with patch #648 applied (so I use posix_memalign with the correct header files instead of memalign with missing header files). I wonder why not more people running 64 bit Linux were affected by the problem.

mayeut added a commit that referenced this pull request Jan 6, 2016
Fix fatal crash on 64 bit Linux
@mayeut mayeut merged commit 0dd44e7 into uclouvain:master Jan 6, 2016
@stweil stweil deleted the memalign branch January 6, 2016 22:29
@stweil
Copy link
Contributor Author

stweil commented Jan 6, 2016

The bug was added recently (in commit 0dc4914).

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.

2 participants