Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 522412

Summary: net-ftp/vsftpd with sys-auth/pam_mysql - libgcc_s.so.1 must be installed for pthread_cancel to work
Product: Gentoo Linux Reporter: Harald Glatt (hachre) <bugzilla-gentoo>
Component: [OLD] ServerAssignee: Markos Chandras (RETIRED) <hwoarang>
Status: RESOLVED FIXED    
Severity: normal CC: bugs, net-ftp, proxy-maint, wired
Priority: Normal Keywords: InVCS, PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugzilla.redhat.com/show_bug.cgi?id=913519
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Patch to the original source defs.h file
Actual required patch to the original defs.h file

Description Harald Glatt (hachre) 2014-09-09 01:35:58 UTC
This is essentially a duplicate of the following RedHat Bug, but it also affects vsftpd in Gentoo:
https://bugzilla.redhat.com/show_bug.cgi?id=913519

Essentially if you are using pam_mysql for vsftpd you can run into a problem where vsftpd will no longer allow users to log in and instead return the following message and then crash: 
"libgcc_s.so.1 must be installed for pthread_cancel to work"

dmesg will then output a message like this:
traps: vsftpd[2423] general protection ip:7fa678a8ec87 sp:7fa676fcdc60 error:0 in libc-2.19.so[7fa678a55000+19d000]

After a long search through Google I found the RedHat bug linked above which fixes the problem for me.

The solution is to edit the upstream source file defs.h and change the following line:
#define VSFTP_AS_LIMIT          100UL * 1024 * 1024

To something a lot higher, at least:
#define VSFTP_AS_LIMIT          400UL * 1024 * 1024

This seems to only happen on x64.

It would be great if this change could be integrated as a patch into the Gentoo ebuild for vsftpd.

Thanks!
Comment 1 Harald Glatt (hachre) 2014-09-09 01:39:16 UTC
CCing the owner of the ebuild.
Comment 2 Markos Chandras (RETIRED) gentoo-dev 2014-09-13 09:54:44 UTC
Can you write a patch please? I am wondering if this affects the regular pam_unix logins.
Comment 3 Harald Glatt (hachre) 2014-09-13 10:12:23 UTC
Created attachment 384660 [details, diff]
Patch to the original source defs.h file

I have attached the required patch to the original defs.h file.
Comment 4 Harald Glatt (hachre) 2014-09-13 10:14:01 UTC
Created attachment 384662 [details, diff]
Actual required patch to the original defs.h file

Sorry I uploaded the other one gzipped.
Comment 5 Markos Chandras (RETIRED) gentoo-dev 2014-09-14 10:41:36 UTC
Thanks I will have a look. I need to study the source code and see how this macro affects things plus verify that it does not break existing pam_unix logins.
Comment 6 Markos Chandras (RETIRED) gentoo-dev 2014-09-14 11:05:07 UTC
Thanks fixed in -r3

+*vsftpd-3.0.2-r3 (14 Sep 2014)
+
+  14 Sep 2014; Markos Chandras <hwoarang@gentoo.org>
+  +files/vsftpd-3.0.2-aslim.patch, +vsftpd-3.0.2-r3.ebuild:
+  Increase VSFTP_AS_LIMIT macro to fix logins with pam_mysql. Bug #522412. Patch
+  by Harald Glatt (hachre) <bugzilla-gentoo@mail.hachre.de>
+
Comment 7 Harald Glatt (hachre) 2014-09-14 11:17:27 UTC
Thanks!