Project

General

Profile

Bug #814

swanctl crash in libnss_files-2.20.so

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

Status:
Closed
Priority:
Normal
Category:
-
Target version:
Start date:
07.01.2015
Due date:
Estimated time:
Affected version:
5.2.2
Resolution:
Fixed

Description

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.

┌─[root][vms][~]
└──╼ 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 libnss_files-2.20.so[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".

┌─[root][vms][/etc/quagga]
└──╼ pacman -Qo /usr/lib/libnss_files-2.20.so
/usr/lib/libnss_files-2.20.so 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].

[1] https://aur.archlinux.org/packages/st/strongswan-thermi/PKGBUILD
[2] https://projects.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/glibc

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 5 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.

History

#1 Updated by Tobias Brunner over 5 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 configure.ac, similar to 44b6a34d43).

#2 Updated by Noel Kuntze over 5 years ago

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

#3 Updated by Tobias Brunner over 5 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