WineHQ
Bug Tracking Database – Bug 34188

 Bugzilla

 

Last modified: 2023-05-19 13:41:43 UTC  

crash when creating a new wineprefix with winemac.drv

Bug 34188 - crash when creating a new wineprefix with winemac.drv
crash when creating a new wineprefix with winemac.drv
Status: CLOSED FIXED
AppDB: Show Apps affected by this bug
Product: Wine
Classification: Unclassified
Component: winemac.drv
1.6
x86 MacOS
: P2 normal
: ---
Assigned To: Mr. Bugs
: download
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2013-08-01 17:15 UTC by Austin English
Modified: 2023-05-19 13:41 UTC (History)
5 users (show)

See Also:
Regression SHA1:
Fixed by SHA1: 1f2d55637399b6d2507b661d013c0bbf8a9c0d30
Distribution: ---
Staged patchset:


Attachments
backtrace (8.31 KB, text/plain)
2013-08-01 17:15 UTC, Austin English
Details
Patch to fix the crash (1.92 KB, patch)
2013-08-01 19:11 UTC, Ken Thomases
Details | Diff
Revised fix (2.42 KB, patch)
2013-08-01 19:47 UTC, Ken Thomases
Details | Diff
Link gdi32 against AppKit (1.56 KB, patch)
2013-08-04 22:52 UTC, Ken Thomases
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Austin English 2013-08-01 17:15:16 UTC
Created attachment 45475 [details]
backtrace

May only be in 10.7+.
Comment 1 Ken Thomases 2013-08-01 17:41:18 UTC
The problem has to do with the use of the Core Text API (CTFontDescriptor, in particular) in gdi32.  If that happens before Cocoa is loaded, then Cocoa blows up when it tries to access fonts, such as the font used in window title bars.

Although this is not a public part of the API, CTFontDescriptor and the Cocoa NSFontDescriptor class are assumed to be toll-free bridged (interchangeable with just a type cast) in the bowels of Cocoa.  However, this bridging support is only enabled if Cocoa has been loaded into the process when CTFontDescriptor is first used.

Cocoa messages a CTFontDescriptor object as though it were an NSFontDescriptor object, by sending the -symbolicTraits message.  When the bridging support is not enabled, this results in the crash.


For any given Wine session, at most one process enumerates the fonts (in gdi32's initialization).  It caches the font details in a volatile registry key and subsequent processes read from that cache.  So, only that process uses CTFontDescriptor.  I think in almost all cases, that's wineboot.exe.

With an existing, up-to-date wineprefix, wineboot doesn't show any windows.  Therefore, it doesn't cause Cocoa to access fonts, and doesn't crash.

However, when it is creating or updating a wineprefix, it shows a window and, boom, down it goes.


I'm developing a workaround.  I plan to make gdi32 load the graphics driver (and thus, when using the Mac driver, Cocoa) before enumerating fonts.  Or, if it's not feasible to load the graphics driver at that point, I'll make gdi32 load Cocoa directly if it's going to use the Mac driver.
Comment 2 Ken Thomases 2013-08-01 19:11:00 UTC
Created attachment 45476 [details]
Patch to fix the crash

Please give the attached patch a try.  It fixes the problem in my testing on 10.8.x and, uh, later. ;)  It would be good to get confirmation that it fixes it for 10.7.x.
Comment 3 Austin English 2013-08-01 19:34:23 UTC
(In reply to comment #2)
> Created attachment 45476 [details]
> Patch to fix the crash
> 
> Please give the attached patch a try.  It fixes the problem in my testing on
> 10.8.x and, uh, later. ;)  It would be good to get confirmation that it fixes
> it for 10.7.x.

Works on 10.7.5.
Comment 4 Ken Thomases 2013-08-01 19:47:37 UTC
Created attachment 45477 [details]
Revised fix

Updated attached patch to the one I submitted to wine-patches.  Correctly handles the case where HKCU\Software\Wine\Drivers exists but the Graphics value does not (or can't be read).
Comment 5 camillo.lugaresi+wine 2013-08-03 21:33:03 UTC
This should be the same issue as half of bug 34066 (but not the Steam half).
Comment 6 Ken Thomases 2013-08-03 21:36:34 UTC
Yup, those are the same symptoms.  It's a shame I didn't see that bug before 1.6.
Comment 7 Ken Thomases 2013-08-04 22:52:20 UTC
Created attachment 45507 [details]
Link gdi32 against AppKit

The new patch fixes things in a simpler way.  It just links gdi32 against AppKit.
Comment 8 Austin English 2013-08-07 17:44:22 UTC
*** Bug 34213 has been marked as a duplicate of this bug. ***
Comment 9 Bruno Jesus 2013-08-15 13:29:21 UTC
A ptach related to this bug was commited:
http://source.winehq.org/git/wine.git/?a=commit;h=1f2d55637399b6d2507b661d013c0bbf8a9c0d30
Comment 10 Austin English 2013-08-15 20:10:59 UTC
(In reply to comment #9)
> A ptach related to this bug was commited:
> http://source.winehq.org/git/wine.git/?a=commit;h=1f2d55637399b6d2507b661d013c0bbf8a9c0d30

Works for me in 10.7.4. Thanks guys.
Comment 11 Alexandre Julliard 2013-08-30 13:05:53 UTC
Closing bugs fixed in 1.7.1.
Comment 12 Alexandre Julliard 2013-11-15 13:40:25 UTC
Removing 1.6.x milestone from bugs included in 1.6.1.
Comment 13 Brendan Shanks 2023-05-19 13:41:43 UTC
I did testing and found that this workaround is still needed for (at least) macOS 10.13.


Privacy Policy
If you have a privacy inquiry regarding this site, please write to [email protected]

Hosted By CodeWeavers