GNOME Bugzilla – Bug 170948
gtk initializes gettext too late
Last modified: 2011-02-04 16:18:28 UTC
Version details: Gtk+ v2.6.4 Distribution/Version: XP SP2 PC: HP a705w Intel Celeron 2.9GHz i845G chipset 768MB Mem 200GB HD Combo-card reader Win XPSP2 I was running Norton Antivirus 2004 and was not getting any errors at all with The Gimp 2.2.3, Gtk+2.4.14. I uninstalled NAV and installed AVG 7.0.308. After this was done with reboots, I began getting the "There is not disk in the drive. Please insert disk in \Device\Harddisk2\DR5" message. I saw in the FAQ for Windows that this can happen due to the card reader, but things will still work correctly. Since there was an update for both Gtk+ 2.6.4 and The Gimp 2.2.4, I downloaded them and installed over the previous versions. I began getting this error much more frequently than just at Gimp startup, like every window opening. I uninstalled The Gimp 2.2.4 and installed the previous version 2.2.3. I still received 3-4 times the number of messages than with the previous version of Gtk+ 2.4.14. I uninstalled Gtk+ 2.6.4 and The Gimp, rebooted and installed the previous versions Gtk+ 2.4.14 and The Gimp 2.2.3. Now I'm back to just getting the messages at startup. I hope this info helps in eliminating this very annoying bug.
Many variants of this have been reported, for many different programs, and it's pretty clear that it is a Windows issue rather than a GIMP issue, but if it's okay with you, maybe we can try to pin down exactly what is going on. The first thing I would like from you, if you can, is to insert or attach a copy of your AUTOEXEC.BAT file (should be found in the root directory of your C: drive). Also a question: at times when you get the error message, do you see an icon in your taskbar whose tooltip says "Safely remove hardware"? And one more question: Have you ever used GIMP to directly open files from things inserted in the card-reader?
Created attachment 39031 [details] Here's the Autoexec.bat you ask for. Currently on Gimp 2.2.3 Gtk+ 2.4.14 (could I use Gimp 2.2.4 with Gtk+2.4.14?) Questions: 1. At times when you get the error message, do you see an icon in your taskbar whose tooltip says "Safely remove hardware"? No. I start up Gimp from the Start Menu, I get the splash screen with several things loading at the bottom. When it gets to AlienMap2.exe plugin I get the 1st and 2nd messages, the second right after I cancel the first. Then it continues with extension_script_fu and comes up fine. 2. Have you ever used GIMP to directly open files from things inserted in the card-reader? No. I have used it with a USB flash drive, which is in the same unit on the computer, but not the CF SD SM MS slots in the same device (USB by the way) I hope this is helpful. If I can provide more info, just let me know! Thanks!
Thanks. Now something to try, and a question that you probably can't answer. First, the thing to try is to go into your personal GIMP folder (probably called .gimp-2.2), and delete the file called "documents". Then see if the problem still occurs the next time you run GIMP. (It may be worth looking at the file in Notepad first, to see whether it contains any file names located on your USB drive.) Second, the question: is it possible that either when you used GIMP with the USB flash drive, or the last time you used the USB flash drive, or at the time you installed GIMP, you had unplugged it without doing "Safely remove hardware"? I'm just fishing here, the question arises from things I've found googling.
I also receive the same message when I use the "Save As", and yes still twice like at startup.
I renamed the file in order to retain in case it is needed. Thre were references in it to the USB thumbdrive. Gimp recreated a new one, but I still received the error on startup, still twice same spot as before. Most of my editing is on C:\, with only the odd once or twice from the USB thumbdrive. Interesting question. I can say I have never used that. I just tried the thumbdrive and that option doesn't come up at all for it even when I open a photo change it and save as back to the thumbdrive. I just get a sound indicating the thumbdrive has been connected and again when I remove it from the USB port. This makes me wonder if it had ever show this. This question I can't answer. I deleted the documents file after the test this time.
Aha! Before you remove a USB storage device from your system, you are supposed to click on a little icon on the lower right part of your taskbar, whose tooltip says (I got it wrong before) "Unplug or Eject hardware", or something very similar. If you remove the device without doing this, it is possible for the files on it to be incompletely saved. Do you have such an icon present now on your taskbar? If so, try clicking it. If not, try plugging in your USB thumbdrive and then removing it correctly. Let's see if that makes any difference. (Note: I'm playing with Windows 2000 here, but I'm pretty sure XP is the same in this respect.)
The default behaviour for USB sticks on WinXP is to have the write cache disabled. So unless you remove it while the writing is still happening - during which a progress dialog is displayed in most cases - there is no problem.
Nuts.
Created attachment 39040 [details] USB Properties dialog Nope. No icon. I did find out why. There is an option to "Optimize for quick removal" in the Policies for the USB thumbdrive when it is inserted (see image). This is enabled for my PC. This policy setting is also enabled on all of the removable drives which represent the CF SD SM MS slots in the internal USB card reader. The internal is the only one I have. I don't know if I mentioned this before, but I get the messages even when I just start it without a file to open. I also get it when I use the "Edit with The Gimp" context menu item on a photo on C:. This is without the thumbdrive being connected.
Filemon might give an indication whether there is really an attempted file access on any of the cards: http://www.sysinternals.com/ntw2k/source/filemon.shtml
Nice piece of software! It showed a lot of things, but it wouldn't let me add the reader volumes to its list. I get the same error as I do when starting The Gimp. Also, from the GUG General Forum: http://gug.sunsite.dk/forum/?threadid=2713 "indeed it seems that the problem is actually gtk. i haven't yet had a chance to use gimp to see if the problem still forces crashing, but i have been playing around with gaim. gaim also requires gtk and, incidentially, i get the same error message when loading it up." -- wxl 20-Mar-2005 Now, I did a little pokin' around with the Windows Device Manager. I disabled all of the USB card reader drives, and I received no messages on Gimp startup. I enabled each one with no messages from Gimp until I enabled the CF reader. With the CF reader enabled I received both messages as before. I did not receive the messages from the MS SM or SD card drives when they were re-enabled. Since they are USB, no reboot was needed to do this. I have additional info, but I need to attach a file. I'm afraid I may loose all this if I attempt it now. If I'm being dumb, sorry for the extra email/entry.
Created attachment 39084 [details] WinXP Event Viewer - System entry for error message. Here's what the HP Support entry was for the message link in the image, in sending the data it made reference to ntdll.dll, but may be just program that logged the error. --- Details Product: Windows Operating System ID: 26 Source: Application Popup Version: 5.2 Symbolic Name: STATUS_LOG_HARD_ERROR Message: Application popup: %1 : %2 Explanation The program could not load a driver because the program user doesn't have sufficient privileges to access the driver or because the drive is missing or corrupt. User Action To correct this problem: Ensure that the program user has sufficient privileges to access the directory in which the driver is installed. Reinstall the program to restore the driver to the correct location. If these solutions do not work, contact Product Support Services. Version: 5.0 Symbolic Name: status_log_hard_error Message: Unable to Load Device Driver : device driver could not be loaded. Explanation The program could not load a driver because the program user doesn't have sufficient privileges to access the driver or because the drive is missing or corrupt. User Action To correct this problem: Reinstall the program to restore the driver to the correct location.
Um, so it seems that there is either a problem with the CF reader or, more likely as it seems to happen on multiple systems, the Windows driver for this reader. Thus, the recipients of this bug report should be Microsoft and/or the reader vendor, since they have probably better ways of contacting MS.
You didn't mention the vendor of the 6 in 1 device, but it would be interesting to try downloading and installing their latest driver software, if anything is available for XP.
Driver is generic USB CF Reader driver from Microsoft v5.1.2535.0 dated 7/1/2001. I looked around in MS Knowledgebase after I discovered it was the CF reader and MS driver. No luck yet. That explains why Filemon game me the same error. Thank you all for you help. I hope my detective work can help someone else who has this problem. As for the vendor, I haven't a clue for the USB card reader, but the PC is an HP Pavilion a705w with i845G chipset Celeron 2.9GHz etc.
This has been the most helpful and informative analysis of this problem up to now. AFAIK GTK+ enumerates the drives that are connected to a system in order to show them in the file chooser. I don't know when exactly this happens, but it seems to happen during the initialisation (asynchronous?), because there were some many different reports about this happening when certains plug-ins were queried (which I consider coincidence now). Incidentally, a search for "compact flash driver" in MSDN brings up a lot of test tools for file system and partition drivers... maybe Microsoft knows why they are doing this :)
*** Bug 171763 has been marked as a duplicate of this bug. ***
*** Bug 171780 has been marked as a duplicate of this bug. ***
For completeness, here is the info on the 9 in 1 card reader: On Label: HP P/N: 5069-6732 Rev B-A26 NMD20001017 On board: Northstar Systems HP ID 2004 Rev A5 RU S94V0 E170968 WZ-5 ND20727B On Chip: Alcor Micro unfortunately I couldn't read the AU number and didn't realize I needed it. Ok I downloaded new drivers from Northstar for the AU9360, but they are for Win95 & Win98se. Have not installed since not XP drivers. This was the only driver I could find they had available for download. Thanks again.
Why is this bug in status NEEDINFO? Is there a particular information that we are waiting for?
Rassigning to GTK+ would probably be the right thing to do. The GUG thread http://gug.sunsite.dk/forum/?threadid=2713 suggests that this doesn't seem to happen with whatever version of GTK+ the gladewin32 project is distributing. I guess there is an implementation or design problem in the way Windows interacts with CF readers - this problem was easily reproducable with Filemon - and maybe there is a way to prevent it. IIRC an access attempt to the floppy drive was removed from GTK+, might be possible to do something similiar here. However, even a WONTFIX from a GTK+ developer might help, then we would know for sure that this behaviour is expected.
OK, let's reassign it to GTK+ then.
What I would need to know before looking any deeper into this is how to force this misbehaviour. To me it looks like something is screwed in the systems setup, i.e. there is a dangling device link somewhere. If even FileMon complains about this how can it be a gtk error? But if there is a standard windows message box howing a call to SetErrorMode(SEM_FAILCRITICALERRORS) or SetErrorMode(SEM_NOOPENFILEERRORBOX) or even SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX) should resolve this. I'm still uncertain if such a call does belong in a supporitng libary (instead of the application).
*** Bug 172775 has been marked as a duplicate of this bug. ***
It would be a good default to suppress the errors and have methods to enable them only if an app needs them. We want our users to use our programs without having to debug cryptic error dialogs. Having it in GTK+ would prevent this from appearing in other GTK+ apps as well (there are reports that GAIM is also hit by this), making all apps include platform-specific code doesn't seem to be a good idea - glib and gtk+ already have parts of platform-specific code if I'm not mistaken.
I'm going to throw in some comments. I just dug up this bug after opening bug 301261, which is effectively a duplicate. Somewhere in GTK, we're calling something that's poking all the disk drives at init time to read from them (maybe it's making sure they're there, but if so this is clearly not the proper means). This problem doesn't happen for a card reader with no assigned drive letter, or a reader with media in it, in my experience. In my humble opinion, there should be no attempt to read from a drive that is not mounted, least of all every drive on the system at GTK init (and other times). This is something GTK is /doing/, because it happens with every GTK application, including the gtk-test program, and thus it is not something the application should need to prevent or ignore. GTK needs to stop doing it, or if it _needs_ to do it, another means must be found which doesn't try to read from media that isn't there.
Kevin Stange and I conducted some testing last night and this appears to be happening somewhere in gettext (strangely enough). The popup occurs during the gtk_init_check() function, specifically in the gtk_get_option_group() function on the following line: group = g_option_group_new ("gtk", _("GTK+ Options"), _("Show GTK+ Options"), info, g_free); This appears to be the first gettext call during gtk initialization. If I remove the _() around the strings, the error message doesn't appear at all. I expected the error popup to be delayed to the next gettext call (which occurs in do_post_parse_initialization() if not sooner), but it apparently doesn't appear at all. It would seem that there is some sort of initialization that need to be done before the gettext calls - I have no idea what. A glance at the gettext code wasn't at all fruitful (It isn't exactly nicely organized). Anyone have any ideas? Also, perhaps the status of this bug report should be changed from NEEDINFO to something more easily findable.
AFAIK bindtextdomain is the function that initializes gettext, and it is called in do_post_parse_initialization (==too late?). This is a rough guess, but intl.dll from http://www.gimp.org/~tml/gimp/win32/gettext-runtime-0.13.1.zip contains the string i:\target\share\locale, so maybe it tries to look in that directory for translations if bindtextdomain hasn't been called? Disclaimer: I have never even looked at the gettext source so I may be wrong.
*** Bug 301261 has been marked as a duplicate of this bug. ***
I'm going to say the I: issue is definitely a major part of it. I found that changing my card reader from being Drive I: to Drive J: has eliminated the error, which means that it is likely getttext trying to poke at that path when it's not be bound yet. It's probably something we need to fix in our gettext build to pick a better default location for the default locale path, but we also should fix it in GTK and components such that we're actually binding the domain before we need it.
Robert, thanks for noticing that path. This should all be clear now. The intl.dll tries to access the configure-time location for its own message catalogs. That's a bit odd, as I definitely remember that gettext-runtime would contain code to look up its installation location at run-time and not use the configure-time installation. Anyway, I'll fetch the current gettext sources and build a new distribution. (Or maybe the gnuwin32 people have one that is good enough, will have to investigate.)
Created attachment 45526 [details] [review] Initialize gettext bindings earlier Robert was exactly right :). In addition to fixing the intl.dll, it seems gtkmain.c should probably be fixed to bind the gettext domain prior to using it (the translation will fail). The following simple change prevents the error popup from happening. This still happens somewhere in ATK, but I haven't had a chance to track that one down yet.
Too bad that gnuwin32's gettext 0.14.1 provides a DLL called libintl3.dll, and not intl.dll which is the name decided by the gettext maintainer (in his makefiles for MSVC). One wonders whether their libintl3.dll is still binary compatible with an intl.dll built with MSVC? The gnuwin32 project has renamed DLLs arbitrarily in the past and treated binary compatibility issues rather lightly. If the libintl3.dll is binary compatible with intl.dll, one could just use gnuwin32's gettext 0.14.1 and rename its libintl3.dll to intl.dll. Otherwise, one has to rebuild and redeploy all the packages that currently depend on intl.dll (GLib, GTK+, Pango, GIMP, etc, plus all the stuff I'm working on as part of the Evolution porting efforts). Actually, what would be really nice would be a gettext that would take UTF-8 filenames in the bindtextdomain() (presumably provide a separate function call for that on Win32), to fit better with the UTF-8-oriented current GLib/GTK+ world. Maybe I should build such a beast and distribute it myself?
Created attachment 45532 [details] [review] Update to atk to prevent premature gettext usage. After digging a bit into the ATK code, it is pretty obvious why this is also happening there. The gettext domain doesn't get bound until the first time that atk_role_get_localized_name() is called. There are, however, translated strings in atk_object_class_init(). From what i can tell, there is no guaranteed order for these to be called, and since there doesn't appear to be any overall atk initialization function, I abstracted the gettext init into a function called before both possible uses. If this needs to be posted separately as a bug to atk, please let me know.
Daniel, regarding your patch to gtkmain.c, should the gettext initialization be done also in gtk_init_with_args() and not only gtk_parse_args()? Or in even more places? Anyway, much thanks to Robert and Daniel! I guess we should ponder what lessons can be learned from this bug... I am changing the component to "general" as this bug really isn't Win32 specific, although it has disturbing consequences only on Win32. Also changing summary.
Fixed in GTK+ HEAD and gtk-2-6: 2005-04-22 Tor Lillqvist <tml@novell.com> * gtk/gtkmain.c: Initailize gettext before use. Calling bindtextdomain() and bind_textdomain_codeset() in do_post_parse_initialization() is too late. Put the calls in a new function gettext_initialization(), and call that from gtk_init_with_args() and gtk_parse_args(). Fixes #170948 for GTK+'s part, but the same problem occurs also at least in atk. Thanks to Robert Ögren, Daniel Atallah and Kevin Strange. Also in atk HEAD: 2005-04-22 Tor Lillqvist <tml@novell.com> * atk/atkobject.c: Initialize gettext before use. Calling bindtextdomain() and bind_textdomain_codeset() in atk_role_get_localized_name() was too late. Put the calls in new function gettext_initialization() and call that from atk_object_class_init() and atk_role_get_localized_name(). Move the Win32-specific DllMain() and get_atk_locale_dir() functions and theredefinition of ATK_LOCALEDIR before gettext_initialization() as it uses ATK_LOCALEDIR. Fixes #170948 for atk's part. Thanks to Robert Ögren, Daniel Atallah and Kevin Strange. Does this problem occur in Pango?
Ack. Tor, you did it! Everyone does though. No R in my last name. :)
Oops. I have fixed the ChangeLogs.
I'm seeing the error in one more place. If I open gtk-demo.exe and double-click "application main window" I get the error twice even with the fixes in ATK and GTK. Definitely trying to access I:\ though I'm really not sure why yet.
*** Bug 301715 has been marked as a duplicate of this bug. ***
*** Bug 302643 has been marked as a duplicate of this bug. ***
*** Bug 303322 has been marked as a duplicate of this bug. ***
I don't have the time to read everything above, but I am having this problem. Could someone who has a better idea of what all of the above says tell me: A. Has the problem been fixed B. If it has, how do you stop those stupid messages? Thanks.
Fixed on 2005-04-22 if I understood comment #36 correctly. The latest release (2.6.7) was on 2005-04-13, so you have to wait for 2.6.8 or build GTK+ yourself.
Anything left here, Tor ?
Hmm, don't think so. Or maybe that comment #39 could need some investigation.
Daniel and I gave it some investigation, but we didn't find anything quite yet. I haven't been able to reproduce it in any other applications, nor figure out what library it might be dipping into so late. We haven't had the chance to get back to it recently.
There is nothing further that needs to be done for the error appearing in comment #39. That particular error is caused because demos\gtk-demo\appwindow.c:285 uses a stock item, but doesn't specify a translation domain. The only thing that *could* be done to avoid this type of occurrance is perhaps in gtk\gtkstock.c:158 to not call dgettext() when item->translation_domain is NULL. This isn't a very good idea though as it'll bypass the default domain.
OK, thanks for investigating. Resolving then.
*** Bug 306175 has been marked as a duplicate of this bug. ***
*** Bug 308597 has been marked as a duplicate of this bug. ***
Still have similiar problem with new release GTK+ 2.6.8 / The GIMP 2.2.8. At GIMP start - 2 errors, GIMP Open a file - 2 errors, GIMP Save a file - 2 errors. I haven't used any of the filters yet to see if the errors still occur there.
A new ATK release hasn't been made yet, so at least one of the errors is from there.
*** Bug 314522 has been marked as a duplicate of this bug. ***
just to throw in my $.02, this doesn't just happen with card readers. it gives me the error for "f:\" which is a DVD-RW drive. it keeps happening every time I type a response to a chat buddy. if i put a disc in the drive, the error stops. i'm using gaim 1.5 and GTK 2.6.9 rev a
This bug specifically refers to the problems at initialization of the the application, which are the gettext errors. Gaim can cause this error when it tries to access a path on a removable drive that has no media. If it's happening every time you type a response to a chat buddy, Gaim may well be attempting to read or write a file on f:, though I can't guess why offhand.
*** Bug 316935 has been marked as a duplicate of this bug. ***
*** Bug 314334 has been marked as a duplicate of this bug. ***
*** Bug 345684 has been marked as a duplicate of this bug. ***
*** Bug 148678 has been marked as a duplicate of this bug. ***
I recently installed GIMP 2.2.17 and I've been getting the following "Windows - No Disk" error message: Exception Processing Message c0000013 Parameters 75b6bf9c 4 75b6bf9c 75b6bf9c which is the same error message number (c0000013) I received in a program I wrote. My program looks through all the disk devices on a system and produced this error message anytime it attempted to read from my USB card reader. I also received a similar error message in Gaim which is why I now use Google Talk. I finally solved this problem in my program by the following means: SetErrorMode(SEM_FAILCRITICALERRORS) Code to scan through the drives SetErrorMode(Null) which eliminated the display of the error message. I hope this helps eliminate this frustrating bug. Best Regards, Magus.
(In reply to comment #61) > I recently installed GIMP 2.2.17 and I've been getting the following "Windows - > No Disk" error message: > > Exception Processing Message c0000013 Parameters 75b6bf9c 4 75b6bf9c 75b6bf9c Which version of GTK+ are you using? Presumably you're using something quite old as I haven't heard any reports of this in recent GTK+ versions.
Hi, I'm using GTK+ 2.10.13 on Windows XP SP2 fully updated. Best Regards, Magus.