GNOME Bugzilla – Bug 163212
Script-fu crash in Windows 2000 simplified Chinese version
Last modified: 2008-01-15 12:44:26 UTC
Please describe the problem: Script-fu crashed when start gimp in Windows 2000 simplified Chinese version. Script-fu can not work when gimp start up. Steps to reproduce: 1. Start gimp in Windows 2000 simplified Chinese version. 2. Script-fu will crash. 3. Actual results: Script-fu crashed Expected results: Does this happen every time? Yes. Other information: A dialog is prompted, which displays script-fu.exe error.
Could be a duplicate of bug #162590. Please start gimp from a console window and tell us if you get any error messages. I cannot reproduce the problem with the current CVS version so it has most likely been fixed already.
Output from Dr. MinGW, when trying with current CVS: Call stack: 00410E02 script-fu.exe:00410E02 gen_intern slib.c:1134 LISP gen_intern( char * name = &'U', long int copyp = 1 ) ... while ((c = *cname++)) hash = ((hash * 17) ^ c) % n; > sl = obarray[hash]; } else ... 00410F3E script-fu.exe:00410F3E rintern slib.c:1169 LISP rintern( char * name = &'U' ) ... { return (gen_intern (name, 1)); > } LISP ... 004092FF script-fu.exe:004092FF init_constants siod-wrapper.c:343 static void init_constants( ) ... g_free (tmp); > setvar (rintern (scheme_name), flocons (unit), NIL); g_free (scheme_name); ... 00408D46 script-fu.exe:00408D46 siod_init siod-wrapper.c:174 void siod_init( gboolean local_register_scripts = 1 ) ... init_constants (); > } static void convert_string (gchar *str); ... 004015F5 script-fu.exe:004015F5 script_fu_run script-fu.c:195 static void script_fu_run( const gchar * name = &'e', gint nparams = 0, const GimpParam * param = &(indirect), gint * nreturn_vals = &2293384, GimpParam * * return_vals = &0x006b84d4 ) ... /* Init the interpreter */ > siod_init (TRUE); } else ... 005C2D90 libgimp-2.0-0.dll:005C2D90 gimp_attach_new_parasite 005C2A44 libgimp-2.0-0.dll:005C2A44 gimp_attach_new_parasite 005C183C libgimp-2.0-0.dll:005C183C gimp_main 00401309 script-fu.exe:00401309 main script-fu.c:69 int main( int argc = 6, char * * argv = &0x00e94c35 ) ... > MAIN () static void ... 004011E7 script-fu.exe:004011E7 00401238 script-fu.exe:00401238 7C816D4F kernel32.dll:7C816D4F RegisterWaitForInputIdle
What is Dr. MinGW trying to tell us here?
The output from Dr. MinGW is saying the Script-Fu plug-in died while trying to initialize the SIOD component during startup. The actual error occured in the gen_intern() routine of SIOD when it was doing a hash table operation related to registering the name of a GIMP unit prior to assigning the value for the named constant. The problem is probably related to bug #153747. The name of one of the GIMP unit types has been translated to Chinese and, as a result, it contains non-ASCII characters which SIOD can't handle.
I tried changing LANG to zh_CN under Linux but did not experience the start up problem with Script-Fu so I am unable to test a fix. One change that might be worth trying would be to alter line 1133 of plug-ins/script-fu/siod/slib.c from: hash = ((hash * 17) ^ c) % n; to hash = ((hash * 17) ^ (c & 0x7F)) % n;
Oops...there is a %n at the end so it shouldn't be a case of an out of bound array reference in that line.
*** Bug 161787 has been marked as a duplicate of this bug. ***
Why is this report set to NEEDINFO?
It is set to NEEDINFO because you set it that way when you wrote comment #1 and nobody ever unset it.
*** Bug 170283 has been marked as a duplicate of this bug. ***
Actually, this might be a duplicate of bug #165002, which got fixed in CVS a few days ago.
*** Bug 172489 has been marked as a duplicate of this bug. ***
Did anyone got a chance to test if the fix for bug #165002 fixes the problem? It would really help if the Win32 users could contribute a little to the development and at least try to test some changes before they are released as binary packages...
Yes, the problem was fixed in win32 binary of version 2.2.4.
The Problem still exists in 2.2.4 by installing and running it under Japanese Windows XP SP2.
The Problem still exists in 2.2.4 by installing and running it under Traditional Chinese Windows XP SP2.
Could you please try this with Tiny-Fu 0.9.8? http://www.interlog.com/~kcozens/software/gimp/tiny-fu.html Remove the script-fu.exe from the plug-ins directory during testing (or rename it to something like script-fu.exe.off).
OK, it is no problem now.
Tiny-Fu 0.9.8 runs perfectly with GMP 2.2.4 under Japanese Windows XP SP2. No problem while initialization nor recalling it from menu. What is the difference between 2 plug-ins?
Tiny-Fu uses a different scheme interpreter (Tinyscheme instead of SIOD), offers more functions (epsecially with file and directory handling), handles Unicode a lot better and has a dedicated maintainer - Thank you, Kevin :) It is supposed to replace Script-Fu. An additional difference is that it currently doesn't have localized menu entries, this seems to be a general problem with third party plug-ins or my way of building them. I hope this isn't the thing that makes it run on your systems.
The issue with the localized menus is solved now.
It would be nice if someone who has experienced these issues could try gimp-2.2.6. After all this is likely a duplicate of bug #165002 which got fixed with the 2.2.5 release.
This still happens with GIMP 2.2.6 - and I don't think it is a duplicate of bug #165002, because just setting LANG=zh_CN doesn't add non-ascii characters to my otherwise working script-fu path, does it?
During initialization Script-Fu queries GIMP for a list of enums and built-in units. The enum and unit names received from the queries to GIMP are in the users specified langugage. If the specified language uses non-ASCII characters, Script-Fu will find itself trying to handle these characters during the initialization of constants.
I am using Traditional Chinese WinXP SP1 with LANG=zh_TW.utf8 I had the same problem on both Script-Fu & Tiny-Fu when I installed GIMP 2.2.7, GTK+ 2.6.7 & Tiny-Fu 0.9.8 (All are Windows Installer). Both Script-Fu & Tiny-Fu complain a missing dll(different dll on Script-Fu & TIny-Fu, but they locate on GIMP-2.0\bin directory). After I copy all dlls from GIMP-2.0\bin to GIMP-2.0\lib\gimp\2.0\plug-ins directory, both stop complaining when being called by command line, but Script-Fu still crashes when (1)GIMP starts & (2)select options in GIMP menu...
The DLL copying is a different problem, please don't mix it in here.
IIRC, I noticed this on the GIMP for Windows page FAQ: ===== The Gimp 1.2.5 crashes on startup if the locale is set to Chinese (and possibly other far-eastern languages). What can I do? This seems to be an issue with GTK+ 1.3. 3 workarounds are known: Solution 1: Windows 95/98/98SE: add the following line to C:\AUTOEXEC.BAT: set LANG=en and reboot the computer. Windows NT/2000/XP: right-click on My Computer, choose Properties, select the Advanced tab and click the Environmental Variables button. In the window which opens, click then New... button, and set LANG as the Variable name and en as the Variable Value (it does not matter if you create the variable in User or System variables, however, it's recommended to create it in System Variables section, as this will fix the problem for other users, too) Solution 2: uninstall The Gimp and install it again without the Localization component (you may also have to delete folder locale from your Program Files\Common Files\GTK\1.3\lib) Solution 3: copy the correct gtkrc.XX file (depending on your language) from your Program Files\Common Files\GTK\1.3\etc\gtk directory to your Program Files\Gimp\etc\gimp\1.2 and rename it to gtkrc. ===== Could this have any relevance to this problem?
Script-fu crash in Windows XP Professional simplified Chinese version eithier. GIMP -- gimp-2.2.7-i586-setup.zip -- version 2.2.7 GTK+ -- gtk+-2.6.7-setup.zip or gtk+-2.6.7-setup-2.zip -- version 2.6.7
*** Bug 311073 has been marked as a duplicate of this bug. ***
*** Bug 311402 has been marked as a duplicate of this bug. ***
Script-fu crashes on OS: WinXP Pro SP1 zh_CN Files: gtk+-2.6.9-setup.zip gimp-2.2.8-i586-setup.zip gimp-help-2-0.9-setup.zip gimp-gap-2.0.2-setup.zip
Someone at a Chinese forum found a workaround to this problem: http://freesf.tnc.edu.tw/modules/newbb/viewtopic.php?topic_id=3146&forum=13 1. Go to the path C:\Program Files\GIMP-2.0\lib\gimp\2.0\plug-ins\ 2. Locate the file "script-fu.exe", Right-Click > Properties 3. Select the Compatibility Tab 4. Check the box "Run this program in Compatibility Mode for" 5. Select "Windows 2000" in the pull-down menu 6. Click Ok to confirm this setting I personally verified this workaround does work on Windows 2003.
It is work on Windows XP and Traditional Chinese, Thanks.
Can't reproduce by setting LANG=zh_CN and running a releatively freshly built GIMP from the 2.2 branch, not against GTK 2.6 nor 2.8. Does this occur only on a real East Asian installation? (But Michael Schumacher has been able to reproduce it?) Comment #27 is quite irrelevant, but there isn't any way to remove comments, sigh.
(BTW, Re: Sven's Comment #1, starting GIMP from a console window won't make any output visible. One needs to redirect standard output (and error) to a file or a pipe... (gimp-2.2 >gimp.log 2>&1) gimp is a windowing application, by default its stdout and stderr don't go anywhere, regardless if it is started from Explorer or from a command prompt.)
Re: Comment #34 Tor: I have only tried it based on the official installer packages downloaded from Sourceforge, haven't compiled anything from scratch: GTK-2.6.9 for Windows GIMP-2.2.8 for Windows The workaround mentioned in Comment #32 only works for some systems while not on others. So it's not really a solution at all. Also, if my memory serves me right, this bug is not represent when using GTK-2.4.x+ Win32 package. I have never tried GTK-2.8.x+ so I can't comment on that either.
One more thing, the Script-fu crash would not happen if you set the LANG=en_US by hand or by the Language Chooser from GTK-2.6.9.
As I now have a MSDN subscription, I guess I could download a real Chinese version Windows XP and install in a vmware virtual machine... How hard is it to install if you don't understand Chinese?
Re: Comment #38 Tor: You don't really need to install Chinese version Windows XP to re-produce the error. Just install an English Windows XP Professional (Not Home) Edition, which has multi-language support. In the middle of installation, it will let you configure whether to install East Asian Language Support (Font, Input Method Engine, etc.), choose yes, and then proceed. When you have finished the installation, then you can go ahead and install GIMP & GTK. In the latest version of GTK-2.6.9, there is a Language Chooser in the Start Menu, use it to switch to zh_TW or zh_CN to change the GTK & GIMP interface to Chinese. Then you can start GIMP and try to re-produce the bug when Script-fu is being initialized.
Yes, I have XP Pro, and of course I have East Asian language support installed. Otherwises I couldn't really test input and output of these scripts at all. I also have various additional input loclaes configured so I can switch to inputting for instance Chinese or Japanese (using the IMEs) or Greek, Hebrew or Arabic. But the system codepage on my system is still 1252, while on a real Chinese Windows installation, it's 936. That is an important difference. (Although maybe not important for this bug, though, if it really is possible to reproduce this bug on a European Windows installation.) All the GTK+ Language Chooser in the Start Meny does, as far as I know, is causing the LANG (or LC_ALL?) environment variable to be set to that value when running GIMP. (Schumi, can you confirm?) So it's trivial to do the same thing just from the command line, which I did when trying to reproduce this. (I don't install GIMP or GTK+ using any installer on my main system, as I need complete control of it, and build GIMP, GTK+ etc myself anyway, but I could use the installers on a scratch virtual machine if necesssary to reproduce this bug.)
> I don't install GIMP or GTK+ using any installer on my main system, > as I need complete control of it, and build GIMP, GTK+ etc myself > anyway, but I could use the installers on a scratch virtual machine > if necesssary to reproduce this bug. You probably need to do this. I know that GTK-2.6.9 from the installer package has fixed certain bugs in earlier 2.6.x versions, so I am quite sure it is a build related problem, at least partially.
I can still reproduce this with a recent - although not current - GIMP 2.2 build. Tonight I'll try if this happens with a current one as well.
*** Bug 318269 has been marked as a duplicate of this bug. ***
gimp-2.2.8/plug-ins/script-fu/siod/slib.c 1131 to 1135 cname = name; while ((c = *cname++)) hash = ((hash * 17) ^ c) % n; sl = obarray[hash]; } bug fix cname = name; while ((c = *cname++)) hash = ((hash * 17) ^ c) % n; if (hash < 0) hash = -hash; sl = obarray[hash]; } c < 0 It may not operate.
Was the problem solved?
Has the QA looked at the fix mentioned in Comment #44?
As soon as you renew your support contract subscription.
maybe solved... my system cpu:intel cel 2.4ghz ram:256 OS: Windows XP.sp2 cc: gcc-3.4.4 (mingw special)(latest) GIMP: 2.2.8 stable GTK+:latest (2.8?) make:mingw32-make.exe(latest) thanks very much~ hide~(xjapan?) now i'm veryvery happy... but... still can't loading gimp modules...
Re: Comment #47 > As soon as you renew your support contract subscription That's real nice. I take it you mean negative then. Don't feel pressured, I am just curious if this can fix the problem. Re: Comment #48 > now i'm veryvery happy... > but... still can't loading gimp modules... In that case, script-fu isn't working as it supposed to be, is it?
my fix is hash = ((hash * 17) ^ (unsigned char)c) % n; simple than hide's fix -- >> now i'm veryvery happy... >> but... still can't loading gimp modules... >In that case, script-fu isn't working as it supposed to be, is it? -- script-fu is working very well! module loading is other problem i clicked [Module browse]->[Load] many many times but it is not effected ... module state is still not loaded..
I think that the cause by which script-fu crashes in the environment of a 2-byte character is in #44. Does a developer have the intention corrected to this bug? It is not corrected in two high versions. 2.2.9 2.3.4.... It is a problem peculiar to Win XP that I have stated, and it does not reappear in Win2000. I am doing problem institution here, after pointing out by (Bug 318269). A prudent act of a development group is desired.
This bug persists in the latest version of GIMP-2.2.9 and GTK+ 2.8.6 for Windows.
*** Bug 321064 has been marked as a duplicate of this bug. ***
2005-12-12 Michael Schumacher <schumaml@cvs.gnome.org> * plug-ins/script-fu/siod/slib.c: added a fix for the script-fu crash in chinese (and maybe other) locales. Applied to both branches. Fixes bug #163212.