After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 662261 - floating point exception when no canberra-gtk-module is loaded
floating point exception when no canberra-gtk-module is loaded
Status: RESOLVED INCOMPLETE
Product: vte
Classification: Core
Component: general
0.30.x
Other Linux
: Normal major
: ---
Assigned To: VTE Maintainers
VTE Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-10-20 01:50 UTC by speps
Modified: 2011-10-28 14:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description speps 2011-10-20 01:50:03 UTC
/* gcc -Wall vte.c `pkg-config --cflags --libs gtk+-3.0 vte-2.90` */

#include <gtk/gtk.h>
#include <vte/vte.h>

int main(int argc, char* argv[]) {
    gtk_init(&argc, &argv);
    
    GtkWidget* terminal = vte_terminal_new();
    GtkWidget* window   = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(terminal));
    gtk_widget_show_all(window);
    
    gtk_main();
    
    return 0;
}

This simple code generates a floating point exception:

$ ./a.out
Floating point exception

$ gdb a.out 
GNU gdb (GDB) 7.3.1
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/speps/a.out...(no debugging symbols found)...done.
(gdb) run
Starting program: /home/speps/a.out 
[Thread debugging using libthread_db enabled]

Program received signal SIGFPE, Arithmetic exception.
0x00007ffff7b6e73e in _vte_draw_set_text_font () from /usr/lib/libvte2_90.so.9
(gdb) bt
  • #0 _vte_draw_set_text_font
    from /usr/lib/libvte2_90.so.9
  • #1 vte_terminal_ensure_font
    from /usr/lib/libvte2_90.so.9
  • #2 vte_terminal_get_preferred_height
    from /usr/lib/libvte2_90.so.9
  • #3 ??
    from /usr/lib/libgtk-3.so.0
  • #4 ??
    from /usr/lib/libgtk-3.so.0
  • #5 ??
    from /usr/lib/libgtk-3.so.0
  • #6 gtk_widget_get_preferred_size
    from /usr/lib/libgtk-3.so.0
  • #7 ??
    from /usr/lib/libgtk-3.so.0
  • #8 ??
    from /usr/lib/libgtk-3.so.0
  • #9 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #10 ??
    from /usr/lib/libgobject-2.0.so.0
  • #11 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #12 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #13 gtk_widget_show
    from /usr/lib/libgtk-3.so.0
  • #14 main
  • #938 if
  • #939 font_info_destroy

draw->font->width seems to be 0, causing a division by zero.

Running with GTK_MODULES=canberra-gtk-module ./a.out instead,
works fine as expected.

You'll not notice this in a gnome environment cause the canberra module
is loaded by default.
Comment 1 Christian Persch 2011-10-28 12:50:02 UTC
Works here.
Comment 2 speps 2011-10-28 14:32:39 UTC
I'm not the only one that confirms this behaviour

http://oproj.tuxfamily.org/bts/index.php?do=details&task_id=3&string=&project=2&search_name=&type%5B0%5D=&sev%5B0%5D=&pri%5B0%5D=&due%5B0%5D=&reported%5B0%5D=&cat%5B0%5D=&status%5B0%5D=&percent%5B0%5D=&opened=&dev=&closed=&duedatefrom=&duedateto=&changedfrom=&changedto=&openedfrom=&openedto=&closedfrom=&closedto=

@Christian Persch
Did you try executing from within a clean x session (no gnome)?

$ xinit ./a.out -- :1 # should fail
$ GTK_MODULES=canberra-gtk-module xinit ./a.out -- :1 # should work

Be sure there is no camberra-gtk-module loaded by default
(you can check with strace or other tools).
Comment 3 Christian Persch 2011-10-28 14:55:50 UTC
Yes, I made sure that the canberra module was not loaded (checking /proc/$pid/maps).