Opened 4 years ago

Closed 20 months ago

#16542 closed defect (duplicate)

GTK interface crashes when editing pasted HTML

Reported by: Boozam1k Owned by:
Milestone: Component: pidgin (gtk)
Version: 2.10.11 Keywords: html
Cc:

Description

Example: Save this HTML as test.html and open it in your browser:

<html>
<body>
<div id="post_118810" style="margin-top: 24px;" class="container drop-shadow">
	<span style="font-size: 14px; font-weight: bold; padding-right: 12px;">Post title</span>
	<hr>
	<div id="p_118810">Post content</div>
</div>
</body>
</html>

(Also see attached as test.html)

This bases on a real-life thing I wanted to paste someone. I'm not sure which parts are relevant, but at least it's a small, self-contained example.

  1. Open it in your browser (you should see a bold "Post title" and a normal "Post content"), then select (Ctrl-A) and copy (Ctrl-C) the text.
  2. Open a conversation in Pidgin (the GTK interface)
  3. Paste it. It should now appear as "parsed"
  4. Move the cursor in the middle of the text (specifically, in front of the horizontal bar) by pressing the arrow-up key
  5. Press the "delete" key multiple times
  6. If successful, delete all text and repeat from step 2

For me it usually crashes in the first iteration, but always crashes before the third iteration. (So it crases *early* and *reproducably*).

The exit flags sometimes indicate a SIGSEGV, but most the time SIGABRT.

I *guess* it has something to do with HTML-tags being deleted only "partially" which subsequently fails to be parsed/displayed, but I have no idea.


I followed TipsForBugReports:

  • I have all plugins disables by renaming ~/.purple.prefs.xml, the problem still is there.
  • All plugins, libpurple, pidgin, and the system as a whole is updated to the newest version available for Debian testing (which might be outdated, but at least it's "pretty new"). See below for concrete version numbers.
  • There doesn't seem to be an existing bug report: This query finds no tickets.
  • I followed GetABacktrace:
    • "The Easy Way": See files pidgin-backtrace-20150119*.log

Sorry for the missing function names, but the package "pidgin-dbg" is installed, and I don'tknow what other "debug symbols" I should use.

  • "The Hard Way": See file core, but same problem. If someone tells me how to apply the debug symbols, I'd love to be of help.
  • "Obtaining a Debug Log": See file pidgin-debug-20150119153753.log

Note that it doesn't tell anything important.

Versions:

  • General setup: Debian ("testing" release) on GNU/Linux, using X, Xfce, Iceweasel (basically Firefox)
  • pidgin -v: Pidgin 2.10.11 (libpurple 2.10.11)
  • aptitude says (I have no idea which of these might be relevant):
    • libpurple0 2.10.11-1
    • libpurple-bin 2.10.11-1
    • pidgin-dbg 2.10.11-1
    • pidgin 2.10.11-1
    • pidgin-data 2.10.11-1
    • libgtk-3-0 3.14.5-1
    • libgtk2.0-0 2.24.25-1
    • libwebkitgtk-1.0-0 2.4.7-3
    • libwebkitgtk-1.0-common 2.4.7-3
    • libwebkitgtk-3.0-0 2.4.7-3
    • libwebkitgtk-3.0-common 2.4.7-3
    • libwxgtk3.0-0 3.0.2-1+b1
    • libgtk-3-bin 3.14.5-1
    • libgtk-3-common 3.14.5-1
    • libgtk2.0-bin 2.24.25-1
    • libgtk2.0-common 2.24.25-1
  • firefox -v: Mozilla Iceweasel 31.4.0 (but the browser shouldn't be relevant)

Attachments (5)

test.html (251 bytes) - added by Boozam1k 4 years ago.
The testcase that exhibits the bug
pidgin-debug-20150119153753.log (128.3 KB) - added by Boozam1k 4 years ago.
Debug log (see first post)
pidgin-backtrace-20150119150141.log (10.2 KB) - added by Boozam1k 4 years ago.
Backtrace (see first post)
pidgin-backtrace-20150119150651.log (10.2 KB) - added by Boozam1k 4 years ago.
Backtrace (see first post)
pidgin-backtrace-20150119200246.log (47.4 KB) - added by Boozam1k 4 years ago.
Actually helpful backtrace with symbols

Download all attachments as: .zip

Change History (10)

Changed 4 years ago by Boozam1k

The testcase that exhibits the bug

Changed 4 years ago by Boozam1k

Debug log (see first post)

Changed 4 years ago by Boozam1k

Backtrace (see first post)

Changed 4 years ago by Boozam1k

Backtrace (see first post)

comment:1 Changed 4 years ago by Boozam1k

Attachment "core" (core dump, see first post) is too big for upload here.

See instead:

comment:2 Changed 4 years ago by datallah

  • Status changed from new to pending

The crashing is within GTK+, and you don't have the debug symbols for that installed. If you install libgtk2.0-dbg, your backtrace should be more useful.

comment:3 Changed 4 years ago by Boozam1k

  • Status changed from pending to new

I was invoking the wrong build of gdb, sorry. Installed required debug symbols, and now it works. See next attachement.

Changed 4 years ago by Boozam1k

Actually helpful backtrace with symbols

comment:4 Changed 4 years ago by Boozam1k

Only by reading the last backtrace, I find that line 414 of gtkimhtml.c (pidgin)

GtkIMHtmlScalable *scale = GTK_IMHTML_SCALABLE(sd->scalable);
scale->scale(scale, rect.width - xminus, rect.height); // line 414

effectively calls a function in gtkwidget.c (gtk2.0), which has this signature:

void
gtk_widget_set_size_request (GtkWidget *widget,
                             gint       width,
                             gint       height)
{

However, as defined in line 200 of gtkimhtml.h (pidgin), the expected signature is:

struct _GtkIMHtmlScalable {
	void (*scale)(struct _GtkIMHtmlScalable *, int, int);
	// ...

I don't know about C and all the black magic involved, but to me this looks like a mismatch: gtkimhtml.c defines that the scale function can take a * _GtkIMHtmlScalable as the first argument. But somewhere the function pointer was set to gtk_widget_set_size_request: I don't see why and how this can be correct? (or the bug happened before and this is only the symptom, not the cause)

I never did object oriented programming in C, so I may be missing some of the magic involved. Please enlighten me :)

comment:5 Changed 20 months ago by dx

  • Resolution set to duplicate
  • Status changed from new to closed

Closed as duplicate of #15994.

Note: See TracTickets for help on using tickets.
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!