Hello Wine developers,
we try to use Wine in clustered environment with multiple Wine processes being started simultaneously on 8 to 80 Linux machines by a modified GNU make. The source code being built is located on an NFS mount visible by all cluster machines.
Unfortunately Wine fails after some time because of corrupted ~/.wine/system.reg. I guess multiple Wine processes try to update some keys in that file, like (differing) processor steppings etc. and this goes wrong at some point.
Also I've noticed, that the registry is being re-saved every 30 seconds (why?) - here in wine-0.9.32/server/registry.c:
static const int save_period = 30000; /* delay between periodic saves (in ms) */
I've tried adding file locking using fcntl() (which should work over NFS too) by modifiyng load_registry() and save_registry() as in the attached diff, but unfortunately it doesn't help.
Does anybody have a hint where to look?
Why updating registry is needed at all and can I disable it maybe? (And where would be the good spot to do that?)
Thank you Alex
Alexander.Farber@nokia.com writes:
I've tried adding file locking using fcntl() (which should work over NFS too) by modifiyng load_registry() and save_registry() as in the attached diff, but unfortunately it doesn't help.
For the standard registry files you'd have to do it in load_init_registry_from_file() and save_branch(). It still won't prevent one server from overwriting changes made by others of course.
Why updating registry is needed at all and can I disable it maybe? (And where would be the good spot to do that?)
If you make the WINEPREFIX directory and the registry files read-only that should prevent the server from updating them.
Hi Alexandre,
From: ext Alexandre Julliard [mailto:julliard@winehq.org]
For the standard registry files you'd have to do it in load_init_registry_from_file() and save_branch(). It still won't prevent one server from overwriting changes made by others of course.
thanks, you are correct: the load_registry() and save_registry() aren't called in my case at all - I was modifying wrong functions. Here I've added few fprintf's:
salsim04:afarber {528} wine perl -v load_init_registry_from_file(/disks/ouusers/afarber/.wine/system.reg, key) load_init_registry_from_file(/disks/ouusers/afarber/.wine/userdef.reg, key) load_init_registry_from_file(/disks/ouusers/afarber/.wine/user.reg, key) save_branch(key, /disks/ouusers/afarber/.wine/system.reg) save_branch, renaming /disks/ouusers/afarber/.wine/reg205b0000.tmp -> /disks/ouusers/afarber/.wine/system.reg save_branch(key, /disks/ouusers/afarber/.wine/userdef.reg) save_branch, renaming /disks/ouusers/afarber/.wine/reg205b0000.tmp -> /disks/ouusers/afarber/.wine/userdef.reg save_branch(key, /disks/ouusers/afarber/.wine/user.reg) save_branch, renaming /disks/ouusers/afarber/.wine/reg205b0000.tmp -> /disks/ouusers/afarber/.wine/user.reg
This is perl, v5.6.1 built for MSWin32-x86-multi-thread (with 1 registered patch, see perl -V for more detail)
Copyright 1987-2001, Larry Wall
Binary build 635 provided by ActiveState Corp. http://www.ActiveState.com Built 15:34:21 Feb 4 2003
Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on this system using `man perl' or `perldoc perl'. If you have access to the Internet, point your browser at http://www.perl.com/, the Perl Home Page.
salsim04:afarber {529} save_branch(key, /disks/ouusers/afarber/.wine/system.reg) save_branch, renaming /disks/ouusers/afarber/.wine/reg205b0000.tmp -> /disks/ouusers/afarber/.wine/system.reg save_branch(key, /disks/ouusers/afarber/.wine/userdef.reg) save_branch(key, /disks/ouusers/afarber/.wine/user.reg) save_branch, renaming /disks/ouusers/afarber/.wine/reg205b0000.tmp -> /disks/ouusers/afarber/.wine/user.reg
However now I'm really lost, because I don't understand where does the file corruption occur. In my case the ~/.wine/system.reg is a regular file stored in my NFS- mounted home dir. That is why a tmp file is used and later renamed. Shouldn't that operation be atomic and if not, how could I protect it (locking a dummy file?)
Regards Alex
PS: BTW I've noticed a bug - the variable "count" in the save_branch() is probably meant to be static. But it is not and that's why the tmp file's name (the "reg205b0000.tmp" above) never changes.