New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2014-11 Mac strange pausing issue #1956
Comments
I can't seem to make this happen in the Homebrew version at all, which is weird. Is this from the app bundle or built from source? |
Dave told me that it happened in the .app version. He is currently testing the Homebrew version. |
Cheers. It'd be odd if something about the .app bundle itself was causing the pause 😕 |
@davelab6 I got the slowdown on 27_1239 but it seems that 27_1820 is ok for me. The former was git master the later is from the tag for today. |
FontForge.app 201411 26_0425.zip seems ok |
I can't install via brew...
|
Weird. Worked fine earlier. Might be an upstream connection issue, unless you're sat behind a firewall that blocks the git ports. Try again in a little bit I guess :/. Is this stable or head? Sent from my iPhone
|
I'm confused. At present, master is at 20141126. How would a build from master differ from a build from 20141126? |
gnulib has been flaky recently, and it seems like the sv.gnu.org link is just a redirect to |
Master worked perfectly for the workshop, I'll post a photo on my g+
|
I put the problem free master Mac build on the release page
|
@frank-trampe I also wondered about that. With master being the same as the date tag when I did the master build. I noticed that the app.zip for both had a different md5, and with testing here one of them had the slowdown and the other didn't. Though didn't investigate more (as yet) as I just wanted one with a recent build that didn't slow down for the workshop. |
The latest release on http://fontforge.github.io/en-US/downloads/mac/ still has slowdown/lag issues after 30 seconds or so |
Hi, @AndreasLarsen. For some reason, I am unable to reproduce the problem on my Macintosh. Could you perhaps run this in debug mode in order to see where it is spending its time?
|
This is weird - doesn't happen when I'm in debug mode 😕 |
And the problem was never solved. 😩 Do you know how to attach lldb to a running process? That might help here. |
Never really tried it - not much of a programmer I'm afraid. |
You need to give lldb the path to the FontForge binary. It is |
Ok, will look into this tomorrow - just downloaded the latest HEAD or what it's called. Works without issues so far... |
good to see that things seem to be working at the moment. It might be useful to have a script that lets poeple attach to the running fontforge. It is unlikely that folks are so interested in doing it manually, but a "run this" then control-c the terminal and type bt might provide a quick route to helping resolve issues in the future. I'll have a quick dig at that now. |
I've been playing around in 201412/03_1840 for a while now (at least in the minutes 5+) drawing stars and opening and closing the charview window. Can't seem to trigger the slowdown here on that version. FWIW using XQuartz 2.7.7 and osx 10.9.5. |
Latest HEAD version, quartz 2.7.7 and OS X 10.10 issue still persist - haven't been able to figure out what causes it since it doesn't happen every time. |
Yep, it works in debug mode so far. Otherwise its 5 to 30 sec pause. |
I have observed the following behaviour (don't know if it will help), under MacOsX 10.9.5: reinstalling FontForge fixes the issue, but on first launch only. After then, every time I try to launch FF, I face the same freeze problem. I can also see a difference between the very first launch and the other ones: On the very first launch, only one app icon is displayed in the dock: xquartz. When the lag starts to occur, clicking on the FF icon unfreezes immediately the app. It's quite strange, looks like there are interferences between xquartz, mac os x, and fontforge Add: Launching FF in debug mode as explained in the thread works for me; I have only one icon in the dock then: xquartz. |
@venildo verify this behaviour on OSx10.10.1. I experience the same "When the lag starts to occur, clicking on the FF icon unfreezes immediately the app. " |
Me too on 10.9 |
I can reliably reproduce when I open FontForge on a file, and do things for about 30s:
|
Spoke to @frank-trampe to find out exactly how to get a backtrace on this without starting in First open the Fontforge app via terminal:
Then find its process id (pid):
Then run lldb;
And then run FontForge until the pausing occurs, and then press
(The above is just an example, I couldn't reproduce the issue just yet.) |
Ok I did this. I don't have to wait FF to pause. It just pauses at launch. And I noticed when I click on some other programme It right away un pauses.
|
@davelab6 |
Using
|
It seems fairly clear from the backtraces that the problem is in RunApplicationEventLoop as called in fontforge_main. @DomT4, I am curious as to whether the homebrew build defines the __Mac macro. If not, that would explain the different outcomes (since, otherwise, FontForge just uses the GDrawEventLoop). The code comments also suggest that listen_to_apple_events, another prerequisite to using the Apple event handler, only gets set if FontForge is running from the .app bundle, but I cannot confirm that. According to Apple's documentation, RunApplicationEventLoop is part of the Carbon A. P. I., which is still supported in Yosemite (despite being deprecated with Mountain Lion). But I wonder whether there is some problem in the Yosemite Carbon implementation. Does anybody on an older version of the operating system have this problem? Another possible problem is that, according to the FontForge source code, RunApplicationEventLoop is not provided by Apple's 64-bit headers (since Carbon is 32-bit-only). FontForge works around this by declaring the function prototype, and it links successfully, but I am inclined to think that there is some compelling reason that Apple did not want this 32-bit function called from 64-bit code. (I don't understand the Mach-O system and how inter-architectural function calls work, if they do.) Perhaps there are inconsistent word sizes somewhere? There is another possibility. The documentation states that RunApplicationEventLoop waits on relevant events. It could be that we are misconfiguring the event filter and that FontForge only wakes on certain classes of events. I would appreciate advice from any low-level Macintosh platform experts on this (and any referrals to such experts). |
Would it be hard to switch to Cocoa? |
On 16 December 2014 at 16:14, Frank Trampe notifications@github.com wrote:
I'm on 10.9 |
I probably need to figure out how much Carbon FontForge presently uses. |
This suggests that the main reason for using the Apple event loop was a desire to add Finder integration. So maybe the dependencies are not too deep. |
I'm currently working through the open Coverity defects in order to rule out stack-smashing problems, but I will plan to look into a Cocoa equivalent to the event loop soon. |
I decided to cap that work for now. I looked through the remainder of the [very long] defect list and did not see any obvious sources of stack-smashing or over-running problems. I would be curious as to whether those who experience the pausing problem get it even without opening a typeface. If so, that would rule out a large portion of the codebase in our hunt for any memory corruption problem. |
It happens for me without opening anything. It is there from the start-up On Wed, Dec 17, 2014, 10:54 AM Frank Trampe notifications@github.com
|
Yes it happens for me on an Untitled 1 font that is empty, just clicking |
There is not much precedent for using Cocoa in a standard X11 + C application. The GIMP has ported completely to a native Macintosh interface. Inkscape (as far as I know) uses no Cocoa and makes very little use of Carbon. As a result, it does not support file drops onto a running application. So, given the limited loss of functionality that would result and the heavy cost of adding a Cocoa wrapper, I'm inclined to fix this problem by dropping Carbon. Any objections? I have a few questions for Homebrew folks (@DomT4). Is __Mac defined (in confdefs.h) when building from Homebrew? And does drag + drop work for opening files? |
I would choose increased stability and code simplicity over limited "nice to have" functionality any day |
Not sure to be honest, I'm afraid.
From the Finder? Nope. Have to manually do |
People, this is crazy. The builds from 2 months back don't do this so it's |
If this is some sort of word size or byte alignment problem from calling a 32-bit function from 64-bit code, it is difficult to determine exactly what change triggered the visible problem. When operating on the outer fringes of the specification, the behavior of other parties' code is undefined, and seemingly unrelated adjustments to our code (that change the exact locations of other things in the binary) can make these things appear and disappear. It could even be from an update to Apple's development tools rather than from something that we did. (I would be curious to see whether a new build of old code on @monkeyiq's machine would demonstrate the problem or not.) That may not be the source of the problem, but I do not have any other leads. If I could reproduce the problem, I would try bisecting it. Would anybody like to try? |
@adrientetar, were you able to reproduce the problem previously? Can you test now? |
Well, I have never used FontForge on a Mac so far. |
Hmm. |
@davelab6, do you know of anybody who is able to reproduce this problem on a Macintosh and is able to build from source? |
When I built from source using homebrew it didn't happen. I'll try the daily @monkeyiq build tomorrow |
Just checked |
Excellent. It's time for a release! |
@monkeyiq @frank-trampe The latest mac build has a crazy pause going on... I made a video to show the behaviour:
http://youtu.be/0x0_T4s6gpk
The text was updated successfully, but these errors were encountered: