Foro de elhacker.net

Sistemas Operativos => GNU/Linux => Mensaje iniciado por: WHK en 5 Junio 2015, 01:58 am



Título: A que se debe este error en mono?
Publicado por: WHK en 5 Junio 2015, 01:58 am
Hola, estaba escribiendo un par de líneas en mono y al ejecutar la aplicación y ejecutar una tarea específica se cierra solo, lo abrí desde el terminal y me aparece esto:

Citar
whk@machine:~/.../bin/Debug$ mono tasks.exe

(tasks:23360): 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
Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) Gtk.Application.gtk_main () <0xffffffff>
  at Gtk.Application.Run () <0x0000b>
  at tasks.MainClass.Main (string[]) <0x0003f>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

   mono() [0x4b1fac]
   mono() [0x5085de]
   mono() [0x428f2d]
   /lib/x86_64-linux-gnu/libpthread.so.0(+0xfc90) [0x7f7675a86c90]
   /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0(+0x1d3beb) [0x7f767210abeb]
   /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0(+0x1d410e) [0x7f767210b10e]
   /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0(gtk_text_layout_get_line_display+0x11a) [0x7f7672113a7a]
   /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0(+0x1ddc42) [0x7f7672114c42]
   /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0(+0x1c2005) [0x7f76720f9005]
   /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0(gtk_text_layout_validate_yrange+0x21a) [0x7f7672112faa]
   /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0(+0x1ea91d) [0x7f767212191d]
   /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0(+0x1eca5d) [0x7f7672123a5d]
   /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0(+0x1eca99) [0x7f7672123a99]
   /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0(+0x1dd87) [0x7f7671c9fd87]
   /lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x15d) [0x7f766bd3ab6d]
   /lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x49f48) [0x7f766bd3af48]
   /lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_loop_run+0xc2) [0x7f766bd3b272]
   /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0(gtk_main+0xb7) [0x7f7672067747]
   [0x40a219da]

Debug info from gdb:

Could not attach to process.  If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/llama/ptrace_scope, or try
again as the root user.  For more details, see /etc/sysctl.d/10-ptrace.conf
ptrace: Operación no permitida.
No threads.

=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

Abortado (`core' generado)

Alguien sabe porque pasó esto?

En este código estoy utilizando threads junto a eventos en el cual cada evento llama a una función para escribir una línea de texto en un textview a modo de ventana de mensajes estados.


Título: Re: A que se debe este error en mono?
Publicado por: WHK en 5 Junio 2015, 03:49 am
Encontré el problema, es un bug de gtk, cuando la modificación de una caja de texto se hace desde un hilo de proceso distinto al que fue creado es necesario utilizar la manipulación del cursor:

Código:
buffer_out.Buffer.Insert (buffer_out.Buffer.EndIter, text + "\n");

En ves de :

Código:
buffer_out.Buffer.Text += text + "\n";