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

jpeg plugin crashes in Win64 #119

Closed
nicolas-cellier-aka-nice opened this issue Feb 20, 2017 · 1 comment
Closed

jpeg plugin crashes in Win64 #119

nicolas-cellier-aka-nice opened this issue Feb 20, 2017 · 1 comment

Comments

@nicolas-cellier-aka-nice
Copy link
Contributor

My 1st finding is that crashes allways occur in setjump().

setjump() is used in primJPEGWriteImageonByteArrayformqualityprogressiveJPEGerrorMgrWriteScanlines as the return point for the error_exit() - called by jpeg library in case of error.
See platforms/Cross/plugins/JPEGReadWriter2Plugin/sqJPEGReadWriter2Plugin.c

error_exit() will then use longjmp to go to the exit point.
See platforms/Cross/plugins/JPEGReadWriter2Plugin/Error.c

But the call to setjump does not allways crash. It sometimes succeed, sometimes crash.

My 2nd finding is that it works when the jump_buf is 16-bytes aligned (hex address ending by 0), but fails when 8 bytes-aligned (hex address ending by 8).

This seems confirmed by other bug reports (google: setjmp win64 failure 16bytes aligned)
https://bugs.launchpad.net/pbxt/+bug/688404

A workaround would be to store a pointer to the jump_buf in struct error_mgr2, and properly align the jump_buf with alloca() or something...

@nicolas-cellier-aka-nice
Copy link
Contributor Author

Fixed by pull request #120, commit 9ffa643

estebanlm added a commit to estebanlm/opensmalltalk-vm that referenced this issue Jun 21, 2017
freebsd: Add necessary fields for AMD64 on FreeBSD
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

1 participant