Bug #814

swanctl crash in

Added by Noel Kuntze over 7 years ago. Updated over 7 years ago.

Target version:
Start date:
Due date:
Estimated time:
Affected version:


Hello team,

I encounter a crash (SEGFAULT) with swanctl when it is built against glibc 2.20:
The Linux distribution I use is Arch Linux. This can be reproduced on three different boxes and happens with every call of swanctl, even calling it without any options!
It only happens when you compile against glibc-2.20. it worked before with earlier versions of the glibc package.
This might be a problem with the way glibc is built on Arch at the moment (PKGVER 6).
I did not test this with older revisions of glibc (PGKVER < 6).
Also, this has not beeen an issue with earlier versions of it, as it worked before.

The reason for me setting it to priority "HIGH" is, that it prevents strongswan-swanctl.service from working at all correctly and also makes swanctl slightly unusable
for sripting at the moment because of the static exit code of 139. Also, this affects all users of Arch Linux and currently upgrading their strongSwan versions or patching them.

└──╼ swanctl -S
uptime: 10 days, since Dec 28 03:02:02 2014
worker threads: 16 total, 11 idle, working: 4/0/1/0
job queues: 0/0/0/0
jobs scheduled: 2
IKE_SAs: 1 total, 0 half-open
mallinfo: sbrk 2711552, mmap 0, used 785424, free 1926128
Speicherzugriffsfehler (Speicherabzug geschrieben)

in the journal:

Jan 07 18:39:11 vms.thermi kernel: swanctl8324: segfault at 7f2ef9e7f3c0 ip 00007f2ef9e7f3c0 sp 00007fffeac26498 error 14 in[7f2efcdc5000+b000]
Jan 07 18:39:12 vms.thermi systemd-coredump8329: Process 8324 (swanctl) of user 0 dumped core.

ltrace output is in ltrace.log. strace output is in the attached file "strace.log".
gdb bt full output is in "gdb-bt-full.log".

└──╼ pacman -Qo /usr/lib/
/usr/lib/ ist in glibc 2.20-6 enthalten

Package build stuff for my strongswan version is available at [1].
The same for glibc is at [2].


strace.log (63.6 KB) strace.log strace swanctl -S Noel Kuntze, 07.01.2015 19:05
ltrace.log (5.09 KB) ltrace.log ltrace swanctl -S Noel Kuntze, 07.01.2015 19:05
gdb-bt-full.log (3.17 KB) gdb-bt-full.log Noel Kuntze, 07.01.2015 19:06

Associated revisions

Revision 48281014 (diff)
Added by Tobias Brunner over 7 years ago

configure: Load SQL backends after crypto plugins

If the MySQL client library is linked against OpenSSL the mysql plugin
will cause a segmentation fault when it is unloaded after the openssl
plugin has already been deinitialized. This is very similar to the issues
with curl (see 44b6a34d438f).

Fixes #814.


#1 Updated by Tobias Brunner over 7 years ago

  • Status changed from New to Feedback
  • Assignee set to Tobias Brunner

From the backtrace it looks like a problem with the mysql plugin. Because libmysqlclient is linked against OpenSSL on Arch and the openssl plugin is loaded by swanctl there seems to be a race when deinitializing the plugins and libraries (a similar issue occurs with the curl and openssl plugins when libcurl is linked against OpenSSL).

You might be able to work around this by moving the mysql plugin after the openssl plugin in the load order for swanctl (if that works we can do this by patching, similar to 44b6a34d43).

#2 Updated by Noel Kuntze over 7 years ago

Using the work around prevents the crash from happening. Solution aknowledged.

#3 Updated by Tobias Brunner over 7 years ago

  • Tracker changed from Issue to Bug
  • Status changed from Feedback to Closed
  • Priority changed from High to Normal
  • Target version set to 5.3.0
  • Resolution set to Fixed

Fixed with the associated commit.

Also available in: Atom PDF