Once selected interface, if "Hosts List" is open and click on "Scan for hosts" Ettercap crash

Bug #588007 reported by magnuspub
70
This bug affects 13 people
Affects Status Importance Assigned to Milestone
ettercap (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: ettercap

After selecting Sniff->Unified sniffing, selecting Hosts->Hosts List, selecting Hosts->San for hosts, often will crash the application:

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: ettercap-gtk 1:0.7.3-1.4ubuntu1
ProcVersionSignature: Ubuntu 2.6.32-22.33-generic 2.6.32.11+drm33.2
Uname: Linux 2.6.32-22-generic i686
NonfreeKernelModules: nvidia
Architecture: i386
Date: Mon May 31 21:00:36 2010
ExecutablePath: /usr/sbin/ettercap
ProcEnviron:
 PATH=(custom, no user)
 LANG=it_IT.utf8
 SHELL=/bin/bash
SourcePackage: ettercap

Revision history for this message
magnuspub (magnus-gmx) wrote :
Revision history for this message
magnuspub (magnus-gmx) wrote :

(<unknown>:6679): Gtk-WARNING **: Invalid text buffer iterator: either the iterator is uninitialized, or the characters/pixbufs/widgets in the buffer have been modified since the iterator was created.
You must use marks, character numbers, or line numbers to preserve a position across buffer modifications.
You can apply tags and insert marks without invalidating your iterators,
but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character offset)
will invalidate all outstanding iterators

Ooops ! This shouldn't happen...
Segmentation Fault...

Revision history for this message
cyd (cyd) wrote :

Hello There,

i have same ettercap-gtk problem on lucid x86 (32b)

here is the output :

# ettercap -G

ettercap NG-0.7.3 copyright 2001-2004 ALoR & NaGA

(<unknown>:1957): Gtk-CRITICAL **: gtk_text_layout_real_invalidate: assertion `layout->wrap_loop_count == 0' failed

(<unknown>:1957): Gtk-CRITICAL **: gtk_text_layout_real_invalidate: assertion `layout->wrap_loop_count == 0' failed
<unknown>: Fatal IO error 11 (Ressource unavailable) on X server :0.0.

Revision history for this message
mcpalls (mcpalls) wrote :

kubuntu lucid 10.04 32bit
Linux 2.6.33 #1 SMP Mon Jul 5 03:07:52 CEST 2010 i686 GNU/Linux

i have same ettercap-gtk problem

sudo ettercap -G

ettercap NG-0.7.3 copyright 2001-2004 ALoR & NaGA

(<unknown>:17893): GLib-GObject-WARNING **: /build/buildd/glib2.0-2.24.1/gobject/gsignal.c:3079: signal name `depressed' is invalid for instance `0x9d4f1e0'

(<unknown>:17893): Gtk-CRITICAL **: gtk_text_layout_real_invalidate: assertion `layout->wrap_loop_count == 0' failed

(<unknown>:17893): Gtk-CRITICAL **: gtk_text_layout_real_invalidate: assertion `layout->wrap_loop_count == 0' failed
Ooops ! This shouldn't happen...
Segmentation Fault...

Please recompile in debug mode, reproduce the bug and send a bugreport

Revision history for this message
JKL (jkl102001) wrote :

When scanning for hosts, this is the backtrace I get:

Program received signal SIGSEGV, Segmentation fault.
#0 0x00007ffff60c3084 in gdk_window_set_geometry_hints ()
   from /usr/lib/libgdk-x11-2.0.so.0
#1 0x00007ffff6571035 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#2 0x00007ffff44e45de in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#3 0x00007ffff44f81dd in ?? () from /usr/lib/libgobject-2.0.so.0
#4 0x00007ffff44f9a76 in g_signal_emit_valist ()
   from /usr/lib/libgobject-2.0.so.0
#5 0x00007ffff44fa033 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#6 0x00007ffff63bf580 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#7 0x00007ffff6073db6 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#8 0x00007ffff402f8c2 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#9 0x00007ffff4033748 in ?? () from /lib/libglib-2.0.so.0
#10 0x00007ffff4033c55 in g_main_loop_run () from /lib/libglib-2.0.so.0
#11 0x00007ffff643dbb7 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#12 0x0000000000462bec in gtkui_start () at ec_gtk.c:441
#13 0x0000000000432b93 in ui_start () at ec_ui.c:79
#14 0x0000000000421f10 in main (argc=2, argv=0x7fffffffe798) at ec_main.c:173

I'm running Lucid64, and I built ettercap from the current Ubuntu bzr sources. It looks like the problem is with GTK. Some Google searches turn up other bugs related to gdk_window_set_geometry_hints. The consensus seems to be that it's some kind of tricky race condition/threading problem. Oy.

https://bugs.launchpad.net/ubuntu/+source/computer-janitor/+bug/420307
https://bugs.launchpad.net/ubuntu/+source/rhythmbox/+bug/424917

Revision history for this message
JKL (jkl102001) wrote :

The software doesn't use GTK locking properly, and it doesn't appear to be maintained upstream (last release 2005). Here is my initial effort at a patch (minimally tested). It fixes this bug, but it is possible that it may introduce new bugs due to lock contention (i.e. calling gdk_threads_enter() twice). The patch is against the Ubuntu bzr sources, and it was generated using bzr diff.

In order for the patch to be correct, I need to prove that gdk_threads_enter() gets called exactly once before each group of GTK/GDK operations, and gdk_threads_leave() gets called exactly once after. So far that hasn't been especially easy to prove, because there are a lot of different threads. Also there is a whole UI abstraction layer to deal with due to the dual GTK/ncurses frontends.

Revision history for this message
JKL (jkl102001) wrote :

The approach taken in that patch won't work, because the UI ops functions are sometimes called in the main thread when GTK is already locked and should not be locked again, and sometimes they are called in a worker thread when GTK needs to be locked. As expected, it causes deadlock.

tags: added: patch
Revision history for this message
JKL (jkl102001) wrote :

This patch takes a different approach. It removes GTK locking and forces all GTK operations into the main thread via g_idle_add. This approach has the advantage that it doesn't require knowing whether the main thread or some worker thread is attempting to performing the operations. It also has the advantage that it will probably fix other crash bugs specific to Windows, since the Windows GTK backend does not support multithreaded access to the windowing system.

Anyone see any obvious problems with this approach?

Daniel Hahler (blueyed)
Changed in ettercap (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Adithya (nkadithya31) wrote :

I am waiting for this bug to be patched...

Revision history for this message
Raul SA (raulsiguenza) wrote :

Not solved in 11.04.

ettercap NG-0.7.3 copyright 2001-2004 ALoR & NaGA

Ooops ! This shouldn't happen...
Segmentation Fault...

Please recompile in debug mode, reproduce the bug and send a bugreport

Revision history for this message
JKL (jkl102001) wrote :

If you aren't able to apply the patch and rebuild from source, try installing the version from the below PPA. It has the patch applied.

https://launchpad.net/~jkl102001/+archive/ppa

If it works for you, leave a note here saying so.

Revision history for this message
Raul SA (raulsiguenza) wrote :

The ppa works well for me. The bug does not appear.

Thanks JKL.

Revision history for this message
Roman (lqdc13) wrote :

I got the same problem but the ppa doesn't work anymore. I am trying to compile from source but dove into dependency hell...

Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

This bug should be fixed in oneiric. Please test and reopen if you still have problem

Changed in ettercap (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Jesse R. Taylor (jrtayloriv) wrote :

This bug should be re-opened. I am using Oneiric, ettercap version 0.7.3 and am still having this problem. My backtrace is a bit different from the one above, however, the segfault also occurs for me in gdk_window_set_geometry_hints ().

Below is the backtrace from gdb:

--------------------------------------------------

Starting program: /usr/sbin/ettercap -G
[Thread debugging using libthread_db enabled]

ettercap NG-0.7.3 copyright 2001-2004 ALoR & NaGA

Dissector "dns" not supported (etter.conf line 70)
[New Thread 0x7fffe7d35700 (LWP 5861)]
[New Thread 0x7fffe7534700 (LWP 5862)]
[New Thread 0x7fffe6d33700 (LWP 5863)]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff60944b4 in gdk_window_set_geometry_hints ()
   from /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0
(gdb) bt
#0 0x00007ffff60944b4 in gdk_window_set_geometry_hints ()
   from /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0
#1 0x00007ffff653ed23 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#2 0x00007ffff5de40a4 in g_closure_invoke ()
   from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#3 0x00007ffff5df5e5f in ?? ()
   from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#4 0x00007ffff5dff6b1 in g_signal_emit_valist ()
   from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#5 0x00007ffff5dff852 in g_signal_emit ()
   from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#6 0x00007ffff6390f60 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#7 0x00007ffff6043d26 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0
#8 0x00007ffff5b23a5d in g_main_context_dispatch ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9 0x00007ffff5b24258 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007ffff5b24792 in g_main_loop_run ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#11 0x00007ffff640cdb7 in gtk_main ()
   from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#12 0x00000000004506c5 in gtkui_start ()
#13 0x000000000041295f in main ()

Is there any other information I could provide that would help diagnose the problem?

Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

I think you should open a bug against libgtk2.0-0 because this seems to be a gtk crash.

Please feel free to link the bug here

Revision history for this message
Gustav Bergman (gustav-m-bergman) wrote :

I'm also getting this bug when using 'System.Timer' in Mono.

Gtk-CRITICAL **: gtk_text_layout_real_invalidate: assertion `layout->wrap_loop_count == 0' failed

Using GTK-verion 'gtk-sharp-2.12.10' on Ubuntu 12.04 LTS.

Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

I repeat, this seems to be a bug against gtk, please open a bug here [1]
and post here the bug number

[1] https://bugs.launchpad.net/ubuntu/+source/gtk+3.0

Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

Sorry for misunderstanding, this is clearly a bug in ettercap, fixed in ettercap_rc, not in ubuntu yet.

Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

Fixed in precise Pangolin

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.