Bug 706322

Summary: [abrt] claws-mail-3.7.9-2.fc14: clamd_create_config_automatic: Process /usr/bin/claws-mail was killed by signal 11 (SIGSEGV)
Product: [Fedora] Fedora Reporter: Neil Underwood <n.underwood78>
Component: claws-mailAssignee: Andreas Bierfert <andreas.bierfert>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 14CC: andreas.bierfert, bugs.michael, tomspur
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: All   
OS: Unspecified   
URL: http://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id=2434
Whiteboard: abrt_hash:b1154aeed0e2ccb6c537c76bccd8968a32a9c3bc
Fixed In Version: claws-mail-plugins-3.7.9-3.fc15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-21 17:06:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
File: backtrace none

Description Neil Underwood 2011-05-20 05:45:30 UTC
abrt version: 1.1.18
architecture: x86_64
Attached file: backtrace, 50723 bytes
cmdline: /usr/bin/claws-mail
comment: Opened claws-mail, selected Preferences->Plugins->ClamAV.  Claws-mail briefly froze then crashed before ClamAV options even appeared.
component: claws-mail
Attached file: coredump, 86376448 bytes
crash_function: clamd_create_config_automatic
executable: /usr/bin/claws-mail
kernel: 2.6.35.13-91.fc14.x86_64
package: claws-mail-3.7.9-2.fc14
rating: 4
reason: Process /usr/bin/claws-mail was killed by signal 11 (SIGSEGV)
release: Fedora release 14 (Laughlin)
time: 1305870118
uid: 500

How to reproduce
-----
1. Open claws-mail
2. Select Preferences->ClamAV
3. Watch it crash

Comment 1 Neil Underwood 2011-05-20 05:45:32 UTC
Created attachment 499998 [details]
File: backtrace

Comment 2 Michael Schwendt 2011-05-20 08:31:32 UTC
#0  0x00007f3ed05a7627 in clamd_create_config_automatic (path=0x24be280 "/etc/clamd.conf") at clamd-plugin.c:213

   211          }
   212          fclose(conf);
   213          if (! Socket && (Socket->socket.port || Socket->socket.path)) {
   214                  /*g_error("%s: Not able to find required information", path);*/
   215                  alertpanel_error(_("%s: Not able to find required information\nclamd will be disabled"), path);
   216          }


The if-expression is questionable. It should check whether

  !Socket || (!Socket->socket.port && !Socket->socket.path)

(i.e. whether the Socket is not NULL  or whether neither port and path are set), which can be converted into

  ! (Socket && (Socket->socket.port || Socket->socket.path))

and requires extra brackets due to operator precedence. Or else it would dereference a NULL Socket ptr.

Comment 3 Neil Underwood 2011-05-20 08:43:05 UTC
I should add I had the ClamAV plugin loaded, but clamd was not running.  Therefore -> socket = NULL I'm assuming.

Comment 4 Michael Schwendt 2011-05-20 09:28:57 UTC
"Socket" here is just a pointer to a memory structure. The code allocates that memory depending on what options it finds in /etc/clamd.conf. In your case, I assume, it didn't find the options it searched for, and with a fixed if-expression would have shown the quoted error

  Not able to find required information
  clamd will be disabled

instead of crashing.

Comment 5 Fedora Update System 2011-05-20 18:18:32 UTC
claws-mail-plugins-3.7.9-3.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/claws-mail-plugins-3.7.9-3.fc14

Comment 6 Fedora Update System 2011-05-20 18:18:41 UTC
claws-mail-plugins-3.7.9-3.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/claws-mail-plugins-3.7.9-3.fc15

Comment 7 Fedora Update System 2011-05-25 03:08:42 UTC
Package claws-mail-plugins-3.7.9-3.fc14:
* should fix your issue,
* was pushed to the Fedora 14 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing claws-mail-plugins-3.7.9-3.fc14'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/claws-mail-plugins-3.7.9-3.fc14
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2011-06-21 17:06:44 UTC
claws-mail-plugins-3.7.9-3.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2011-06-21 17:13:38 UTC
claws-mail-plugins-3.7.9-3.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.