Crash at charview #380

Closed
coolwanglu opened this Issue Mar 5, 2013 · 24 comments

Projects

None yet

5 participants

@coolwanglu
Contributor

This issue exists for quite some time, since around when autotools had been merged.

Ubuntu 12.10 64bit + git version of fontforge

To reproduce it:

  • In ~/.FontForge/prefs, change both DefaultCVWidth and DefaultCVHeight to 0
  • Open any font
  • Double-click any glyph
  • Crash

stderr output:

X Error of failed request: BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  1.0 (X_CreateWindow)
  Serial number of failed request:  2672
  Failed resource ID:  0

Stack trace is not useful, since X protocol is asynchronized

Workaround

Set DefaultCVWidth and DeafultCVHeight to nonzero values in ~/.FontForge/prefs, or simply remove this file.

@georgd
georgd commented Mar 5, 2013

I can not confirm this, I’ve been regularly updating fontforge from git on Ubuntu 12.10 and haven’t got above mentioned behaviour.

@JoesCat
Contributor
JoesCat commented Mar 5, 2013

inside gxdraw.c, myerrorhandler() prints out some information to stderr, so this is probably best run by first opening a command-line shell, and running fontforge there, that way you can see the output myerrorhandler() produces.

I'm running on 64bit & KDE, and one of the comments in myerrorhandler() appears to suggest there might be a difference between KDE and Gnome.

@JoesCat
Contributor
JoesCat commented Mar 5, 2013

...just noticed your reply @georgd so it adds to this puzzle since you also appear to have @coolwanglu setup too.

@coolwanglu
Contributor

@georgd Must be my configuration..
@JoesCat I've added the stdderr output.

I'll try with a clean installation of ubuntu

@JoesCat
Contributor
JoesCat commented Mar 5, 2013

I see above you are running startui.c, which means you are running with gui this time, while earlier you were also trying without gui.

Just a thought... but when you go back-n-forth changing ./configure from one option to try another option, do you run "make clean" before you run make for the new ./configure setup? If no, try that first since you may have some files compiled for the other option setup. If that cures the issue, then the problem is probably up in the autotools

@coolwanglu
Contributor

@JoesCat Sorry for the ambiguous.

Basically I've got two sets of dev environments, one is my machine with ubuntu 12.10 mentioned above, the other is a remote server without X.

On my machine I always call ./confgure without any parameters, and on the server I call with --without-x.

I've called make clean for a number of times for the previous cleaning patches, just wanted a fresh compiling to summon the GCC warnings

@coolwanglu
Contributor

I can reproduce it in a fresh Ubuntu 12.04 64bit + GNU DNS PPA (for latest autotools)

@coolwanglu
Contributor

Here's my config.log in Ubuntu 12.04

https://gist.github.com/coolwanglu/5089465

@JoesCat
Contributor
JoesCat commented Mar 6, 2013

Is there something we should see in the logfile? it's 6000+ lines long :-(

Forgot to mention. Did you also do:
sudo make install

...or...
su
make install
exit

reason for mentioning this is that even if you were to run fontforge from your developer directory, it still needs to get the libraries it uses - and PATH is going to look and find libraries in /usr, not the brand new libraries you just built and still sit in your developer directory (You might see discrepencies if you were to run fontforge on the command line - you'd see different build times).

If the problem still happens, you can also add additional fprintf(stderr, "HI, I'm here, and the value for x=%d, y=%d\n",x,y); type of statements to the routines leading-up to myhandler() which could give additional clues.

@coolwanglu
Contributor

@JoesCat Yes I've done that, otherwise I don't even expect GUI to show.

I was tracing fontforge to the crashing point, around the GXDrawSetZoom function, but I'm not familiar with the X protocol, I didn't see anything wrong there.

@coolwanglu
Contributor

and I provided the config file to show the libraries I have and I don't.

@coolwanglu
Contributor

Xorg -version gives

X.Org X Server 1.13.0
Release Date: 2012-09-05
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.2.0-32-generic x86_64 Ubuntu
Current Operating System: Linux wl-Laptop 3.5.0-26-generic #40-Ubuntu SMP Tue Feb 26 19:57:24 UTC 2013 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.5.0-26-generic root=UUID=89a61882-59a0-4000-977f-230d4d2a9796 ro quiet splash vt.handoff=7
Build Date: 27 November 2012  07:44:35AM
xorg-server 2:1.13.0-0ubuntu6.1 (For technical support please see http://www.ubuntu.com/support) 
Current version of pixman: 0.26.0
    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
@coolwanglu
Contributor

I can reproduce this in Windows 7 + Cygwin

@monkeyiq monkeyiq was assigned Mar 12, 2013
@davelab6
Member

Can you provide a video and backtrace of this crash, so it can be reproduced reliably? :)

@coolwanglu
Contributor

OK, let me see how to do it.
(I'm suspecting that it's about the libraries I installed (and I don't))

@coolwanglu
Contributor

@davelab6 I've listed a backtrace in the first post, is it enough? I guess you cannot reproduce it, since you have been talking about buts in the charview window, but I cannot even see it.

@coolwanglu
Contributor
@coolwanglu
Contributor

I've found the cause!
In line 1051 of gdraw/gxdraw.c, pos->width and pos->height happened to be 0, which should had been read from the prefs file
So my prefs file must have been messed up, (maybe derived from previous versions of FF)

I think we need to check the values before reading from or writing to prefs.
What do you think?

@davelab6
Member

@coolwanglu Great news! I agree that the values loaded from prefs could be hardened and I welcome you to do this :)

@coolwanglu coolwanglu added a commit that closed this issue Mar 15, 2013
@coolwanglu coolwanglu fixes #380 50a4d80
@JoesCat
Contributor
JoesCat commented Mar 16, 2013

On March 15, 2013 06:16:27 AM Lu Wang wrote:

I've found the cause!
In line 1051 of gdraw/gxdraw.c, pos->width and pos->height happened to
be 0, which should had been read from the prefs file So my prefs file
must have been messed up, (maybe derived from previous versions of FF)

Excellent to hear that!

I think we need to check the values before reading from or writing to
prefs. What do you think?

Seems like a good idea - When it comes to prefs, the way I see it is:

If prefs exist, use them.

If no prefs exist, you need to have some defaults you can put into
defaults, save them, use them.

...also the usual rant....
If you figure-out what it does, then comment, comment, comment.
Makes it easier to figure-out, if you or anyone else needs to look at this
code later for whatever reason.

@coolwanglu
Contributor

@JoesCat In my case, there was something stored in perfs, which value was invalid somehow..

@JoesCat
Contributor
JoesCat commented Mar 16, 2013

On March 15, 2013 10:12:57 PM Lu Wang wrote:

@JoesCat In my case, there was something stored in perfs, which value
was invalid somehow..

GIGO == Garbage In, Garbage Out.

If you want to make sure something works, you filter the input.
If you had invalid input, chances are one or more others have as well, but
you discovered this, while others say FF == bad software.

Maybe worth calling it an issue to fix?

@coolwanglu
Contributor

I just made a pull request, merged by davelab6, which solves this
particular issue.

On Sat, Mar 16, 2013 at 1:32 PM, Joe notifications@github.com wrote:

On March 15, 2013 10:12:57 PM Lu Wang wrote:

@JoesCat In my case, there was something stored in perfs, which value
was invalid somehow..

GIGO == Garbage In, Garbage Out.

If you want to make sure something works, you filter the input.
If you had invalid input, chances are one or more others have as well, but
you discovered this, while others say FF == bad software.

Maybe worth calling it an issue to fix?


Reply to this email directly or view it on GitHubhttps://github.com/fontforge/fontforge/issues/380#issuecomment-14999897
.

@JoesCat
Contributor
JoesCat commented Mar 16, 2013

Great! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment