Hello, when you have a time, could you look at my changes in the mingw_setjmp_v3.patches file sent in the previous email?
Just for information all those commits were applied on the top of the master branch at time of sending them, which was on top of the commit 088d2039f9f5ca872092c7a03c765936a93011f8 I understand that it is quite a larger change and probably needs more time for looking it at. Commits are prepared in a way that they can be applied also one-by-one with respect to tests. So it is possible to take and look at just first few of them. On Tuesday 27 October 2026 19:15:59 Pali Rohár wrote: > Hello, I have addressed all found issues with setjmp/longjmp functions > and in the attachment I'm sending a new version of all changes (this > replaces all previous setjmp/longjmp changes). > > Kirill run CI testing on github: > https://github.com/maiddaisuki/mingw-w64/actions/runs/40458503497 > > We have enabled also testing against ucrtapp and we figured out that > there are failing more complex math tests for clang+ucrtapp+i686/x86_64 > combination (for all other combinations tests are passing). And these > complex math tests are failing also without these changes. > > During development more setjmp/longjmp tests were failing on arm64ec > (with all libs) and with ucrtapp (on all arch). I think that I have > addressed all setjmp/longjmp issues in ucrtapp and I have tried to > address also arm64ec issues. But as I do not have arm64ec testing env, > I have just written the arm64ec code blindly and let the github CI to > run it if it pass. So I would kindly ask if you could review the arm64ec > changes more deeply. > > > Note that there is one missing thing for i386 setjmp/longjmp: The > _setjmp3 CRT function is taking the trylevel parameter and pointer to > unwind function. Both of these parameters are required when calling the > setjmp from the function which register itself its own SEH handler which > also handles __try / __except blocks. gcc does not support __try / > __except keywords, so does not have to care about these in-between > try/except jumps. But clang supports __try / __except blocks, so calling > setjmp() inside such function still will be SEH-unsafe (as before). > To fix this issue and make the setjmp/longjmp fully SEH-safe on i686 > clang, it is needed cooperation with compiler. More precisely getting > access to the current "trylevel" on the called place and pointer to > "unwind" function specific just for that function. > > If somebody wants to follow and fix this remaining i686 setjmp issue, it > would be nice to have builtins from compiler for it. And then the 32-bit > x86 setjmp() macro could be extended to call those builtins to properly > call the _setjmp3 CRT function. _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
