moserial 3.01 crashes upon clicking "Connect" to a ttyUSB port

Bug #893939 reported by Alfonso
78
This bug affects 15 people
Affects Status Importance Assigned to Milestone
Moserial
Fix Released
Medium
moserial (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Reproducing the bug on Ubuntu 11.10 x86_64 (on AMDv140 processor):

1) apt-get install moserial
2) connect a serial-to-USB adapter (ftdi or pl2303)
3) start moserial and configure it to use the USB-serial device -- for example: /dev/ttyUSB0
4) click on "Connect" button: moserial will crash with errors like:

(moserial:14712): Gtk-CRITICAL **: gtk_text_buffer_set_mark: assertion `gtk_text_iter_get_buffer (iter) == buffer' failed
(moserial:14712): Gtk-CRITICAL **: gtk_text_buffer_get_iter_at_mark: assertion `!gtk_text_mark_get_deleted (mark)' failed

Tags: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in moserial (Ubuntu):
status: New → Confirmed
Revision history for this message
pipe (pipatron) wrote :

Just got hit by this.

[34448.177480] usbcore: registered new interface driver usbserial
[34448.177498] USB Serial support registered for generic
[34448.177712] usbcore: registered new interface driver usbserial_generic
[34448.177716] usbserial: USB Serial Driver core
[34448.188827] USB Serial support registered for pl2303
[34448.188879] pl2303 2-6.1:1.0: pl2303 converter detected
[34448.190524] usb 2-6.1: pl2303 converter now attached to ttyUSB0
[34448.190553] usbcore: registered new interface driver pl2303
[34448.190556] pl2303: Prolific PL2303 USB to serial adaptor driver
.......
[38135.676571] moserial[8452]: segfault at 50 ip 00007f443dd7b350 sp 00007fffeb743c28 error 4 in libgtk-3.so.0.200.0[7f443db91000+442000]

lsusb:
Bus 002 Device 009: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port

Revision history for this message
AndreK (andre-k) wrote :
Download full text (3.5 KiB)

3.01 here on Ubunu 11.10 ; moserial crashes instantly not on connect , but when trying to send text:

(moserial:13149): 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

(moserial:13149): Gtk-CRITICAL **: gtk_text_buffer_apply_tag_by_name: assertion `gtk_text_iter_get_buffer (end) == buffer' failed

(moserial:13149): 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

(moserial:13149): Gtk-CRITICAL **: gtk_text_buffer_insert: assertion `gtk_text_iter_get_buffer (iter) == buffer' failed

(moserial:13149): 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

(moserial:13149): Gtk-CRITICAL **: gtk_text_buffer_set_mark: assertion `gtk_text_iter_get_buffer (iter) == buffer' failed

(moserial:13149): 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

(moserial:13149): Gtk-CRITICAL **: gtk_text_buffer_insert: assertion `gtk_text_iter_get_buffer (iter) == buffer' failed

(moserial:13149): 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...

Read more...

Revision history for this message
Wolfgang Zukrigl (wolfgang-zukrigl) wrote :

Same problem here: moserial crashes when clicking on Connect-Button with a segmentation fault (Ubuntu 12.04)

(moserial:6264): Gtk-CRITICAL **: gtk_text_buffer_set_mark: assertion `gtk_text_iter_get_buffer (iter) == buffer' failed

(moserial:6264): Gtk-CRITICAL **: gtk_text_buffer_get_iter_at_mark: assertion `!gtk_text_mark_get_deleted (mark)' failed
Segmentation fault (core dumped)

Revision history for this message
Jordi (jordi2242) wrote :

Hi.

I'm using moserial-3.0.1 on Ubuntu 12.04. After some debugging I've found the problem. Attached is the file 'HexTextBuffer.vala' (not a patch) with the problem solved (at least it works for me).

The problem is that in GTK/Vala TextBuffer's insert and delete operations the TextIter objects become invalidated. This effectively means that, as far as I know, after an insert or delete all TextIter are lost.

My solution has been to recover these lost Textiter objects by calling either get_iter_at_offset or get_iter_at_mark followed with a forward_chars.

I'm not an expert on Vala or GTK programming, so it is quite possible a nice and better solution exists. Meanwhile at least we can get moserial back to work.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Fix segmentation fault due to TextIter invalidations." of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Changed in moserial:
importance: Unknown → Medium
status: Unknown → New
Changed in moserial:
status: New → Fix Released
mjc (mjc-avtechpulse)
Changed in moserial (Ubuntu):
status: Confirmed → Fix Released
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.