For the record, the commit in Mingw-packages is cf52b888301d4e0f66cf5116b0d9f4955876cb54 link to commit in github That commit included the proposed change to tif_ojpeg.c, which I reckon it is unnecessary. Thank you.
Tested with unpatched 2.0.1 on mingw64 (gcc/msvcrt), ucrt64 (gcc/ucrt), clang64 (clang/ucrt), plus patched 2.0.1 (clang/ucrt). Same output as yours on all cases.
Thanks for the reference. oscar@w10x64-vm-sky CLANG64 /d $ echo | clang -dM -E - | grep clang #define __clang__ 1 #define __clang_literal_encoding__ "UTF-8" #define __clang_major__ 20 #define __clang_minor__ 1 #define __clang_patchlevel__ 5 #define __clang_version__ "20.1.5 " #define __clang_wide_literal_encoding__ "UTF-16" oscar@w10x64-vm-sky CLANG64 /d $ echo | clang -dM -E - | grep -i gnu #define __GNUC_MINOR__ 2 #define __GNUC_PATCHLEVEL__ 1 #define __GNUC_STDC_INLINE__ 1 #define __GNUC__ 4 So...
We fixed the problem by applying the patch below. It also modifies tif_ojpeg.c for consistency. Do you remember why mingw32 was changed to use __builtin_setjmp/__builtin_longjmp? Index: base/tkimg.h =================================================================== --- a/base/tkimg.h (revision 957) +++ b/base/tkimg.h (working copy) @@ -24,7 +24,7 @@ # define tkimg_vsnprintf vsnprintf #endif /* _MSC_VER_ */ -#if defined(__MINGW32__) +#if defined(__MINGW32__) && !defined(__aarch64__) && !defined(_UCRT)...
Changing base/tkimg.h to use plain setjmp/longjmp instead of the __builtin variants removes the crash, as well as the warnings. I'll ask some people about what's going on and come back with a patch. Thank you.
Changing base/tkimg.h to use plain setjmp/longjmp instead of the __builtin variants removes the crash. I'll ask some people about what's going on and come back with a patch. Thank you.
This looks like Tk is trying to load the jpg file as if it were a png, isn't it? #0 png_error (png_ptr=png_ptr@entry=0x30fb890, error_message=0x7ff980e71222 <.refptr.png_sRGB_table+1418> "Not a PNG file") at D:/dev/other/tkimg-code/compat/libpng/pngerror.c:82 #1 0x00007ff980e5431e in png_read_sig (png_ptr=png_ptr@entry=0x30fb890, info_ptr=<optimized out>) at D:/dev/other/tkimg-code/compat/libpng/pngrutil.c:139 #2 0x00007ff980e48f1a in png_read_info (png_ptr=0x30fb890, info_ptr=0x7ff980e71222 <.refptr.png_sRGB_table+1418>)...
I'm using tcl/tk 8.6.16. There are no other extensions loaded, just the code above executed with wish. I tried to replicate the problem in Linux, to no avail, even with Valgrind, but please note that Windows and Linux have different ABIs and different C runtimes. It is interesting that the crash does not happen with the MinGW64 environment (which uses the old MSCVCRT runtime). All packages in MSYS2 (a few thousands of them) are built with -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong and AFAIK...