floating point exception when no canberra-gtk-module is loaded
Submitted by speps
Link to original bug (#662261)
Description
/* 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` 0x00007ffff7b6e73e in _vte_draw_set_text_font () from /usr/lib/libvte2_90.so.9
`#1` 0x00007ffff7b559d7 in vte_terminal_ensure_font () from /usr/lib/libvte2_90.so.9
`#2` 0x00007ffff7b55ed0 in vte_terminal_get_preferred_height () from /usr/lib/libvte2_90.so.9
`#3` 0x00007ffff76a2c15 in ?? () from /usr/lib/libgtk-3.so.0
`#4` 0x00007ffff7772e2a in ?? () from /usr/lib/libgtk-3.so.0
`#5` 0x00007ffff76a2c15 in ?? () from /usr/lib/libgtk-3.so.0
`#6` 0x00007ffff76a344a in gtk_widget_get_preferred_size () from /usr/lib/libgtk-3.so.0
`#7` 0x00007ffff7773433 in ?? () from /usr/lib/libgtk-3.so.0
`#8` 0x00007ffff7775ec7 in ?? () from /usr/lib/libgtk-3.so.0
`#9` 0x00007ffff5b470e4 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
`#10` 0x00007ffff5b5885a in ?? () from /usr/lib/libgobject-2.0.so.0
`#11` 0x00007ffff5b626f1 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
`#12` 0x00007ffff5b62892 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
`#13` 0x00007ffff776a870 in gtk_widget_show () from /usr/lib/libgtk-3.so.0
`#14` 0x0000000000400ac6 in main ()
exactly in _vte_draw_set_text_font () (vte-0.30.0/src/vtedraw.c) at
`#938` if ( abs((draw->font_bold->width * 100 / draw->font->width) - 100) > 10 ) {
`#939` font_info_destroy (draw->font_bold);
`#940` draw->font_bold = draw->font;
`#941` }
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.
Version: 0.30.x
Resolution: RESOLVED INCOMPLETE