jpeg plugin crashes in Win64 #119

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

Comments

Projects
None yet
1 participant
@nicolas-cellier-aka-nice
Contributor

nicolas-cellier-aka-nice commented Feb 20, 2017

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

This comment has been minimized.

Show comment
Hide comment
@nicolas-cellier-aka-nice

nicolas-cellier-aka-nice Feb 21, 2017

Contributor

Fixed by pull request #120, commit 9ffa643

Contributor

nicolas-cellier-aka-nice commented Feb 21, 2017

Fixed by pull request #120, commit 9ffa643

estebanlm added a commit to estebanlm/opensmalltalk-vm that referenced this issue Jun 21, 2017

Merge pull request #119 from zecke/spur64-freebsd
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