Segfault calling OpenSSL library from Perl

Caines, Max Max.Caines at wlv.ac.uk
Mon Oct 21 17:36:35 CEST 2013


Hi

I have a Perl module that I call from FreeRadius (2.2.0), which makes calls to IO::Socket::SSL. I'm currently running this on Solaris 8 on a SPARC platform, with Perl, FreeRadius and OpenSSL all built from source, where it works fine. I'm trying to port it to Linux (Ubuntu 12.04). using the FreeRadius package from https://launchpad.net/~freeradius/+archive/stable. What I'm finding is that if run without threads enabled it's fine (initially I used -X, but I've tested with -s with the same result). If I allow threading, it crashes on the first request it receives with a segmentation fault. To do some debugging I rebuilt it using -with-developer, and used gdb to run it. This told me that the crash was in openssl_threadid_func in SSLeay.xs at line 272. Assuming that this was a problem with multiple OpenSSL versions, I forced rebuilds on IO::Socket::SSL and Net::SSLeay. I wondered about FreeRadius, but as far as I know there is only one version of OpenSSL on the system, and I left it to the configurator to find the library. 

The reference to the Perl SSLeay stub says to me that this is a conflict over OpenSSL between Perl and FreeRadius. If I omit the calls to "perl" from the FreeRadius config, all is OK. If I use the Perl module, but don't include calls the ultimately use the IO::Socket::SSL module, all is OK. I've tried a Perl test program that creates a thread and calls Net::SSLeay, and that works too, so it doesn't seem to be an inherent problem with Perl.

I've been able to fix this by configuring the FreeRadius build to omit all modules that use SSL, and using -with-openssl=no. This now works, but I'd prefer to get to the bottom of the problem. I can't of course be sure that the home-built version is crashing for the same reason as the package, but I'd settle for a fix to either!  Any thoughts on where I look next?

The Perl module, by the way, only does anything on calls to "preacct"

Thanks

Max

Max Caines | Network Design Consultant | IT Services | University of Wolverhampton | 01902 322245 | 07976 841874  | Max.Caines at wlv.ac.uk

For contact details and general information on IT Services please visit http://www.wlv.ac.uk/its This email, together with any attachment, is for the exclusive and confidential use of the addressee(s) and may contain legally privileged information. If you receive this email in error, please visit http://www.wlv.ac.uk/ITS-disclaimer . Please consider the environment before printing this e-mail.

-- 
Scanned by iCritical.


More information about the Freeradius-Users mailing list