Bug 4473 - Segmentation fault, freeze and subsequent termination on opening "Libravatar"'s configuration.
Summary: Segmentation fault, freeze and subsequent termination on opening "Libravatar"...
Status: CLOSED FIXED
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: Plugins/Libravatar (show other bugs)
Version: 3.17.8
Hardware: PC Linux
: P3 normal
Assignee: Ricardo Mones
URL:
Depends on:
Blocks:
 
Reported: 2021-05-06 15:32 UTC by linux.felixbecker2
Modified: 2021-05-18 01:34 UTC (History)
1 user (show)

See Also:


Attachments
standard output of `claws-mail --debug`. (64.23 KB, text/x-log)
2021-05-06 15:32 UTC, linux.felixbecker2
no flags Details
standard error of `claws-mail --debug`. (202 bytes, text/plain)
2021-05-06 15:33 UTC, linux.felixbecker2
no flags Details
Attempt to fix this bug (1.31 KB, patch)
2021-05-16 18:03 UTC, Ricardo Mones
no flags Details | Diff

Description linux.felixbecker2 2021-05-06 15:32:26 UTC
Created attachment 2204 [details]
standard output of `claws-mail --debug`.

I have freshly compiled claws-mail, version 3.17.8.

I have loaded the "Libravatar"-plugin.

After loading the "Libravatar" plugin, tryint to configuring it with selecting from the menu bar  
`Configuration` -> `Preferences...` -> `Plugins` -> `Libravatar`,  
claws mail freezes and after a while terminates.

Attached I put the standart out and standard error output (I removed potentially privacy breaching output and replaced it with `[...]`) of a run of `claws-mail --debug`, where I after a start of claws-mail straight go to the abovementioned configuration item.


Then I have run `claws-mail` with `gdb`:

`gdb claws-mail`, then entering `run`, then going straight to the abovementioned configuration item.

`gdb` output before doing any user interactiont:

```
Starting program: /usr/bin/claws-mail 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff2e41640 (LWP 6496)]
[New Thread 0x7ffff2640640 (LWP 6497)]
[New Thread 0x7ffff1e3f640 (LWP 6498)]
[New Thread 0x7ffff163e640 (LWP 6499)]
[New Thread 0x7fffe3c39640 (LWP 6500)]
[New Thread 0x7fffe3438640 (LWP 6501)]
[Thread 0x7fffe3c39640 (LWP 6500) exited]
[Thread 0x7ffff163e640 (LWP 6499) exited]
[New Thread 0x7ffff163e640 (LWP 6502)]
[New Thread 0x7fffe3c39640 (LWP 6503)]
[Thread 0x7ffff163e640 (LWP 6502) exited]
[Thread 0x7fffe3c39640 (LWP 6503) exited]
[New Thread 0x7fffe3c39640 (LWP 6504)]
[Detaching after fork from child process 6505]
[Detaching after fork from child process 6507]
[Detaching after fork from child process 6509]
[Detaching after fork from child process 6511]
[Detaching after fork from child process 6513]
[Thread 0x7fffe3438640 (LWP 6501) exited]
```

Afer opening the Preferences window (but before selecting `Libravatar`):

```
[New Thread 0x7fffe3438640 (LWP 6587)]
[New Thread 0x7ffff163e640 (LWP 6588)]
[New Thread 0x7fffe1965640 (LWP 6589)]
[Thread 0x7ffff163e640 (LWP 6588) exited]
[Thread 0x7fffe1965640 (LWP 6589) exited]
```

After clicking on `Libravatar`:

```
Thread 1 "claws-mail" received signal SIGSEGV, Segmentation fault.
0x00007ffff6e009f6 in g_type_check_instance_cast () from /usr/lib/libgobject-2.0.so.0
```

--> `gdb` detected a segmentation fault and brought me to it's commandline.  

After entering `bt` (for "backtrace"):

```
#0  0x00007ffff6e009f6 in g_type_check_instance_cast () at /usr/lib/libgobject-2.0.so.0
#1  0x00007fffe2038908 in  () at /usr/lib/claws-mail/plugins/libravatar.so
#2  0x0000555555864ce7 in  ()
#3  0x0000555555864f53 in  ()
#4  0x00007ffff7d25f3a in  () at /usr/lib/libgtk-x11-2.0.so.0
#5  0x00007ffff7d267ce in  () at /usr/lib/libgtk-x11-2.0.so.0
#6  0x00007ffff7d3b84d in  () at /usr/lib/libgtk-x11-2.0.so.0
#7  0x00007ffff7d406ae in  () at /usr/lib/libgtk-x11-2.0.so.0
#8  0x00007ffff7c350a8 in  () at /usr/lib/libgtk-x11-2.0.so.0
#9  0x00007ffff6ddeddf in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0
#10 0x00007ffff6e079cb in  () at /usr/lib/libgobject-2.0.so.0
#11 0x00007ffff6dfb2db in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#12 0x00007ffff6dfc210 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#13 0x00007ffff7d5a275 in  () at /usr/lib/libgtk-x11-2.0.so.0
#14 0x00007ffff7c336d6 in gtk_propagate_event () at /usr/lib/libgtk-x11-2.0.so.0
#15 0x00007ffff7c33b4b in gtk_main_do_event () at /usr/lib/libgtk-x11-2.0.so.0
#16 0x00007ffff7aa23be in  () at /usr/lib/libgdk-x11-2.0.so.0
#17 0x00007ffff6ceb02c in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#18 0x00007ffff6d3eb59 in  () at /usr/lib/libglib-2.0.so.0
#19 0x00007ffff6cea593 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#20 0x00007ffff7c329fe in gtk_main () at /usr/lib/libgtk-x11-2.0.so.0
#21 0x00005555556785d5 in main ()
(gdb) 
```

After entering `cont` (for "continue"):

```
Continuing.
[Thread 0x7fffe3438640 (LWP 6587) exited]
[Detaching after fork from child process 6725]
claws.c:102:Starting Claws Mail version 3.17.8
utils.c:1726:using default rc_dir /home/felics/.claws-mail
main.c:2335:Using control socket /tmp/claws-mail-1001/d568697b15839eb53299f8a5ebacc43d
main.c:2430:another Claws Mail instance is already running.

** (process:6725): WARNING **: 15:29:24.372: Socket IO timeout

** (process:6725): WARNING **: 15:29:24.373: [2021-05-06 15:29:24] Socket IO timeout.

Claws Mail is already running on display .
[Thread 0x7fffe3c39640 (LWP 6504) exited]
[Thread 0x7ffff2640640 (LWP 6497) exited]
[Thread 0x7ffff2e41640 (LWP 6496) exited]
[Thread 0x7ffff36d3400 (LWP 6492) exited]
[Inferior 1 (process 6492) exited with code 0375]
(gdb) 
```

(note that the two lines starting with "`** (process:6725): WARNING **:`" seem not to come from `gdb`, but from some gtk-stuff. Those lines are coloured as also other gtk warning and error output on otherwise normally functioning software is coloured.)

`claws-mail` has terminated by then.

Typing `bt` again:

```
No stack.
```

---

The following `./configure`ation I used:

```
./configure --prefix=/usr
  --disable-static \
  --enable-shared \
  --enable-nls \
  --enable-manual \
  --enable-libsm \
  --enable-ipv6 \
  --enable-gnutls \
  --enable-enchant \
  --enable-crash-dialog \
  --disable-generic-umpc \
  --enable-compface \
  --enable-pthread \
  --enable-startup-notification \
  --enable-dbus \
  --enable-ldap \
  --enable-jpilot \
  --disable-networkmanager \
  --enable-libetpan \
  --disable-valgrind \
  --enable-alternate-addressbook \
  --enable-svg \
  --disable-tests \
  --enable-deprecated \
  --enable-acpi_notifier-plugin \
  --enable-address_keeper-plugin \
  --enable-archive-plugin \
  --enable-att_remover-plugin \
  --enable-attachwarner-plugin \
  --enable-bogofilter-plugin \
  --enable-bsfilter-plugin \
  --enable-clamd-plugin \
  --enable-dillo-plugin \
  --disable-fancy-plugin \
  --enable-fetchinfo-plugin \
  --enable-gdata-plugin \
  --enable-libravatar-plugin \
  --enable-litehtml_viewer-plugin \
  --enable-mailmbox-plugin \
  --enable-managesieve-plugin \
  --enable-newmail-plugin \
  --enable-notification-plugin \
  --enable-pdf_viewer-plugin \
  --enable-perl-plugin \
  --enable-python-plugin \
  --enable-pgpcore-plugin \
  --enable-pgpmime-plugin \
  --enable-pgpinline-plugin \
  --enable-rssyl-plugin \
  --enable-smime-plugin \
  --enable-spamassassin-plugin \
  --enable-spam_report-plugin \
  --enable-tnef_parse-plugin \
  --enable-vcalendar-plugin \
  --enable-demo-plugin
```
Comment 1 linux.felixbecker2 2021-05-06 15:33:01 UTC
Created attachment 2205 [details]
standard error of `claws-mail --debug`.
Comment 2 Ricardo Mones 2021-05-08 18:10:36 UTC
Can you please provide a backtrace with debugging information? (i.e., don't strip debug info from binary).

Thanks in advance!
Comment 3 linux.felixbecker2 2021-05-08 20:55:50 UTC
> Can you please provide a backtrace with debugging information? (i.e., don't strip debug info from binary).

`gdb claws-mail`

```
GNU gdb (GDB) 10.1
Copyright (C) 2020 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-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from claws-mail...
(gdb) 
```

Typing `run`:

```
Starting program: /usr/bin/claws-mail 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff2aa9640 (LWP 3707)]
[New Thread 0x7ffff22a8640 (LWP 3708)]
[New Thread 0x7ffff1aa7640 (LWP 3709)]
[New Thread 0x7ffff12a6640 (LWP 3710)]
[New Thread 0x7fffe383c640 (LWP 3727)]
[New Thread 0x7fffe303b640 (LWP 3728)]
[Thread 0x7fffe303b640 (LWP 3728) exited]
[Thread 0x7fffe383c640 (LWP 3727) exited]
[New Thread 0x7fffe383c640 (LWP 3787)]
[New Thread 0x7fffe303b640 (LWP 3788)]
[New Thread 0x7fffe283a640 (LWP 3800)]
[New Thread 0x7fffe2039640 (LWP 3802)]
[Thread 0x7fffe383c640 (LWP 3787) exited]
[Thread 0x7fffe303b640 (LWP 3788) exited]
[Thread 0x7fffe283a640 (LWP 3800) exited]
[Thread 0x7fffe2039640 (LWP 3802) exited]
[New Thread 0x7fffe2039640 (LWP 3855)]
[Detaching after fork from child process 3862]
[Detaching after fork from child process 3864]
[Detaching after fork from child process 3867]
[Detaching after fork from child process 3871]
[Detaching after fork from child process 3875]
[Thread 0x7ffff12a6640 (LWP 3710) exited]
```

Opening `Configuration` -> `Preferences`

```
[New Thread 0x7ffff12a6640 (LWP 7311)]
[New Thread 0x7fffe283a640 (LWP 7312)]
[New Thread 0x7fffe303b640 (LWP 7314)]
[Thread 0x7fffe283a640 (LWP 7312) exited]
[Thread 0x7ffff12a6640 (LWP 7311) exited]
[Thread 0x7fffe303b640 (LWP 7314) exited]
```

Klicking on `Libravatar`:

```
Thread 1 "claws-mail" received signal SIGSEGV, Segmentation fault.
0x00007ffff6df49f6 in g_type_check_instance_cast () from /usr/lib/libgobject-2.0.so.0
(gdb) 
```

Typing `bt`:

```
#0  0x00007ffff6df49f6 in g_type_check_instance_cast () at /usr/lib/libgobject-2.0.so.0
#1  0x00007fffe0fc0638 in p_create_frame_missing (page=0x7fffe0fc7820 <libravatarprefs_page>) at libravatar_prefs.c:348
#2  0x00007fffe0fc0c4a in libravatar_prefs_create_widget_func (_page=0x7fffe0fc7820 <libravatarprefs_page>, window=0x555556388b60, data=0x0)
    at libravatar_prefs.c:466
#3  0x00005555559725e2 in prefswindow_build_page (prefswindow=0x555555cfc170, page=0x7fffe0fc7820 <libravatarprefs_page>) at prefswindow.c:265
#4  0x0000555555973f5e in prefswindow_row_selected
    (selector=0x5555565a2000, model=0x5555566dd150, path=0x555556627110, currently_selected=0, data=0x555555cfc170) at prefswindow.c:683
#5  0x00007ffff7d25f3a in  () at /usr/lib/libgtk-x11-2.0.so.0
#6  0x00007ffff7d267ce in  () at /usr/lib/libgtk-x11-2.0.so.0
#7  0x00007ffff7d3b84d in  () at /usr/lib/libgtk-x11-2.0.so.0
#8  0x00007ffff7d406ae in  () at /usr/lib/libgtk-x11-2.0.so.0
#9  0x00007ffff7c350a8 in  () at /usr/lib/libgtk-x11-2.0.so.0
#10 0x00007ffff6dd2ddf in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0
#11 0x00007ffff6dfb9cb in  () at /usr/lib/libgobject-2.0.so.0
#12 0x00007ffff6def2db in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#13 0x00007ffff6df0210 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#14 0x00007ffff7d5a275 in  () at /usr/lib/libgtk-x11-2.0.so.0
#15 0x00007ffff7c336d6 in gtk_propagate_event () at /usr/lib/libgtk-x11-2.0.so.0
#16 0x00007ffff7c33b4b in gtk_main_do_event () at /usr/lib/libgtk-x11-2.0.so.0
#17 0x00007ffff7aa23be in  () at /usr/lib/libgdk-x11-2.0.so.0
#18 0x00007ffff6cdf02c in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#19 0x00007ffff6d32b59 in  () at /usr/lib/libglib-2.0.so.0
#20 0x00007ffff6cde593 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#21 0x00007ffff7c329fe in gtk_main () at /usr/lib/libgtk-x11-2.0.so.0
#22 0x00005555557219c4 in main (argc=1, argv=0x7fffffffd7e8) at main.c:1645
```

Typing `cont`:

```
Continuing.
[Detaching after fork from child process 17250]
claws.c:102:Starting Claws Mail version 3.17.8
utils.c:1726:using default rc_dir /home/felics/.claws-mail
main.c:2335:Using control socket /tmp/claws-mail-1001/d568697b15839eb53299f8a5ebacc43d
main.c:2430:another Claws Mail instance is already running.
```

(Now it freezes for tens of seconds)

```
** (process:17250): WARNING **: 20:49:51.949: Socket IO timeout

** (process:17250): WARNING **: 20:49:51.949: [2021-05-08 20:49:51] Socket IO timeout.

Claws Mail is already running on display .
[Thread 0x7ffff2aa9640 (LWP 3707) exited]
[Thread 0x7ffff1aa7640 (LWP 3709) exited]
[Thread 0x7ffff22a8640 (LWP 3708) exited]
[Thread 0x7ffff32fff40 (LWP 3640) exited]
[Inferior 1 (process 3640) exited with code 0375]
(gdb) 
```

(`claws-mail` has exited.)

Typing `bt`:

```
No stack.
```

Typing `cont`:
```
The program is not being run.
```

Note that the lines starting with `** (process:17250): WARNING **: ` are not from `gdb` but directly from `claws-mail`.

How much does this help?
Comment 4 Ricardo Mones 2021-05-16 18:03:02 UTC
Created attachment 2210 [details]
Attempt to fix this bug

Sorry for the delay, I'm awfully busy these days.

Well, it helps to show a bug that shouldn't be happening at all ;-) but since there's a long-time deprecated function in that code I'm attaching a small patch to make things go through more tested code paths.

Can you try if building with that patch improves things for you?

Thanks!
Comment 5 linux.felixbecker2 2021-05-17 10:57:32 UTC
> Can you try if building with that patch improves things for you?

Seems to work: One build with debugging information, tried to access and do the configuration three times; one build without debugging information, tried to access the configuration once. Seems to work & no strange behaviour or error messages seen.
Comment 6 Ricardo Mones 2021-05-18 01:34:43 UTC
Patch applied on commit a4a629ce824011f5ae3f0b8cb1117f9608b7f5ad.

Thanks for testing!

Note You need to log in before you can comment on or make changes to this bug.