gdi32-related commit between 0.9.57<->0.9.58 broken .NET2/Systems.Windows.Forms
I found a .NET2/System.Windows.Forms application which was running alright in 0.9.56/0.9.57 with the appdb adaptations broke in 0.9.58. So I did a git bisect and found that it is a commit to gdi32/freetype.c from Huw Davies which broke it. It is known that .NET does some strange things with fonts and font-related part of the registry (See http://bugs.winehq.org/show_bug.cgi?id=10467#c2 for discussion) and the commit apparently breaks that... I believe I see what that specific commit does and how it breaks .NET2, but I am not sure I understand *why* the commit was accepted in the first place and what was its purpose... Can somebody explain, and possibly either back-out the commit or at least modify it to make it not break stuff? commit 0436a5d14abf22af6ec10640496f9e0298a65f69 Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Mar 10 12:31:43 2008 +0000 gdi32: Store the Windows path (if it's available) in the font registry entries. The error message I got was 'attempt to read or write protected memory. This is often an indication that other memory is corrupt'. __________________________________________________________ Sent from Yahoo! Mail. More Ways to Keep in Touch. http://uk.docs.yahoo.com/nowyoucan.html
On Wed, Mar 26, 2008 at 02:05:25PM +0000, Hin-Tak Leung wrote:
I found a .NET2/System.Windows.Forms application which was running alright in 0.9.56/0.9.57 with the appdb adaptations broke in 0.9.58. So I did a git bisect and found that it is a commit to gdi32/freetype.c from Huw Davies which broke it. It is known that .NET does some strange things with fonts and font-related part of the registry (See http://bugs.winehq.org/show_bug.cgi?id=10467#c2 for discussion) and the commit apparently breaks that... I believe I see what that specific commit does and how it breaks .NET2, but I am not sure I understand *why* the commit was accepted in the first place and what was its purpose... Can somebody explain, and possibly either back-out the commit or at least modify it to make it not break stuff?
commit 0436a5d14abf22af6ec10640496f9e0298a65f69 Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Mar 10 12:31:43 2008 +0000
gdi32: Store the Windows path (if it's available) in the font registry entries.
The error message I got was 'attempt to read or write protected memory. This is often an indication that other memory is corrupt'.
Hi, Could you explain how this breaks .NET2, I can't see why it should at the moment? The purpose of the commit is to do what Windows does. Thanks, Huw. -- Huw Davies huw(a)codeweavers.com
--- On Wed, 26/3/08, Huw Davies <huw(a)codeweavers.com> wrote: <snipped>
The error message I got was 'attempt to read or write protected memory. This is often an indication that other memory is corrupt'.
Hi,
Could you explain how this breaks .NET2, I can't see why it should at the moment? The purpose of the commit is to do what Windows does.
I am not entirely sure myself - all I know is I did a git bisect to find what was the problematic commit, and reverting this particular commit on top of 0.9.58 fixes my problem. My understanding is that the .NET framework uses the windows registry font entries for font look-ups, according to the discussion in http://bugs.winehq.org/show_bug.cgi?id=10467#c2, and it loads fonts directly based on the registry font list and does its own rendering thing with the font files directly; So changing font registry entries break things. ___________________________________________________________ Rise to the challenge for Sport Relief with Yahoo! For Good http://uk.promotions.yahoo.com/forgood/
On Wed, Mar 26, 2008 at 02:55:07PM +0000, Hin-Tak Leung wrote:
--- On Wed, 26/3/08, Huw Davies <huw(a)codeweavers.com> wrote: <snipped>
The error message I got was 'attempt to read or write protected memory. This is often an indication that other memory is corrupt'.
Hi,
Could you explain how this breaks .NET2, I can't see why it should at the moment? The purpose of the commit is to do what Windows does.
I am not entirely sure myself - all I know is I did a git bisect to find what was the problematic commit, and reverting this particular commit on top of 0.9.58 fixes my problem.
My understanding is that the .NET framework uses the windows registry font entries for font look-ups, according to the discussion in http://bugs.winehq.org/show_bug.cgi?id=10467#c2, and it loads fonts directly based on the registry font list and does its own rendering thing with the font files directly; So changing font registry entries break things.
Well yes, but that doesn't actually mean the patch is incorrect. Do you by any chance have the font 'ukai.ttf' installed? If so could you try removing it from your fontconfig path and see if that helps? Huw. -- Huw Davies huw(a)codeweavers.com
--- On Wed, 26/3/08, Huw Davies <huw(a)codeweavers.com> wrote:
From: Huw Davies <huw(a)codeweavers.com> Subject: Re: gdi32-related commit between 0.9.57<->0.9.58 broken .NET2/Systems.Windows.Forms To: "Hin-Tak Leung" <htl10(a)users.sourceforge.net> Cc: wine-devel(a)winehq.org Date: Wednesday, 26 March, 2008, 3:21 PM On Wed, Mar 26, 2008 at 02:55:07PM +0000, Hin-Tak Leung wrote:
--- On Wed, 26/3/08, Huw Davies <huw(a)codeweavers.com> wrote: <snipped>
The error message I got was 'attempt to read or write protected memory. This is often an indication that other memory is corrupt'.
Hi,
Could you explain how this breaks .NET2, I can't see why it should at the moment? The purpose of the commit is to do what Windows does.
I am not entirely sure myself - all I know is I did a git bisect to find what was the problematic commit, and reverting this particular commit on top of 0.9.58 fixes my problem.
My understanding is that the .NET framework uses the windows registry font entries for font look-ups, according to the discussion in http://bugs.winehq.org/show_bug.cgi?id=10467#c2, and it loads fonts directly based on the registry font list and does its own rendering thing with the font files directly; So changing font registry entries break things.
Well yes, but that doesn't actually mean the patch is incorrect.
Well, it is certainly doing something that the .NET framework doesn't like - or, maybe exposing a bug elsewhere which wasn't reached due to incompleteness before. Can you explain the purpose of your patch?
Do you by any chance have the font 'ukai.ttf' installed? If so could you try removing it from your fontconfig path and see if that helps?
Yes, I have ukai.ttf on my system (and others came with Fedora 8), but I am running wine in LANG=en_US.UTF-8 . I'll give your suggestion a try. __________________________________________________________ Sent from Yahoo! Mail. More Ways to Keep in Touch. http://uk.docs.yahoo.com/nowyoucan.html
On Wed, Mar 26, 2008 at 03:33:27PM +0000, Hin-Tak Leung wrote:
--- On Wed, 26/3/08, Huw Davies <huw(a)codeweavers.com> wrote:
Well yes, but that doesn't actually mean the patch is incorrect.
Well, it is certainly doing something that the .NET framework doesn't like - or, maybe exposing a bug elsewhere which wasn't reached due to incompleteness before. Can you explain the purpose of your patch?
I think it's a bug in *native* gdiplus. If you install ukai.ttf on Windows then apps that use gdiplus will crash too.
Do you by any chance have the font 'ukai.ttf' installed? If so could you try removing it from your fontconfig path and see if that helps?
Yes, I have ukai.ttf on my system (and others came with Fedora 8), but I am running wine in LANG=en_US.UTF-8 . I'll give your suggestion a try.
Actually I've just attached a hack to the bug, try that instead. Thanks, Huw. -- Huw Davies huw(a)codeweavers.com
--- On Wed, 26/3/08, Huw Davies <huw(a)codeweavers.com> wrote: <snipped>
I think it's a bug in *native* gdiplus. If you install ukai.ttf on Windows then apps that use gdiplus will crash too.
oh. I suppose it is fair enough that installing any fonts on windows can have bad effects. But, OTOH, should one expose the whole of fontconfig-available fonts to wine? A lot of them may be dubious to various extent. If ukai is affected, I would suspect uming (also from Arphic) would be the same? and how many non-english fonts one want to "work-around" like this?
Do you by any chance have the font 'ukai.ttf' installed? If so could you try removing it from your fontconfig path and see if that helps?
Yes, I have ukai.ttf on my system (and others came with Fedora 8), but I am running wine in LANG=en_US.UTF-8 . I'll give your suggestion a try.
Actually I've just attached a hack to the bug, try that instead.
Thanks - but I also have uming, and a a fair number of other fonts shipped from fedora for non-english. (over 100). __________________________________________________________ Sent from Yahoo! Mail. More Ways to Keep in Touch. http://uk.docs.yahoo.com/nowyoucan.html
On Wed, Mar 26, 2008 at 04:38:26PM +0000, Hin-Tak Leung wrote:
--- On Wed, 26/3/08, Huw Davies <huw(a)codeweavers.com> wrote: But, OTOH, should one expose the whole of fontconfig-available fonts to wine? A lot of them may be dubious to various extent.
Well we already did that anyway. It was just the native gdiplus apps didn't see them because of a bug that this commit fixed.
If ukai is affected, I would suspect uming (also from Arphic) would be the same? and how many non-english fonts one want to "work-around" like this?
I've not seen any problems with uming. Most 'non-english' fonts will work fine. There's something very specific about ukai that causes native gdiplis to have problems.
Actually I've just attached a hack to the bug, try that instead.
Thanks - but I also have uming, and a a fair number of other fonts shipped from fedora for non-english. (over 100).
Please try the patch and report back. Huw. -- Huw Davies huw(a)codeweavers.com
--- On Wed, 26/3/08, Huw Davies <huw(a)codeweavers.com> wrote: <snipped>
If ukai is affected, I would suspect uming (also from Arphic) would be the same? and how many non-english fonts one want to "work-around" like this?
I've not seen any problems with uming. Most 'non-english' fonts will work fine. There's something very specific about ukai that causes native gdiplis to have problems.
Actually I've just attached a hack to the bug, try that instead.
Thanks - but I also have uming, and a a fair number of other fonts shipped from fedora for non-english. (over 100).
Please try the patch and report back.
Yes, your patch works alright - it is just ukai and nothing else. I'll put it on the bug report as well. Ukai (or rather, the original Arphic kai font) was the first commercial quality chinese font released under an open license, so you are going to have a lot of people - 20% of the world is Chinese, and also linux is rather more officially popular in China due to licensing/cost/idealological reasons and some non-chinese will install "everything" - being affected by this. I don't know if it is ukai-specific or any Arphic kai derivatives, but if it affects any Arphic kai derivatives, filtering by font name as your patch did won't be effective. __________________________________________________________ Sent from Yahoo! Mail. More Ways to Keep in Touch. http://uk.docs.yahoo.com/nowyoucan.html
Hin-Tak Leung wrote:
--- On Wed, 26/3/08, Huw Davies <huw(a)codeweavers.com> wrote: <snipped>
If ukai is affected, I would suspect uming (also from Arphic) would be the same? and how many non-english fonts one want to "work-around" like this? I've not seen any problems with uming. Most 'non-english' fonts will work fine. There's something very specific about ukai that causes native gdiplis to have problems.
Actually I've just attached a hack to the bug, try that instead. Thanks - but I also have uming, and a a fair number of other fonts shipped from fedora for non-english. (over 100). Please try the patch and report back.
Yes, your patch works alright - it is just ukai and nothing else. I'll put it on the bug report as well. Ukai (or rather, the original Arphic kai font) was the first commercial quality chinese font released under an open license, so you are going to have a lot of people - 20% of the world is Chinese, and also linux is rather more officially popular in China due to licensing/cost/idealological reasons and some non-chinese will install "everything" - being affected by this. I don't know if it is ukai-specific or any Arphic kai derivatives, but if it affects any Arphic kai derivatives, filtering by font name as your patch did won't be effective.
Looks like a time to start blacklisting fonts then. If the font is invalid and does not work even on windows yet it is available in the system - that's the only thing Wine can do. Or just contact all distros to remove it. Or request packagers to refuse installing Wine if said font found in the system. Vitaliy.
"Vitaliy Margolen" <wine-devel(a)kievinfo.com> wrote:
Looks like a time to start blacklisting fonts then. If the font is invalid and does not work even on windows yet it is available in the system - that's the only thing Wine can do. Or just contact all distros to remove it. Or request packagers to refuse installing Wine if said font found in the system.
Black listing the fonts is not an appropriate fix/workaround. There is already a fixed version of ukai.ttf, and a broken one was causing problems in a lot of native programs besides Wine. -- Dmitry.
--- On Thu, 27/3/08, Dmitry Timoshkov <dmitry(a)codeweavers.com> wrote:
"Vitaliy Margolen" <wine-devel(a)kievinfo.com> wrote:
Looks like a time to start blacklisting fonts then. If the font is invalid and does not work even on windows yet it is available in the system - that's the only thing Wine can do. Or just contact all distros to remove it. Or request packagers to refuse installing Wine if said font found in the system.
Black listing the fonts is not an appropriate fix/workaround. There is already a fixed version of ukai.ttf, and a broken one was causing problems in a lot of native programs besides Wine.
I think blacklisting is not a good approach - what one wants is really "white-listing": given microsoft only ships a certain number of fonts, wine should provide emulation/substitutions of *only* those fonts fron known open-source alternatives, rather than expose the whole of fontconfig-available fonts to win32 applications. And applications should only expect to get those known MS fonts (or clones/substitutes). OTOH, ukai (or one of its Arphic derivative sibings) is fairly critical for most chinese-reading person :-). I am not sure "There is a fixed version of ukai" - from the codeweaver wiki and freedesktop's web site, I have the latest ukai release via redhat, and the wiki seems to suggests a non-debian mod older ukai to replace a debian-modified one. So my finger-pointing tendency would say that somehow a debian ukai modification which breaks gdiplus has got into freedesktop uptream... __________________________________________________________ Sent from Yahoo! Mail. A Smarter Inbox http://uk.docs.yahoo.com/nowyoucan.html
On Fri, Mar 28, 2008 at 11:12 AM, Hin-Tak Leung <htl10(a)users.sourceforge.net> wrote:
I think blacklisting is not a good approach - what one wants is really "white-listing": given microsoft only ships a certain number of fonts, wine should provide emulation/substitutions of *only* those fonts fron known open-source alternatives, rather than expose the whole of fontconfig-available fonts to win32 applications. And applications should only expect to get those known MS fonts (or clones/substitutes).
Umm, I have friends who are font fanatics that have thousands of fonts installed on their system. If they can do that on Windows, they certainly should be able to do that on Linux. Are you suggesting we a) limit ourselves to only support what ships with Windows, and ignore all other fonts out there, or b) create a white list for every known font out there?
OTOH, ukai (or one of its Arphic derivative sibings) is fairly critical for most chinese-reading person :-).
I am not sure "There is a fixed version of ukai" - from the codeweaver wiki and freedesktop's web site, I have the latest ukai release via redhat, and the wiki seems to suggests a non-debian mod older ukai to replace a debian-modified one. So my finger-pointing tendency would say that somehow a debian ukai modification which breaks gdiplus has got into freedesktop uptream...
AFAIK, the bad version of the ukai font is 20060928. It shiped with Ubuntu Feisty [1], Gutsy [2], and FC 8 [3]. Possibly with other distros as well, I have not done an exhaustive search. Just don't use that version and you should be fine. [1] http://packages.ubuntu.com/feisty/ttf-arphic-ukai [2] http://packages.ubuntu.com/gutsy/ttf-arphic-ukai [3] http://rpm.pbone.net/index.php3/stat/4/idpl/5312345/com/cjkunifonts-ukai-0.1...
--- On Fri, 28/3/08, Lei Zhang <thestig(a)google.com> wrote:
From: Lei Zhang <thestig(a)google.com> <snipped> Umm, I have friends who are font fanatics that have thousands of fonts installed on their system. If they can do that on Windows, they certainly should be able to do that on Linux. Are you suggesting we a) limit ourselves to only support what ships with Windows, and ignore all other fonts out there, or b) create a white list for every known font out there?
I don't have an answer to that - in a different machine, I have maybe a 100 chinese fonts of various level of obcurity :-). but it is going to be a nightmare for the wine developers to allow random fonts to break some part of it. <snipped> __________________________________________________________ Sent from Yahoo! Mail. A Smarter Inbox http://uk.docs.yahoo.com/nowyoucan.html
participants (5)
-
Dmitry Timoshkov -
Hin-Tak Leung -
Huw Davies -
Lei Zhang -
Vitaliy Margolen