On Tue, 2007-05-15 at 16:51 +0200, Alan Dekok wrote:
Maybe adding a call to ERR_clear_error() in rlm_eap_tls.c, function init_tls_ctx(), after the call to SSL_CTX_new() ?
Okay, getting very weird! I made the change and started Freeradius (from /etc/init.d). I could repeatedly HUP the daemon, and it would stay running according to 'ps'. However, the log file only showed one line for the first HUP and nothing at all after that. The line it showed was: Tue May 15 16:48:01 2007 : Info: Reloading configuration files. If I made a change to the 'users' file, HUP'd the daemon and then tried to run radtest, the daemon died. Nothing new in the log file. If I ran strace on the daemon it showed: ====================================================== open("/etc/raddb/users", O_RDONLY) = 6 fstat64(6, {st_mode=S_IFREG|0600, st_size=7146, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f88000 read(6, "#\n# RADIUS users authentication "..., 4096) = 4096 read(6, " Yes\n\nm3cooper Service-Ty"..., 4096) = 3050 read(6, "", 4096) = 0 read(6, "", 4096) = 0 close(6) = 0 munmap(0xb7f88000, 4096) = 0 open("/etc/raddb/acct_users", O_RDONLY) = 6 fstat64(6, {st_mode=S_IFREG|0640, st_size=422, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f88000 read(6, "#\n#\t$Id: acct_users,v 1.4 2003/0"..., 4096) = 422 read(6, "", 4096) = 0 close(6) = 0 munmap(0xb7f88000, 4096) = 0 open("/etc/raddb/preproxy_users", O_RDONLY) = 6 fstat64(6, {st_mode=S_IFREG|0640, st_size=1039, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f88000 read(6, "#\n# Configuration file for the "..., 4096) = 1039 read(6, "", 4096) = 0 close(6) = 0 munmap(0xb7f88000, 4096) = 0 time(NULL) = 1179244215 write(1, "Tue May 15 16:50:15 2007 : Info:"..., 60) = 60 select(6, [3 4 5], NULL, NULL, NULL) = 1 (in [3]) time(NULL) = 1179244231 recvfrom(3, "\1}\0:5\253\236\200S\237\35\371\330\302;\314\316\275 \36"..., 4096, 0, {sa_family=AF_INET, sin_port=htons(33773), sin_addr=inet_addr("127.0.0.1")}, [16]) = 58 time(NULL) = 1179244231 futex(0x73186c, FUTEX_WAKE, 1) = 1 rt_sigaction(SIGTERM, {SIG_IGN}, {0x714a00, [], 0}, 8) = 0 kill(-11002, SIGTERM) = 0 --- SIGTERM (Terminated) @ 0 (0) --- munmap(0x332000, 13584) = 0 munmap(0x55b000, 8936) = 0 munmap(0x549000, 4588) = 0 munmap(0x32f000, 11176) = 0 munmap(0x382000, 10888) = 0 munmap(0x32c000, 11480) = 0 munmap(0x1e2000, 21296) = 0 munmap(0x68c000, 24120) = 0 munmap(0x5e2000, 16096) = 0 munmap(0x922000, 4540) = 0 munmap(0x933000, 9212) = 0 unlink(NULL) = -1 EFAULT (Bad address) time(NULL) = 1179244232 write(1, "Tue May 15 16:50:32 2007 : Error"..., 71) = 71 rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0 tgkill(11002, 11002, SIGABRT) = 0 --- SIGABRT (Aborted) @ 0 (0) --- Process 11002 detached ====================================================== As can be seen it is reading through the .conf files. I don't know whether it is strace that caused the initial SIGTERM or not. If I start radiusd using '/usr/sbin/radiusd -X', then I can see each HUP causes the config files to be read. Radiusd shows at each HUP: ======================================================= Tue May 15 17:02:46 2007 : Info: Reloading configuration files. Tue May 15 17:02:46 2007 : Info: Using deprecated naslist file. Support for this will go away soon. Tue May 15 17:02:46 2007 : Info: rlm_exec: Wait=yes but no output defined. Did you mean output=none? Tue May 15 17:02:46 2007 : Error: radiusd.conf[228] Auth-Type PAP already configured - skipping Tue May 15 17:02:46 2007 : Error: radiusd.conf[232] Auth-Type MS-CHAP already configured - skipping Tue May 15 17:02:46 2007 : Info: rlm_eap_tls: Loading the certificate file as a chain Tue May 15 17:02:46 2007 : Info: radiusd.conf Auth-Type eap already configured - skipping Tue May 15 17:02:46 2007 : Info: Ready to process requests. ======================================================= However, trying to then use radtest causes a segfault. No core file, although I have set 'allow_core_dumps'. Running an strace of the 'radiusd -X' process shows: ======================================================= open("/etc/raddb/preproxy_users", O_RDONLY) = 6 fstat64(6, {st_mode=S_IFREG|0640, st_size=1039, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fb9000 read(6, "#\n# Configuration file for the "..., 4096) = 1039 read(6, "", 4096) = 0 close(6) = 0 munmap(0xb7fb9000, 4096) = 0 time(NULL) = 1179245444 write(1, "Tue May 15 17:10:44 2007 : Info:"..., 60) = 60 select(6, [3 4 5], NULL, NULL, NULL) = 1 (in [3]) time(NULL) = 1179245461 recvfrom(3, "\1K\0:\252Q\210\212\302\363?k\354\223z\347\20\376s\265"..., 4096, 0, {sa_family=AF_INET, sin_port=htons(33774), sin_addr=inet_addr("127.0.0.1")}, [16]) = 58 time(NULL) = 1179245461 --- SIGSEGV (Segmentation fault) @ 0 (0) --- Process 18850 detached ======================================================= John. -- --------------------------------------------------------------- John Horne, University of Plymouth, UK Tel: +44 (0)1752 233914 E-mail: John.Horne@plymouth.ac.uk Fax: +44 (0)1752 233839