Re: [Tuxpaint-devel] Hidden bug on Windows?
An award-winning drawing program for children of all ages
Brought to you by:
wkendrick
|
From: TOYAMA Shin-i. <sh...@wm...> - 2021-10-16 00:04:40
|
Thanks Pere! Then I should get all the mtw() staff back and dig into the deep. I will focus on Onscreen Keyboard at first. I am wondering if it might be worth trying to directly use mbstowcs_s() on Windows to avoid using iconv(). https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/mbstowcs-s-mbstowcs-s-l?view=msvc-160 Hrm... Pere Pujal i Carabantes wrote in <b7c...@gm...> >Hi, > >El dv. 15 de 10 de 2021 a les 13:43 +0900, en/na TOYAMA Shin-ichi va escriure: >> Hi, >> >> I strongly hope this will be a final report. >> >> Here is a brief (long?) history; >> >> 1) OSK crash regarding libiconv reported in, >> https://sourceforge.net/p/tuxpaint/bugs/235/ >> 2) Win32 specific codes mtw() using iconv(), alternative to >> mbstowcs(), were removed and once seemed to work fine. >> 3) Found that it still crash only on Windows10 and later. >> 4) Trial to sepalate mtw() to single lib failed. >> 5) Found that it crash not when using OSK, but when loading >> labels embedded in png drowings. >> >> At this point, I remember that Bill mentiond that iconv() is >> also used in do_png_embed_data() in bugs/235 above. >> >> Then, I also removed "#ifdef WIN32" part in this function, and >> it seems to work quite fine! >> >> Patch to 0.9.26 is attached and binary packages are available >> from, >> >> https://z1.plala.jp/tuxpaint/release/0.9.26-4/ > >I am sorry to say it still doesn't work fine with labels, >it seems to work fine if the drawing stays in Windows, but when you >import/export a drawing between Linux and Windows then there are >problems. > >I've made a drawing in Linux (800x600) with all the strings duplicated, >once as text and again as labels, you could get it at >https://provant.freeddns.org/pere/public_html/developing/20211015/20211015205933.png > >See how only the first label string, made with the plain abcd row >of the onscreen keyboard is displayed in 0.9.26-4, instead 0.9.26 >displays and edits all labels correctly(both with compatibility >mode activated in W10). > > > >> >> By the way, I am quite at a loss what for those WIN32 specific >> code were needed, because patched code also compiled on the old >> mingw/msys environment and works fine on Windows XP just by >> defining lacking strtok_r() in onscreen_keyboard.c as follows. >> >> #define strtok_r(line, delim, pointer) strtok(line, delim) >> >> I am not sure but those code might have been tweaked when >> compiling in older build environment. > >I really don't know, I remember struggling and testing tons of things >until found something that seemed to make labels compatible >between Linux and Windows, not sure if we are talking about the same code. > > >Thanks >Pere > > >> >> Anyway, I think very carefull review and tests are required >> before releasing them. >> >> Hope your help! >> >> Thanks. >> >> >> TOYAMA Shin-ichi wrote in <6168e3c0.4965%sh...@wm...> >> > Just a brief report. >> > >> > Deleting mtw() seems to be OK. >> > >> > I found crash when loading drowing with labels occur in other >> > part. >> > >> > ------------------------------------------------------------ >> > Thread 1 received signal SIGSEGV, Segmentation fault. >> > 0x00007ffd86ab7f09 in msvcrt!memmove () from C:\WINDOWS\System32\msvcrt.dll >> > (gdb) backtrace >> > #0 0x00007ffd86ab7f09 in msvcrt!memmove () >> > from C:\WINDOWS\System32\msvcrt.dll >> > #1 0x00007ff6e502743e in load_embedded_data () >> > #2 0x00007ff6e50281f2 in load_current () >> > #3 0x00007ff6e5036842 in SDL_main () >> > #4 0x00007ff6e504461b in console_main () >> > #5 0x00007ff6e50446f8 in WinMain () >> > #6 0x00007ff6e50013b1 in __tmainCRTStartup () >> > at C:/_/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:321 >> > #7 0x00007ff6e50014c6 in WinMainCRTStartup () >> > at C:/_/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:176 >> > ------------------------------------------------------------ >> > >> > Thanks. >> > >> > TOYAMA Shin-ichi wrote in <61681fa6.4962%sh...@wm...> >> > > I was wrong again ;-< >> > > >> > > It crash when re-opening drawing with labels..... >> > > >> > > Sorry for the mess. >> > > >> > > >> > > TOYAMA Shin-ichi wrote in <61681264.4961%sh...@wm...> >> > > > Hi, >> > > > >> > > > It is becoming clear. >> > > > >> > > > I suppose it was wrong to delete WIN32 specific code in >> > > > load_info_about_label_surface() function for 0.9.26-2. >> > > > >> > > > Pere Pujal i Carabantes wrote in >> > > > <693...@gm...> >> > > > > Unfortunately msys mbstowcs() seems not work outside ascii :( >> > > > >> > > > Because I am not so sure about this, I removed mtw() from >> > > > onscreen_keyboard.c and tuxpaint.c again and just replaced mtw() >> > > > in the label function with mbstowcs() not deleting all the >> > > > windows specific part. >> > > > >> > > > It seems to work fine for me. >> > > > No crash, rapid osk layout change and no problem when using labels >> > > > and osk with Japanese characters! >> > > > >> > > > Could you please give a try to 0.9.26-3 packages in >> > > > >> > > > https://z1.plala.jp/tuxpaint/release/0.9.26-3/ >> > > > >> > > > If they are fine also for you, I will commit the changes to the >> > > > git repo. >> > > > >> > > > Thanks! >> >> _______________________________________________ >> Tuxpaint-devel mailing list >> Tux...@li... >> https://lists.sourceforge.net/lists/listinfo/tuxpaint-devel > > > >_______________________________________________ >Tuxpaint-devel mailing list >Tux...@li... >https://lists.sourceforge.net/lists/listinfo/tuxpaint-devel -- TOYAMA Shin-ichi mailto:sh...@wm... |