After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 163212 - Script-fu crash in Windows 2000 simplified Chinese version
Script-fu crash in Windows 2000 simplified Chinese version
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Script-Fu
2.2.x
Other Windows
: Normal normal
: 2.2
Assigned To: GIMP Bugs
GIMP Bugs
: 161787 170283 172489 311073 311402 318269 321064 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-01-07 08:34 UTC by SeekerWang
Modified: 2008-01-15 12:44 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description SeekerWang 2005-01-07 08:34:50 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.
Comment 1 Sven Neumann 2005-01-07 11:02:52 UTC
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.
Comment 2 Michael Schumacher 2005-01-12 23:00:07 UTC
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
Comment 3 Sven Neumann 2005-01-13 13:21:09 UTC
What is Dr. MinGW trying to tell us here?
Comment 4 Kevin Cozens 2005-02-01 21:11:38 UTC
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.
Comment 5 Kevin Cozens 2005-02-01 23:29:05 UTC
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;
Comment 6 Kevin Cozens 2005-02-01 23:36:01 UTC
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.
Comment 7 Sven Neumann 2005-02-02 19:21:50 UTC
*** Bug 161787 has been marked as a duplicate of this bug. ***
Comment 8 Sven Neumann 2005-02-21 15:01:17 UTC
Why is this report set to NEEDINFO?
Comment 9 weskaggs 2005-02-21 19:14:10 UTC
It is set to NEEDINFO because you set it that way when you wrote comment #1 and
nobody ever unset it.
Comment 10 Sven Neumann 2005-03-14 14:06:27 UTC
*** Bug 170283 has been marked as a duplicate of this bug. ***
Comment 11 Sven Neumann 2005-03-14 14:09:28 UTC
Actually, this might be a duplicate of bug #165002, which got fixed in CVS a few
days ago.
Comment 12 Sven Neumann 2005-04-04 23:59:16 UTC
*** Bug 172489 has been marked as a duplicate of this bug. ***
Comment 13 Sven Neumann 2005-04-05 00:01:59 UTC
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...
Comment 14 Yuheng Xie 2005-04-05 10:04:43 UTC
Yes, the problem was fixed in win32 binary of version 2.2.4.
Comment 15 Simon 2005-04-05 11:50:54 UTC
The Problem still exists in 2.2.4 by installing and running it under Japanese
Windows XP SP2.
Comment 16 taiwanpig 2005-04-05 11:54:32 UTC
The Problem still exists in 2.2.4 by installing and running it under Traditional
Chinese Windows XP SP2.
Comment 17 Michael Schumacher 2005-04-05 11:59:26 UTC
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).
Comment 18 taiwanpig 2005-04-05 12:20:06 UTC
OK, it is no problem now. 
Comment 19 Simon 2005-04-05 12:40:00 UTC
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?
Comment 20 Michael Schumacher 2005-04-05 13:30:24 UTC
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.
Comment 21 Michael Schumacher 2005-04-20 17:06:59 UTC
The issue with the localized menus is solved now.
Comment 22 Sven Neumann 2005-04-20 21:34:35 UTC
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.
Comment 23 Michael Schumacher 2005-04-21 08:01:00 UTC
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?
Comment 24 Kevin Cozens 2005-04-21 17:53:34 UTC
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.
Comment 25 Anthony LEE 2005-05-16 19:47:05 UTC
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...
Comment 26 Michael Schumacher 2005-05-17 08:18:04 UTC
The DLL copying is a different problem, please don't mix it in here.
Comment 27 Michael C 2005-06-08 01:02:06 UTC
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?
Comment 28 Dove Young 2005-06-23 06:35:29 UTC
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

Comment 29 Sven Neumann 2005-07-21 14:36:10 UTC
*** Bug 311073 has been marked as a duplicate of this bug. ***
Comment 30 Yuya Saito 2005-07-26 12:56:03 UTC
*** Bug 311402 has been marked as a duplicate of this bug. ***
Comment 31 Kinomoto Sakura 2005-09-13 08:32:19 UTC
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
Comment 32 Wily Yuen 2005-09-16 10:35:56 UTC
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.
Comment 33 Francis Leung 2005-09-17 01:16:25 UTC
It is work on Windows XP and Traditional Chinese, Thanks.
Comment 34 Tor Lillqvist 2005-09-29 21:36:47 UTC
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.
Comment 35 Tor Lillqvist 2005-09-29 21:51:28 UTC
(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.)
Comment 36 Wily Yuen 2005-09-29 22:06:01 UTC
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.
Comment 37 Wily Yuen 2005-09-29 22:09:18 UTC
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.
Comment 38 Tor Lillqvist 2005-09-29 22:21:09 UTC
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?
Comment 39 Wily Yuen 2005-09-29 23:24:15 UTC
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.
Comment 40 Tor Lillqvist 2005-09-30 06:20:45 UTC
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.)
Comment 41 Wily Yuen 2005-09-30 08:42:34 UTC
> 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.
Comment 42 Michael Schumacher 2005-09-30 11:38:04 UTC
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.
Comment 43 Sven Neumann 2005-10-10 09:13:51 UTC
*** Bug 318269 has been marked as a duplicate of this bug. ***
Comment 44 hide-keiko 2005-10-11 00:02:10 UTC
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.
Comment 45 hide-keiko 2005-10-17 00:09:26 UTC
Was the problem solved?
Comment 46 Wily Yuen 2005-10-19 04:30:28 UTC
Has the QA looked at the fix mentioned in Comment #44?
Comment 47 Tor Lillqvist 2005-10-19 10:00:17 UTC
As soon as you renew your support contract subscription.
Comment 48 nahu5 2005-10-19 15:07:53 UTC
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...
Comment 49 nahu5 2005-10-19 15:09:52 UTC
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...
Comment 50 Wily Yuen 2005-10-19 20:05:12 UTC
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?
Comment 51 nahu5 2005-10-20 20:28:43 UTC
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..
Comment 52 hide-keiko 2005-11-03 09:54:48 UTC
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.

Comment 53 Wily Yuen 2005-11-06 15:50:07 UTC
This bug persists in the latest version of 
GIMP-2.2.9 and GTK+ 2.8.6 for Windows.
Comment 54 Michael Schumacher 2005-12-12 21:51:27 UTC
*** Bug 321064 has been marked as a duplicate of this bug. ***
Comment 55 Michael Schumacher 2005-12-12 23:10:08 UTC
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.