While setting up freeradius recently, we noticed that it would segfault on a restart after being used. The segfault line would be something like: kernel: radiusd[2608]: segfault at 7feb7471f480 ip 00007feb7471f480 sp 00007fff451ea168 error 14 in libfreeradius-eap-2.1.12.so[7feb74d2b000+9000] At first I thought this would be something in the eap module, but after building a debug build and running it in gdb I got this backtrace: Program received signal SIGSEGV, Segmentation fault. 0x00007ffff3e0f480 in ?? () (gdb) bt #0 0x00007ffff3e0f480 in ?? () #1 0x00007ffff71d9dea in ?? () from /usr/lib64/libcrypto.so.1.0.0 #2 0x00007ffff755a12d in SSL_free () from /usr/lib64/libssl.so.1.0.0 #3 0x00007ffff548b1da in ?? () from /usr/lib64/libldap_r-2.4.so.2 #4 0x00007ffff524df59 in ber_sockbuf_remove_io () from /usr/lib64/liblber-2.4.so.2 #5 0x00007ffff524dfed in ber_int_sb_destroy () from /usr/lib64/liblber-2.4.so.2 #6 0x00007ffff524e06c in ber_sockbuf_free () from /usr/lib64/liblber-2.4.so.2 #7 0x00007ffff546fb2c in ldap_ld_free () from /usr/lib64/libldap_r-2.4.so.2 #8 0x00007ffff56a50c0 in ldap_detach (instance=<value optimized out>) at rlm_ldap.c:2588 #9 0x00000000004186ce in module_instance_free (data=<value optimized out>) at modules.c:380 #10 0x00007ffff7bcee4d in FreeWalker (tree=0x796a50, X=0x799670) at rbtree.c:63 #11 0x00007ffff7bcee8e in rbtree_free (tree=0x9b14c0) at rbtree.c:74 #12 0x0000000000419450 in detach_modules () at modules.c:428 #13 0x000000000041d13c in main (argc=<value optimized out>, argv=<value optimized out>) at radiusd.c:456 After seeing that it looks like it's actually the ldap module causing problems, I commented out all of my bits that use the ldap module and it doesn't segfault on shutdown. I also tried it with ldap but without TLS enabled and it shut down clean still. Has anyone seen this before? Any solutions? For the time being, I guess I'll run the ldap module without TLS enabled. Segfaults, even benign ones, seem to get everyone antsy...