Ethereal-dev: [Ethereal-dev] Re: [Ethereal-users] Segfault in 0.8.12 / 0.8.14

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxxxxx>
Date: Thu, 4 Jan 2001 17:36:34 -0800
On Thu, Jan 04, 2001 at 07:44:32PM -0500, John J. LeMay Jr. wrote:
> ** Reply to message from Guy Harris <gharris@xxxxxxxxxxxx> on Thu, 4 Jan 2001
> 12:43:37 -0800
> 
> > On Thu, Jan 04, 2001 at 07:09:35AM -0500, John J. LeMay Jr. wrote:
> > > xfd comes up and the font description is:
> > > 
> > > -Misc-Fixed-Medium-R-SemiCondensed-13-120-75-75-C-60-ISO8559-1
> > 
> > What happens if you run
> > 
> > 	xfd -fn "-*-fixed-medium-r-semicondensed-*-*-120-*-*-*-*-iso8859-1"
> 
> Same output as above.

Then I'm somewhat at a loss to figure out what the hell is going on, as
that font pattern is the default font name in Ethereal, so if removing
your preferences file (meaning the default font name will be used) still
causes garbage to show up (I'm assuming that the blocks you're seeing
instead of data is in the packet list, protocol tree, and/or hex dump
windows), somehow GTK+ isn't managing to find that font, even though
"xfd" finds it - or maybe that font is a 2-byte font or a font that
doesn't have ASCII text characters in positions 0x20 through 0x7F,
the "iso8859-1" at the end nonwithstanding.

Try applying the following patch to "gtk/main.c" and rebuilding.  Then
try running the resulting version of Ethereal from an xterm or other
terminal window.  Report what messages it prints.
*** gtk/main.c.dist	Thu Jan  4 17:29:11 2001
--- gtk/main.c	Thu Jan  4 17:25:27 2001
***************
*** 1223,1231 ****
--- 1223,1247 ----
    gtk_rc_parse(rc_file);
  
    /* Try to load the regular and boldface fixed-width fonts */
+ {
+ static GdkWChar test[] = { 'A', 'B' };
+ 
    bold_font_name = boldify(prefs->gui_font_name);
    m_r_font = gdk_font_load(prefs->gui_font_name);
+ fprintf(stderr, "Loading %s as the Roman font %s\n", prefs->gui_font_name,
+ (m_r_font == NULL) ? "failed" : "succeeded");
+ if (m_r_font != NULL) {
+ if (gdk_text_width_wc(m_r_font, test, 2) == 0)
+ fprintf(stderr, "GET THIS DAMN 2-BYTE FONT OFF OF ME NOW!\n");
+ }
    m_b_font = gdk_font_load(bold_font_name);
+ fprintf(stderr, "Loading %s as the Bold font %s\n", bold_font_name,
+ (m_b_font == NULL) ? "failed" : "succeeded");
+ if (m_b_font != NULL) {
+ if (gdk_text_width_wc(m_b_font, test, 2) == 0)
+ fprintf(stderr, "GET THIS DAMN 2-BYTE FONT OFF OF ME NOW!\n");
+ }
+ }
    if (m_r_font == NULL || m_b_font == NULL) {
      /* XXX - pop this up as a dialog box? no */
      if (m_r_font == NULL) {