http://bugs.winehq.org/show_bug.cgi?id=10282
Summary: Issue between WINE, fuse and ntfs-3g Product: Wine Version: unspecified Platform: PC-x86-64 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: wine-opengl AssignedTo: wine-bugs@winehq.org ReportedBy: jestersi@gmail.com
Ok this is a doosey and complicated bug.
It seems in a recent mod to ntfs-3g opengl apps will bomb out causing a page fault at first I thought it was the kernel then the new lib32 packages on gentoo then I thought it was the new nvidia 32bit libGL libs, then I thought it was kernel switches... none of it made much sense because things like winecfg and built in apps ran fine.
reference abandoned bug for more indepth pain. http://bugs.winehq.org/show_bug.cgi?id=10255
I installed ubuntu and my problems went away so I thought it must have been a gentoo issue. How wrong I was. I added my custom ntfs-3g stuff to the fstab and boom on ubuntu I started having the problem, but when I let the OS mount the volume I didn't get a page fault anymore.
Here's what I found.
Environment libfuse2 2.7.0-1ubuntu5 libntfs-3g12 1:1.913-2ubuntu1 wine (pick your version I had it on every version from 0.9.36 -0.9.48 ) kernel 2.6.22 & 2.6.21 & 2.6.17 (those are the ones I've tested it on) CPU is x86_64 don't know if this affects 32bit CPU's.
# CAUSES PAGE FAULT (when running an opengl app) /dev/hda1 /mnt/ntfs1 ntfs-3g users,uid=1000,gid=1000 0 0 /dev/hda2 /mnt/ntfs2 ntfs-3g users,uid=1000,gid=1000 0 0
# CAUSES PAGE FAULT (when running an opengl app) #/dev/hda1 /mnt/ntfs1 ntfs-3g users,uid=1000,gid=1000,nosuid,nodev,locale=en_CA.UTF-8 0 0 #/dev/hda2 /mnt/ntfs2 ntfs-3g users,uid=1000,gid=1000,nosuid,nodev,locale=en_CA.UTF-8 0 0
#BELOW WORKS BUT CAN'T WRITE AS LOCAL USR #/dev/hda2 /mnt/ntfs2 ntfs-3g rw,nosuid,nodev,locale=en_CA.UTF-8 0 0 #/dev/hda1 /mnt/ntfs1 ntfs-3g rw,nosuid,nodev,locale=en_CA.UTF-8 0 0
#WORKS BUT EXTREMLY SLOW #/dev/hda1 /mnt/ntfs1 ntfs-3g rw,uid=1000,gid=1000,nosuid,nodev,locale=en_CA.UTF-8 0 0 #/dev/hda2 /mnt/ntfs2 ntfs-3g rw,uid=1000,gid=1000,nosuid,nodev,locale=en_CA.UTF-8 0 0
#WORKS AND FAST AND CAN WRITE #/dev/hda1 /mnt/ntfs1 ntfs-3g rw,uid=1000,gid=1000,nodev,locale=en_CA.UTF-8 0 0 #/dev/hda2 /mnt/ntfs2 ntfs-3g rw,uid=1000,gid=1000,nodev,locale=en_CA.UTF-8 0 0
So there you have it, I can duplicate this issue easily and can provide more information if requested. Bit sad that I blew away my gentoo distro but I never would have figured this out without ubuntu.
http://bugs.winehq.org/show_bug.cgi?id=10282
--- Comment #1 from Kai Blin blin@gmx.net 2007-11-03 03:13:00 --- Do you access the ntfs-3g paths at all? Do the crashes still happen if you e.g. remove the drive mapping for / ?
I'll look into installing this stuff on my boxes, trying to confirm the bug.
http://bugs.winehq.org/show_bug.cgi?id=10282
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID
--- Comment #2 from Vitaliy Margolen vitaliy@kievinfo.com 2007-11-03 14:00:33 --- What exactly are you running? You are aware that ntfs-3g driver DOES NOT provide 100% functionality some programs require?
Invalid. State the problem properly! DO NOT RUN APPS FROM NTFS PARTITIONS!
NOT WINE BUG.
http://bugs.winehq.org/show_bug.cgi?id=10282
x patch jestersi@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|INVALID |FIXED
--- Comment #3 from x patch jestersi@gmail.com 2007-11-04 03:28:42 --- I see alot of people having the same problem. google wine WoW page fault or any other major game that tends to reside in windows.
I'm not going to install an app twice and I will continue to run it from ntfs mounted partition it's a common practice for online apps such as WoW because you only download the patch's in windows. Saying I have to duplicate 11 gigs of data for a game is unreasonable when I've clearly posted a solution to the problem below. Please make people aware of this. I'd say on the Wineon64bit page if someone can verify this isn't an issue with 32bit processors.
As you can see below I didn't say it was a WINE bug, maybe you got that from complicated bug, it wasn't my intention. I said it was an "Issue between WINE, fuse and ntfs-3g". But seeing as I can use my ntfs partitions with every other linux program without error or corruption to the drive I thought this was the best place to post this problem.
You are aware that ntfs-3g driver DOES NOT provide 100% functionality some
programs require?
Yes perhaps file system applications, I'm talking about opengl/directx applications that don't want low level access.
Invalid. State the problem properly!
I stated the problem as accurately as I could. How to duplicate and how to solve it, what more would you like. All it takes is making people aware of possible problems with playing games off of ntfs-3g mounted drives and the flags they will have to put into their fstab.
http://bugs.winehq.org/show_bug.cgi?id=10282
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|FIXED |INVALID
--- Comment #4 from Vitaliy Margolen vitaliy@kievinfo.com 2007-11-04 09:45:20 --- Where what fixed? This is not Wine bug. It is invalid.
http://bugs.winehq.org/show_bug.cgi?id=10282
Szabolcs Szakacsits szaka@ntfs-3g.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |szaka@ntfs-3g.org
--- Comment #5 from Szabolcs Szakacsits szaka@ntfs-3g.org 2007-11-04 12:43:21 --- jestersi: very nice bug report and one of the most interesting ones I've seen for a while, especially if you can indeed reproduce the problems.
First of all, there isn't a single file system in the world which can provide 100% of the functionality what some programs expect. This is why file systems return EOPNOTSUPP and other errors to the applications what they can handle, act accordingly or report it to the user, e.g. "The used XXX file system doesn't support YYY operation, so this software can't do ZZZ". So, such problems definitely mustn't cause crashes, page faults if an application is well written.
What Vitaliy tried to explain you is that you should install Windows softwares under Wine to an NTFS partition to be able to run them under Wine because Wine doesn't support running them otherwise. This is completely file system independent. For instance if you install Windows software to an ext2 partition on Windows then Wine will not support that either.
About the crash. How do you exactly mount the partition? By root or by user? Using mount(8) or ntfs-3g? Is ntfs-3g setuid root? Do you have Wine logs where it crashes?
For me it seems, that depending on whether ntfs-3g is being running privileged or unprivileged the kernel CPU scheduler schedules processes/threads quite differently which triggers a multi-threading bug in Wine-opengl. This wouldn't be the first case when ntfs-3g triggers real problems in applications. Actually it happens relatively often.
Thank you for the bug report.
Regards, Szaka
-- NTFS-3G Lead Developer: http://ntfs-3g.org
http://bugs.winehq.org/show_bug.cgi?id=10282
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Vitaliy Margolen vitaliy@kievinfo.com 2007-11-04 12:58:22 ---
What Vitaliy tried to explain you is that you should install Windows softwares under Wine to an NTFS partition to be able to run them under Wine because Wine
Wrong. ntfs-3g driver does not support all types of mmap operations lots of programs use. One example would be Steam and all Source games. Not of of this functionality can be emulated by Wine.
So unless that is fixed in ntfs-3g drivers, you do NOT use NTFS with Wine. And that also makes it unsupported configuration.
Closing invalid bug. It is not Wine bug. It appears a user misconfiguration/ntfs driver deficiencies.
http://bugs.winehq.org/show_bug.cgi?id=10282
--- Comment #7 from Szabolcs Szakacsits szaka@ntfs-3g.org 2007-11-04 13:37:09 --- (In reply to comment #6)
ntfs-3g driver does not support all types of mmap operations lots of programs use.
The only not supported mmap operation is shared writable mmap what very few program uses.
Not of of this functionality can be emulated by Wine.
No need to emulate anything because when an application does such mmap system call then the driver returns ENODEV which can be easily handled. See mmap(2).
Please also realize that mmap(2) has absolutely nothing to do with this bug report.
Closing invalid bug. It is not Wine bug. It appears a user misconfiguration/ntfs driver deficiencies.
Then how would you explain that the same Wine code works in some cases but not in the other ones? The crash is very obviously a pure Wine bug ;-)
Regards, Szaka
-- NTFS-3G Lead Developer: http://ntfs-3g.org
http://bugs.winehq.org/show_bug.cgi?id=10282
--- Comment #8 from Alexandre Julliard julliard@winehq.org 2007-11-05 03:35:24 --- (In reply to comment #7)
No need to emulate anything because when an application does such mmap system call then the driver returns ENODEV which can be easily handled. See mmap(2).
It can't really be handled, all we can do is report the failure to the app, which in most cases will crash since the app doesn't expect it.
Please also realize that mmap(2) has absolutely nothing to do with this bug report.
Judging from the traces in bug 10255 the problem is a failure to map code as executable, so it looks to me like that it's quite likely related to mmap...
http://bugs.winehq.org/show_bug.cgi?id=10282
--- Comment #9 from Szabolcs Szakacsits szaka@ntfs-3g.org 2007-11-05 04:11:30 --- (In reply to comment #8)
This is exactly what I have meant. You should report this to the app instead of crashing.
which in most cases will crash since the app doesn't expect it.
That's a problem in the app.
Crash is not a nice way to terminate applications when it would be possible to handle such errors more elegantly and providing useful information to the user to fix his problem without any developer involvment.
The problem here is not "shared writable mmap" Vitaliy has meant but it looks like it's the "exec" mount option being dropped (correctly) for unprivileged ntfs-3g process. Adding it to the end of the mount options in fstab should make the app work. If not then the mount must be done by root or ntfs-3g must be setuid root.
So, this indeed seems to be a mount configuration problem and sometimes mmapping files for execution is denied. 'exec' is not a missing functionality but it's denied due to security reasons in certain mount scenarios.
Nevertheless wine shouldn't crash if it's possible but report such errors to the user, so they would have a chance to fix the issue themself.
Of course if the app crashes then you really don't have anything to do, besides not misleading users why it's not a Wine fault ;-)
Regards, Szaka
http://bugs.winehq.org/show_bug.cgi?id=10282
--- Comment #10 from Alexandre Julliard julliard@winehq.org 2007-11-05 04:46:33 --- (In reply to comment #9)
This is *exactly* what we do.
which in most cases will crash since the app doesn't expect it.
That's a problem in the app.
Sure, but we can't fix the app.
I think you greatly underestimate the difficulty of the problem. How can we determine that an app crash is due to the lack of writable mmap and not to another of a gazillion possible causes?
Here too, there are about a gazillion different scenarios that can lead to a no-exec page fault. We do have a number of workarounds for it, but depending on the system configuration they can't always help.
http://bugs.winehq.org/show_bug.cgi?id=10282
--- Comment #11 from x patch jestersi@gmail.com 2007-11-05 18:50:01 ---
I usualy let the auto mounter mount the two ntfs partitions I have. I mount the partitions as root because only root is allowed to mount by default in both gentoo and ubuntu ( as far as I know ).
If I mount with the line below then attempt to run say never winter nights 1. I get the Launcher app that allows me to click Play, Configure etc... As soon as I click on Play I get a page fault from wine, I will upload the dump file.
/dev/hda2 /mnt/ntfs2 ntfs-3g users,uid=1000,gid=1000 0 0
If I mount with /dev/hda2 /mnt/ntfs2 ntfs-3g rw,uid=1000,gid=1000,nodev,locale=en_CA.UTF-8 0 0
everything is fine and dandy and NWN plays great, same with WoW etc..
Is ntfs-3g setuid root?
I'm unsure how I would check this.
One more note, I develop cross platform opengl/sdl applications the application I'm currently developing does not seem to care which of the mount params I use.
I believe a middle ground solution would be to write a script to check the sanity of the environment. such as wine-sanity WoW.exe -opengl find the path that your in check the fstab and check the parameters to see if there will be potential problems. My knowledge does not extend to mmap and it's intricacies so unfortunately I don't understand this problem.
http://bugs.winehq.org/show_bug.cgi?id=10282
--- Comment #12 from x patch jestersi@gmail.com 2007-11-05 18:51:50 --- Created an attachment (id=8979) --> (http://bugs.winehq.org/attachment.cgi?id=8979) attempted to play NWN with bad mount parameters
http://bugs.winehq.org/show_bug.cgi?id=10282
x patch jestersi@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #8979|application/octet-stream |text/plain mime type| |
http://bugs.winehq.org/show_bug.cgi?id=10282
--- Comment #13 from Szabolcs Szakacsits szaka@ntfs-3g.org 2007-11-06 06:55:44 --- jestersi: I already explained what's your problem at http://bugs.winehq.org/show_bug.cgi?id=10282#c9
If you use the 'users' mount option then mount(2) will be done with the 'noexec' mount option (you can confirm this by checking out the ntfs-3g log messages under /var/log) and you will not be able to mmap programs for execution.
Solution: add the 'exec' option to the __END__ of the mount options. Like:
/dev/hda2 /mnt/ntfs2 ntfs-3g users,uid=1000,gid=1000,exec 0 0
Then Wine will work fine like in the other cases.