Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 410389 - media-radio/fldigi segfaults at start up
Summary: media-radio/fldigi segfaults at start up
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Thomas Beierlein
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-31 21:41 UTC by Shawn
Modified: 2015-10-27 05:02 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shawn 2012-03-31 21:41:27 UTC
To reproduce:
1. start fldigi from the command line
2. immediately receive segfault
   - No windows created
   - Local ~/.fldigi/ created and populated

----------------------------------------------------------------
fldigi output:
$ fldigi

Caught signal 11
Aborting fldigi due to a fatal error.
Please report this to:   fldigi-devel@lists.berlios.de
or file a bug report at: https://fedorahosted.org/fldigi/newticket

****** Stack trace:
fldigi[0x4fa08e]
/lib64/libpthread.so.0(+0xf000)[0x7f6fbcb85000]
/usr/lib64/fltk-1/libfltk.so.1.3(_ZN2Fl9set_fontsEPKc+0x256)[0x7f6fbce384e6]
fldigi[0x4a2c54]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x7f6fbb37bbbd]
fldigi[0x414b19]

****** Version information:
fldigi 3.21.38
Copyright (C) 2007-2010 Dave Freese, Stelios Bounanos, Leigh Klotz, Remi Chateauneu, and others.
License GPLv3+: GNU GPL version 3 or later <http://www.gnu.org/licenses/gpl-3.0.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

****** Build information:
Build information:
  built          : Sat Mar 31 16:19:00 CDT 2012 by root@s3 on x86_64-pc-linux-gnu for x86_64-pc-linux-gnu

  configure flags: '--prefix=/usr' '--build=x86_64-pc-linux-gnu' '--host=x86_64-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--libdir=/usr/lib64' '--disable-dependency-tracking' '--with-sndfile' '--without-portaudio' '--with-hamlib' '--enable-nls' '--without-pulseaudio' '--without-xmlrpc' '--without-asciidoc' 'build_alias=x86_64-pc-linux-gnu' 'host_alias=x86_64-pc-linux-gnu' 'CXXFLAGS=-O2 -pipe -march=nocona -ggdb' 'LDFLAGS=-Wl,-O1 -Wl,--as-needed -Wl,-O1' 'CFLAGS=-O2 -pipe -march=nocona -ggdb' 'PKG_CONFIG_PATH=/usr/qt/3/lib64/pkgconfig'

  compiler       : gcc version 4.5.3 (Gentoo 4.5.3-r2 p1.1, pie-0.4.7) 

  compiler flags : -I$(srcdir) -I$(srcdir)/include -I$(srcdir)/irrxml -I$(srcdir)/fileselector -I$(srcdir)/xmlrpcpp -I/usr/include/fltk-1 -DQT_SHARED -pthread -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/qt4 -I/usr/include/qt4/QtGui -I/usr/include/libdrm -I/usr/include/qt4/QtCore -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT -I/usr/include/hamlib -I/usr/include/libpng15 -pipe -Wall -fexceptions -O2 -ffast-math -finline-functions -DNDEBUG

  linker flags   : -L/usr/lib64/fltk-1 -Wl,-O1 -Wl,--as-needed -Wl,-O1 -lfltk_images -lpng -lz -ljpeg -lfltk -lXext -lXft -lfontconfig -lXinerama -lpthread -ldl -lm -lX11 -lX11 -lsndfile -lsamplerate -L/usr/lib64/hamlib -lhamlib -lm -lpng15 -ldl -lrt -lpthread

  libraries      : FLTK 1.3.0
                   libsamplerate 0.1.7
                   libsndfile 1.0.25
                   Hamlib 1.2.14

Runtime information:
  system         : Linux s3 2.6.30-gentoo-r5 #3 SMP PREEMPT Sun Apr 3 16:23:44 CDT 2011 x86_64

  libraries      : libsamplerate-0.1.7 (c) 2002-2008 Erik de Castro Lopo
                   libsndfile-1.0.25
                   Hamlib 1.2.14

--------------------------------------------------------------------
$ gdb fldigi
GNU gdb (Gentoo 7.2 p1) 7.2
...This GDB was configured as "x86_64-pc-linux-gnu".
...Reading symbols from /usr/bin/fldigi...done.
(gdb) run
Starting program: /usr/bin/fldigi 
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff772c4e6 in make_raw_name (pattern_name=<value optimized out>) at fl_set_fonts_xft.cxx:94
94	fl_set_fonts_xft.cxx: No such file or directory.
	in fl_set_fonts_xft.cxx
(gdb) bt
#0  0x00007ffff772c4e6 in make_raw_name (pattern_name=<value optimized out>) at fl_set_fonts_xft.cxx:94
#1  Fl::set_fonts (pattern_name=<value optimized out>) at fl_set_fonts_xft.cxx:324
#2  0x00000000004a2c54 in main (argc=1, argv=0x7fffffffda88) at main.cxx:324
---------------------------------------------------------------------
$ ldd $(which fldigi)
	linux-vdso.so.1 =>  (0x00007fff031dd000)
	libfltk_images.so.1.3 => /usr/lib64/fltk-1/libfltk_images.so.1.3 (0x00007fed681bd000)
	libpng15.so.15 => /usr/lib64/libpng15.so.15 (0x00007fed67f91000)
	libfltk.so.1.3 => /usr/lib64/fltk-1/libfltk.so.1.3 (0x00007fed67c73000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fed67a57000)
	libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007fed67724000)
	libsndfile.so.1 => /usr/lib64/libsndfile.so.1 (0x00007fed674c2000)
	libsamplerate.so.0 => /usr/lib64/libsamplerate.so.0 (0x00007fed67156000)
	libhamlib.so.2 => /usr/lib64/hamlib/libhamlib.so.2 (0x00007fed66f39000)
	libm.so.6 => /lib64/libm.so.6 (0x00007fed66cb8000)
	librt.so.1 => /lib64/librt.so.1 (0x00007fed66aaf000)
	libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6 (0x00007fed667ad000)
	libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libgcc_s.so.1 (0x00007fed66597000)
	libc.so.6 => /lib64/libc.so.6 (0x00007fed6623e000)
	libjpeg.so.8 => /usr/lib64/libjpeg.so.8 (0x00007fed65fff000)
	libz.so.1 => /lib64/libz.so.1 (0x00007fed65de8000)
	libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007fed65bd6000)
	libXft.so.2 => /usr/lib64/libXft.so.2 (0x00007fed659c1000)
	libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x00007fed6578c000)
	libXinerama.so.1 => /usr/lib64/libXinerama.so.1 (0x00007fed65589000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007fed65385000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fed683cc000)
	libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007fed65168000)
	libFLAC.so.8 => /usr/lib64/libFLAC.so.8 (0x00007fed64f31000)
	libvorbisenc.so.2 => /usr/lib64/libvorbisenc.so.2 (0x00007fed64a62000)
	libvorbis.so.0 => /usr/lib64/libvorbis.so.0 (0x00007fed64836000)
	libogg.so.0 => /usr/lib64/libogg.so.0 (0x00007fed64630000)
	libltdl.so.7 => /usr/lib64/libltdl.so.7 (0x00007fed64426000)
	libusb-0.1.so.4 => /lib64/libusb-0.1.so.4 (0x00007fed6421d000)
	libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007fed63f87000)
	libXrender.so.1 => /usr/lib64/libXrender.so.1 (0x00007fed63d7d000)
	libexpat.so.1 => /usr/lib64/libexpat.so.1 (0x00007fed63b56000)
	libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007fed63953000)
	libXdmcp.so.6 => /usr/lib64/libXdmcp.so.6 (0x00007fed6374d000)
	libbz2.so.1 => /lib64/libbz2.so.1 (0x00007fed6353d000)

---------------------------------------------------------------------
emerge --info:
Portage 2.1.10.49 (default/linux/amd64/10.0/desktop, gcc-4.5.3, glibc-2.11.2-r3, 2.6.30-gentoo-r5 x86_64)
=================================================================
System uname: Linux-2.6.30-gentoo-r5-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q8200_@_2.33GHz-with-gentoo-2.0.3
Timestamp of tree: Sat, 31 Mar 2012 05:15:01 +0000
app-shells/bash:          4.1_p9
dev-java/java-config:     1.3.7::<unknown repository>, 2.1.11-r3
dev-lang/python:          2.6.6-r2, 3.1.4-r3
dev-util/cmake:           2.8.4-r1
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.8.2-r1
sys-apps/sandbox:         2.4
sys-devel/autoconf:       2.13::<unknown repository>, 2.68
sys-devel/automake:       1.4_p6::<unknown repository>, 1.5::<unknown repository>, 1.6.3::<unknown repository>, 1.7.9-r1::<unknown repository>, 1.8.5-r3::<unknown repository>, 1.9.6-r2::<unknown repository>, 1.10.3, 1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            3.4.6-r2, 4.1.2, 4.3.2-r3, 4.4.4-r2, 4.5.3-r2
sys-devel/gcc-config:     1.5-r2
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 2.6.30-r1 (virtual/os-headers)
sys-libs/glibc:           2.11.2-r3
Repositories: gentoo x-portage
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA AdobeFlash-10.1 AdobeFlash-10.3 AdobeFlash-11_beta skype-eula"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=nocona -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=nocona -ggdb"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask=n"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://gentoo.netnitco.net http://gentoo.mirrors.pair.com/ ftp://chi-10g-1-mirror.fastsoft.net/pub/linux/gentoo/gentoo-distfiles/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-O1"
LINGUAS="en_US en"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac acl acpi aim alsa amd64 ao apache2 apm arts audiofile avi bacula-console bash-completion berkdb bluetooth branding bzip2 cairo cdda cddb cdparanoia cdr clamav cli consolekit cracklib crypt cups cxx dbus dga dio dri dts dv dvb dvd dvdr dvdread emboss encode examples exif extras fam fastcgi ffmpeg firefox flac flatfile fontconfig fortran ftp gd gdbm gdu ggi gif gimp gimpprint gnutls gphoto2 gpm gps gstreamer gtk gtk2 hal iconv icq ieee1394 imagemagick imap imlib ipod ipv6 jack jadetex java javascript joystick jpeg jpeg2k kde lash lcms ldap libnotify lirc lm_sensors lxde mad maildir mikmod mime mjpeg mmx mmxext mng modules motif mozilla mp3 mp4 mpeg mplayer mudflap multilib musepack mysql mysqli nas ncurses netboot nls nntp nptl nptlonly nsplugin nvidia odbc ogg openal opengl openmp osc oscar pam pango pcre pdf perl php plotutils png policykit posix postgres povray ppds pppd python qt3support qt4 quicktime rdesktop readline ruby samba sdl semantic-desktop session shorten sndfile spell sql sse sse2 ssl startup-notification svg symlink sysfs tcl tcltk tcpd threads tiff tk transcode transmitter truetype udev unicode usb v4l v4l2 vcd vorbis webkit wifi wmf wxwindows x264 xcb xcomposite xinerama xml xorg xosd xpm xsl xulrunner xv xvid xvmc yahoo zlib" ALSA_CARDS="bt87x ca0106 emu10k1x usb-audio via82xx via82xx-modem" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="authz_host access auth auth_dbm auth_anon auth_digest alias file-cache echo charset-lite cache disk-cache mem-cache ext-filter case_filter case-filter-in filter deflate mime-magic cern-meta expires headers usertrack unique-id proxy proxy-connect proxy-ftp proxy-http info include cgi cgid dav dav-fs vhost-alias speling rewrite log_config logio env setenvif mime status autoindex asis negotiation dir imap actions userdir so" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_US en" LIRC_DEVICES="serial" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="dummy fbdev v4l vesa nvidia nv" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Thomas Beierlein gentoo-dev 2012-04-02 04:30:27 UTC
(In reply to comment #0)
> To reproduce:
> 1. start fldigi from the command line
> 2. immediately receive segfault
>    - No windows created
>    - Local ~/.fldigi/ created and populated

Which version do we talk about?
Comment 2 Shawn 2012-04-02 04:38:06 UTC
> Which version do we talk about?

3.21.38
Comment 3 Thomas Beierlein gentoo-dev 2012-04-03 17:43:20 UTC
(In reply to comment #2)
> > Which version do we talk about?
> 
> 3.21.38

Ok. Thanks.

The problem is I can not reproduce the bug. Your gdb outputs (thanks, was helpful) showed that the segmentation fault was within fltk's set_fonts routine.

As that routine is called from fldigi with correct parameters there may be one of the following reasons:

1. fltk-1.3 misses USE="xft threads" 
2. Something on your fontinstall is broken (you have to have some ISO8859-1 fonts installed)
3. Your .fltk directory got borked somehow (should be ok to delete that directory for a quick test).

Please check your settings and report back.
Comment 4 Shawn 2012-04-04 02:13:22 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > > Which version do we talk about?
> > 
> > 3.21.38
> 
> Ok. Thanks.
> 
> The problem is I can not reproduce the bug. Your gdb outputs (thanks, was
> helpful) showed that the segmentation fault was within fltk's set_fonts
> routine.
> 
> As that routine is called from fldigi with correct parameters there may be
> one of the following reasons:
> 
> 1. fltk-1.3 misses USE="xft threads" 
> 2. Something on your fontinstall is broken (you have to have some ISO8859-1
> fonts installed)
> 3. Your .fltk directory got borked somehow (should be ok to delete that
> directory for a quick test).
> 
> Please check your settings and report back.

1. fltk-1.3 was built with both xft and threads
2. there are numerous iso88591 fonts installed
3. deleted .fltk and tried again - no difference

Further checking...
(I apologize.  I know there are better ways to present this but am not really familiar. Hope I get points for trying! :) )

In fl_set_fonts_xft.cxx, function make_raw_name(...) it appears there is the possibility of dereferencing a NULL pointer (*style) ?

when I change FROM:
     93   char *style = strchr(pretty, ':');
     94   char *last = style + strlen(style) - 2;
     95 
     96   if (style)
     97   {
     98     *style = 0; // Terminate "name" string
     99     style ++;   // point to start of style section
    100   }

TO:
     93   char *style = strchr(pretty, ':');
->   94   char *last ;
     95 
     96   if (style)
     97   {
->   98     last = style + strlen(style) - 2;
     99     *style = 0; // Terminate "name" string
    100     style ++;   // point to start of style section
    101   }

The auto-config wizard dialog opened.  It looked fine, but thats as far as I am getting tonight.  Hope it helps.  Let me know if you would like me to try something else.

Also, my system is configured for a default locale of en_US.UTF-8.  Is that possibly related?
Comment 5 Thomas Beierlein gentoo-dev 2012-04-04 04:57:49 UTC
(In reply to comment #4)
> 
> Further checking...
> (I apologize.  I know there are better ways to present this but am not
> really familiar. Hope I get points for trying! :) )
> 
> In fl_set_fonts_xft.cxx, function make_raw_name(...) it appears there is the
> possibility of dereferencing a NULL pointer (*style) ?
> 
....

Right. That would be a possible bug in fltk-1.3. But why do only You observe that.

Please run the unmodified code under gdb until it crashes. After the segfault you should be able to 'p pretty' (or 'p *pretty') to see what make_raw_name get as parameter. Your bug happens if no ':' is in the pretty font name.


> 
> Also, my system is configured for a default locale of en_US.UTF-8.  Is that
> possibly related?

No that is well.
Comment 6 Shawn 2012-04-05 00:11:45 UTC
(In reply to comment #5)
> Right. That would be a possible bug in fltk-1.3. But why do only You observe
> that.
> 
> Please run the unmodified code under gdb until it crashes. After the
> segfault you should be able to 'p pretty' (or 'p *pretty') to see what
> make_raw_name get as parameter. Your bug happens if no ':' is in the pretty
> font name.
> 

I tried the debugging instructions above but gdb reported symbol not defined in current context.

So, I added a printf("%s,%s\n",raw,pretty) to the start of make_raw_name().  The last few lines before the crash are:

BNimbusSanTExt,Notes:style=Normal
 Notes,OCR\-A:style=.egular
 OCR\-A,OCRAM:style=.egular
 OCRAM,OCRATTRegular:style=.egular
 OCRATTRegular,OCRBLetM:style=.egular
 OCRBLetM,Odessa LET:style=Plain
 Odessa LET,OkayD:style=.egular
 OkayD,Old English Gothic

So, fltk is choking on the "Old English Gothic" font.  The font is usable in OpenOffice at least.
Comment 7 Thomas Beierlein gentoo-dev 2012-04-07 06:33:38 UTC
(In reply to comment #6)

> So, fltk is choking on the "Old English Gothic" font.  The font is usable in
> OpenOffice at least.

OK, thanks for the good work. Can you please look which package installs this font. I would like to try it myself, but need to find that font first.

For the fldigi problem: There is nothing we can do from this side. You can only deinstall the font for the moment and we will need to open a bug for fltk to fix the bad coding.
Comment 8 Shawn 2012-04-07 22:14:10 UTC
(In reply to comment #7)
> (In reply to comment #6)
> 
> > So, fltk is choking on the "Old English Gothic" font.  The font is usable in
> > OpenOffice at least.
> 
> OK, thanks for the good work. Can you please look which package installs
> this font. I would like to try it myself, but need to find that font first.

The font file is not claimed by any package.  I think it came from a "2000 Truetype Fonts" CD that I bought years ago.

I checked all the other entries from the fc-list output. This "Old English Gothic" font is the sole font that does not have a "style:" attribute, so it seems badly done!  Still, I suppose a malformed font should not break fltk.

If you need to duplicate the behavior, perhaps you could edit a temporary copy of a font with fontforge or something like that, removing any "style:" entries?

> For the fldigi problem: There is nothing we can do from this side. You can
> only deinstall the font for the moment and we will need to open a bug for
> fltk to fix the bad coding.

If you need me to do anything, please let me know.  Thanks very much for helping me track this down.
Comment 9 Thomas Beierlein gentoo-dev 2014-08-12 09:14:52 UTC
Potential problem is fixed in fltk-1.3.2_p10088. so the bug can be closed as soon as that package goes stable.
Comment 10 Thomas Beierlein gentoo-dev 2015-10-27 05:02:28 UTC
(In reply to Thomas Beierlein from comment #9)
> Potential problem is fixed in fltk-1.3.2_p10088. so the bug can be closed as
> soon as that package goes stable.

With ftlk-1.3.3-r2 coming stable the bug can be closed now.