-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[defect]: Segmentation fault with check_client_connections #5480
Comments
Please try the latest code in the v3.2.x branch. I've pushed a number of changes which should fix it. There's also tests for it in |
Thanks! (0) (TLS) RADIUS/TLS - recv TLS 1.3 Handshake, Finished
Thread 3 got semaphore
Thread 3 handling request 2869, (575 handled so far)
(2869) (TLS) Checking connection to see if it is authorized.
(2869) # Executing group from file /usr/local/etc/raddb/sites-enabled/default
(2869) Autz-Type New-TLS-Connection {
(2869) [ok] = ok
(2869) } # Autz-Type New-TLS-Connection = ok
(2869) (TLS) Connection is authorized
(0) (TLS) We already have 14 bytes of application data, processing it.
(2869) Sent Access-Accept Id 0 from 0.0.0.0:2083 to 192.168.97.2:60936 length 38
radiusd: pthread_mutex_lock.c:94: ___pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed.
(0) (TLS) RADIUS/TLS - send TLS 1.3 Handshake, Finished
Aborted (core dumped) backtrace: (gdb) info threads
Id Target Id Frame
* 1 Thread 0xffff8ab02440 (LWP 49) __pthread_kill_implementation (threadid=281473008542784, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
2 Thread 0xffff85935100 (LWP 55) __futex_abstimed_wait_common64 (private=<optimized out>, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0xaaaad68ef4a0 <thread_pool+176>) at ./nptl/futex-internal.c:57
3 Thread 0xffff86145100 (LWP 54) __futex_abstimed_wait_common64 (private=<optimized out>, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0xaaaad68ef4a0 <thread_pool+176>) at ./nptl/futex-internal.c:57
4 Thread 0xffff87165100 (LWP 52) __futex_abstimed_wait_common64 (private=<optimized out>, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0xaaaad68ef4a0 <thread_pool+176>) at ./nptl/futex-internal.c:57
5 Thread 0xffff86955100 (LWP 53) __GI___libc_write (nbytes=60, buf=0xaaab1f3a5e60, fd=<optimized out>) at ../sysdeps/unix/sysv/linux/write.c:26
6 Thread 0xffff87975100 (LWP 51) __futex_abstimed_wait_common64 (private=<optimized out>, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0xaaaad68ef4a0 <thread_pool+176>) at ./nptl/futex-internal.c:57 (gdb) thread apply all bt full
Thread 6 (Thread 0xffff87975100 (LWP 51)):
#0 __futex_abstimed_wait_common64 (private=<optimized out>, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0xaaaad68ef4a0 <thread_pool+176>) at ./nptl/futex-internal.c:57
_x3tmp = 0
_x0tmp = 187650720855200
_x0 = 187650720855200
_x3 = 0
_x4tmp = 0
_x1tmp = <optimized out>
_x1 = 393
_x4 = 0
_x5tmp = 4294967295
_x2tmp = 0
_x2 = 0
_x5 = 4294967295
_x8 = 98
_sys_result = <optimized out>
sc_cancel_oldtype = 0
sc_ret = <optimized out>
_sys_result = <optimized out>
_x5tmp = <optimized out>
_x4tmp = <optimized out>
_x3tmp = <optimized out>
_x2tmp = <optimized out>
_x1tmp = <optimized out>
_x0tmp = <optimized out>
_x0 = <optimized out>
_x1 = <optimized out>
_x2 = <optimized out>
_x3 = <optimized out>
_x4 = <optimized out>
_x5 = <optimized out>
_x8 = <optimized out>
#1 __futex_abstimed_wait_common (cancel=true, private=<optimized out>, abstime=0x0, clockid=0, expected=0, futex_word=0xaaaad68ef4a0 <thread_pool+176>) at ./nptl/futex-internal.c:87
err = <optimized out>
clockbit = 256
op = 393
err = <optimized out>
clockbit = <optimized out>
op = <optimized out>
#2 __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0xaaaad68ef4a0 <thread_pool+176>, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=<optimized out>) at ./nptl/futex-internal.c:139
No locals.
#3 0x0000ffff8a3f59a4 in do_futex_wait (sem=sem@entry=0xaaaad68ef4a0 <thread_pool+176>, abstime=0x0, clockid=0) at ./nptl/sem_waitcommon.c:111
err = <optimized out>
#4 0x0000ffff8a3f5a5c in __new_sem_wait_slow64 (sem=0xaaaad68ef4a0 <thread_pool+176>, abstime=0x0, clockid=0) at ./nptl/sem_waitcommon.c:183
_buffer = {__routine = 0xffff8a3f5970 <__sem_wait_cleanup>, __arg = 0xaaaad68ef4a0 <thread_pool+176>, __canceltype = -695700908, __prev = 0x0}
err = <optimized out>
d = 17179869184
#5 0x0000aaaad6887254 in request_handler_thread (arg=0xaaab16a615b0) at src/main/threads.c:741
self = 0xaaab16a615b0
#6 0x0000ffff8a3ed5c8 in start_thread (arg=0x0) at ./nptl/pthread_create.c:442
ret = <optimized out>
pd = 0x0
out = <optimized out>
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {281472956584192, 281474722413232, 281474722413230, 8448320, 281474722413231, 0, 281472948133888, 8448320, 281473008542784, 281472948133888, 281472956581920, 4139586479708792988, 0, 4139586479668393120, 0, 0, 0, 0, 0, 0, 0, 0}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call = 0
#7 0x0000ffff8a455edc in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:79
No locals.
Thread 5 (Thread 0xffff86955100 (LWP 53)):
#0 __GI___libc_write (nbytes=60, buf=0xaaab1f3a5e60, fd=<optimized out>) at ../sysdeps/unix/sysv/linux/write.c:26
_x2tmp = 60
_x0tmp = <optimized out>
_x0 = 60
_x2 = 60
_x8 = 64
_x1tmp = 187651940048480
_x1 = 187651940048480
_sys_result = <optimized out>
sc_ret = <optimized out>
sc_cancel_oldtype = 0
_x0tmp = <optimized out>
_x0 = <optimized out>
sc_ret = <optimized out>
sc_ret = <optimized out>
_sys_result = <optimized out>
_x1tmp = <optimized out>
_x1 = <optimized out>
_x2tmp = <optimized out>
_x2 = <optimized out>
_x8 = <optimized out>
#1 __GI___libc_write (fd=<optimized out>, buf=0xaaab1f3a5e60, nbytes=60) at ../sysdeps/unix/sysv/linux/write.c:24
No locals.
#2 0x0000aaaad68af608 in tls_socket_write (listener=0xaaab195e5180) at src/main/tls_listen.c:112
rcode = 6637240131620415231
sock = 0xaaab195e5350
#3 0x0000aaaad68b1e80 in dual_tls_send (listener=0xaaab195e5180, request=0xaaab1968ffc0) at src/main/tls_listen.c:1045
sock = 0xaaab195e5350
#4 0x0000aaaad688c54c in request_finish (request=0xaaab1968ffc0, action=1) at src/main/process.c:1645
vp = 0x0
#5 0x0000aaaad688c91c in request_running (request=0xaaab1968ffc0, action=1) at src/main/process.c:1774
rcode = 0
__FUNCTION__ = "request_running"
#6 0x0000aaaad68873cc in request_handler_thread (arg=0xaaab16a61690) at src/main/threads.c:812
self = 0xaaab16a61690
#7 0x0000ffff8a3ed5c8 in start_thread (arg=0x0) at ./nptl/pthread_create.c:442
ret = <optimized out>
pd = 0x0
out = <optimized out>
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {281472939675904, 281474722413232, 281474722413230, 8448320, 281474722413231, 0, 281472931225600, 8448320, 281473008542784, 281472931225600, 281472939673632, 4139586479708792988, 0, 4139586479651746976, 0, 0, 0, 0, 0, 0, 0, 0}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call = 0
#8 0x0000ffff8a455edc in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:79
No locals.
Thread 4 (Thread 0xffff87165100 (LWP 52)):
#0 __futex_abstimed_wait_common64 (private=<optimized out>, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0xaaaad68ef4a0 <thread_pool+176>) at ./nptl/futex-internal.c:57
_x3tmp = 0
_x0tmp = 187650720855200
_x0 = 187650720855200
_x3 = 0
_x4tmp = 0
_x1tmp = <optimized out>
_x1 = 393
_x4 = 0
_x5tmp = 4294967295
_x2tmp = 0
_x2 = 0
_x5 = 4294967295
_x8 = 98
_sys_result = <optimized out>
sc_cancel_oldtype = 0
sc_ret = <optimized out>
_sys_result = <optimized out>
_x5tmp = <optimized out>
_x4tmp = <optimized out>
_x3tmp = <optimized out>
_x2tmp = <optimized out>
_x1tmp = <optimized out>
_x0tmp = <optimized out>
_x0 = <optimized out>
_x1 = <optimized out>
_x2 = <optimized out>
_x3 = <optimized out>
_x4 = <optimized out>
_x5 = <optimized out>
_x8 = <optimized out>
#1 __futex_abstimed_wait_common (cancel=true, private=<optimized out>, abstime=0x0, clockid=0, expected=0, futex_word=0xaaaad68ef4a0 <thread_pool+176>) at ./nptl/futex-internal.c:87
err = <optimized out>
clockbit = 256
op = 393
err = <optimized out>
clockbit = <optimized out>
op = <optimized out>
#2 __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0xaaaad68ef4a0 <thread_pool+176>, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=<optimized out>) at ./nptl/futex-internal.c:139
No locals.
#3 0x0000ffff8a3f59a4 in do_futex_wait (sem=sem@entry=0xaaaad68ef4a0 <thread_pool+176>, abstime=0x0, clockid=0) at ./nptl/sem_waitcommon.c:111
err = <optimized out>
#4 0x0000ffff8a3f5a5c in __new_sem_wait_slow64 (sem=0xaaaad68ef4a0 <thread_pool+176>, abstime=0x0, clockid=0) at ./nptl/sem_waitcommon.c:183
_buffer = {__routine = 0xffff8a3f5970 <__sem_wait_cleanup>, __arg = 0xaaaad68ef4a0 <thread_pool+176>, __canceltype = -695700908, __prev = 0x0}
err = <optimized out>
d = 17179869184
#5 0x0000aaaad6887254 in request_handler_thread (arg=0xaaab16a60bc0) at src/main/threads.c:741
self = 0xaaab16a60bc0
#6 0x0000ffff8a3ed5c8 in start_thread (arg=0x0) at ./nptl/pthread_create.c:442
ret = <optimized out>
pd = 0x0
out = <optimized out>
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {281472948130048, 281474722413232, 281474722413230, 8448320, 281474722413231, 0, 281472939679744, 8448320, 281473008542784, 281472939679744, 281472948127776, 4139586479708792988, 0, 4139586479660070048, 0, 0, 0, 0, 0, 0, 0, 0}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call = 0
#7 0x0000ffff8a455edc in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:79
No locals.
Thread 3 (Thread 0xffff86145100 (LWP 54)):
#0 __futex_abstimed_wait_common64 (private=<optimized out>, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0xaaaad68ef4a0 <thread_pool+176>) at ./nptl/futex-internal.c:57
_x3tmp = 0
_x0tmp = 187650720855200
_x0 = 187650720855200
_x3 = 0
_x4tmp = 0
_x1tmp = <optimized out>
_x1 = 393
_x4 = 0
_x5tmp = 4294967295
_x2tmp = 0
_x2 = 0
_x5 = 4294967295
_x8 = 98
_sys_result = <optimized out>
sc_cancel_oldtype = 0
sc_ret = <optimized out>
_sys_result = <optimized out>
_x5tmp = <optimized out>
_x4tmp = <optimized out>
_x3tmp = <optimized out>
_x2tmp = <optimized out>
_x1tmp = <optimized out>
_x0tmp = <optimized out>
_x0 = <optimized out>
_x1 = <optimized out>
_x2 = <optimized out>
_x3 = <optimized out>
_x4 = <optimized out>
_x5 = <optimized out>
_x8 = <optimized out>
#1 __futex_abstimed_wait_common (cancel=true, private=<optimized out>, abstime=0x0, clockid=0, expected=0, futex_word=0xaaaad68ef4a0 <thread_pool+176>) at ./nptl/futex-internal.c:87
err = <optimized out>
clockbit = 256
op = 393
err = <optimized out>
clockbit = <optimized out>
op = <optimized out>
#2 __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0xaaaad68ef4a0 <thread_pool+176>, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=<optimized out>) at ./nptl/futex-internal.c:139
No locals.
#3 0x0000ffff8a3f59a4 in do_futex_wait (sem=sem@entry=0xaaaad68ef4a0 <thread_pool+176>, abstime=0x0, clockid=0) at ./nptl/sem_waitcommon.c:111
err = <optimized out>
#4 0x0000ffff8a3f5a5c in __new_sem_wait_slow64 (sem=0xaaaad68ef4a0 <thread_pool+176>, abstime=0x0, clockid=0) at ./nptl/sem_waitcommon.c:183
_buffer = {__routine = 0xffff8a3f5970 <__sem_wait_cleanup>, __arg = 0xaaaad68ef4a0 <thread_pool+176>, __canceltype = -695700908, __prev = 0x0}
err = <optimized out>
d = 17179869184
#5 0x0000aaaad6887254 in request_handler_thread (arg=0xaaab16a61440) at src/main/threads.c:741
self = 0xaaab16a61440
#6 0x0000ffff8a3ed5c8 in start_thread (arg=0x0) at ./nptl/pthread_create.c:442
ret = <optimized out>
pd = 0x0
out = <optimized out>
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {281472931221760, 281474722413232, 281474722413230, 8448320, 281474722413231, 0, 281472922771456, 8448320, 281473008542784, 281472922771456, 281472931219488, 4139586479708792988, 0, 4139586479643423904, 0, 0, 0, 0, 0, 0, 0, 0}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call = 0
#7 0x0000ffff8a455edc in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:79
No locals.
Thread 2 (Thread 0xffff85935100 (LWP 55)):
#0 __futex_abstimed_wait_common64 (private=<optimized out>, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0xaaaad68ef4a0 <thread_pool+176>) at ./nptl/futex-internal.c:57
_x3tmp = 0
_x0tmp = 187650720855200
_x0 = 187650720855200
_x3 = 0
_x4tmp = 0
_x1tmp = <optimized out>
_x1 = 393
_x4 = 0
_x5tmp = 4294967295
_x2tmp = 0
_x2 = 0
_x5 = 4294967295
_x8 = 98
_sys_result = <optimized out>
sc_cancel_oldtype = 0
sc_ret = <optimized out>
_sys_result = <optimized out>
_x5tmp = <optimized out>
_x4tmp = <optimized out>
_x3tmp = <optimized out>
_x2tmp = <optimized out>
_x1tmp = <optimized out>
_x0tmp = <optimized out>
_x0 = <optimized out>
_x1 = <optimized out>
_x2 = <optimized out>
_x3 = <optimized out>
_x4 = <optimized out>
_x5 = <optimized out>
_x8 = <optimized out>
#1 __futex_abstimed_wait_common (cancel=true, private=<optimized out>, abstime=0x0, clockid=0, expected=0, futex_word=0xaaaad68ef4a0 <thread_pool+176>) at ./nptl/futex-internal.c:87
err = <optimized out>
clockbit = 256
op = 393
err = <optimized out>
clockbit = <optimized out>
op = <optimized out>
#2 __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0xaaaad68ef4a0 <thread_pool+176>, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=<optimized out>) at ./nptl/futex-internal.c:139
No locals.
#3 0x0000ffff8a3f59a4 in do_futex_wait (sem=sem@entry=0xaaaad68ef4a0 <thread_pool+176>, abstime=0x0, clockid=0) at ./nptl/sem_waitcommon.c:111
err = <optimized out>
#4 0x0000ffff8a3f5a5c in __new_sem_wait_slow64 (sem=0xaaaad68ef4a0 <thread_pool+176>, abstime=0x0, clockid=0) at ./nptl/sem_waitcommon.c:183
_buffer = {__routine = 0xffff8a3f5970 <__sem_wait_cleanup>, __arg = 0xaaaad68ef4a0 <thread_pool+176>, __canceltype = -695700908, __prev = 0x0}
err = <optimized out>
d = 17179869184
#5 0x0000aaaad6887254 in request_handler_thread (arg=0xaaab16a60b20) at src/main/threads.c:741
self = 0xaaab16a60b20
#6 0x0000ffff8a3ed5c8 in start_thread (arg=0x0) at ./nptl/pthread_create.c:442
ret = <optimized out>
pd = 0x0
out = <optimized out>
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {281472922767616, 281474722413232, 281474722413230, 8448320, 281474722413231, 0, 281472914317312, 8448320, 281473008542784, 281472914317312, 281472922765344, 4139586479708792988, 0, 4139586479701685408, 0, 0, 0, 0, 0, 0, 0, 0}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call = 0
#7 0x0000ffff8a455edc in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:79
No locals.
Thread 1 (Thread 0xffff8ab02440 (LWP 49)):
#0 __pthread_kill_implementation (threadid=281473008542784, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
tid = 49
ret = 0
pd = 0xffff8ab02440
old_mask = {__val = {281473000843404, 281474722412000, 281473001031028, 281473002292472, 281474722412112, 281473001995304, 0, 281473001974448, 281473002283008, 281474722412368, 281474722412368, 281474722412320, 18446743528248704976, 42975585592, 281473001995304, 0}}
ret = <optimized out>
#1 0x0000ffff8a3ef254 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
No locals.
#2 0x0000ffff8a3aa67c in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
ret = <optimized out>
#3 0x0000ffff8a397130 in __GI_abort () at ./stdlib/abort.c:79
save_stage = 1
act = {__sigaction_handler = {sa_handler = 0xffff8a4beab0, sa_sigaction = 0xffff8a4beab0}, sa_mask = {__val = {281473002283008, 0, 281474722414248, 4222124650659840, 17298308644996116495, 17298308644996116495, 17298308644996116495, 281474722412320, 281473001033328, 281473002292472, 15575427602093527808, 281474722412384, 281473000816588, 281473008758784, 281473001964880, 281473001974256}}, sa_flags = -1974745776, sa_restorer = 0xffff8a4be9f0}
sigs = {__val = {32, 18446743528248704976, 281474722412384, 281473000816448, 281474722412368, 281474722412368, 281474722412320, 18446743528248704976, 2987131702627757358, 281474722412368, 281474722412304, 281473001184388, 281473008544768, 64, 0, 94}}
#4 0x0000ffff8a3a3fd0 in __assert_fail_base (fmt=0xffff8a4bc550 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0xffff8a4beab0 "mutex->__data.__owner == 0", file=file@entry=0xffff8a4be9f0 "pthread_mutex_lock.c", line=line@entry=94, function=function@entry=0xffff8a4bec38 <__PRETTY_FUNCTION__.0> "___pthread_mutex_lock") at ./assert/assert.c:92
str = 0xaaab17acf8c0 "\317z\261\252\n"
total = 4096
#5 0x0000ffff8a3a4040 in __GI___assert_fail (assertion=0xffff8a4beab0 "mutex->__data.__owner == 0", file=0xffff8a4be9f0 "pthread_mutex_lock.c", line=94, function=0xffff8a4bec38 <__PRETTY_FUNCTION__.0> "___pthread_mutex_lock") at ./assert/assert.c:101
No locals.
#6 0x0000ffff8a3f08a8 in ___pthread_mutex_lock (mutex=0xaaab195e5478) at ./nptl/pthread_mutex_lock.c:94
type = <optimized out>
__PRETTY_FUNCTION__ = "___pthread_mutex_lock"
id = <optimized out>
#7 0x0000aaaad68b06a4 in tls_socket_recv (listener=0xaaab195e5180) at src/main/tls_listen.c:495
doing_init = false
already_read = false
rcode = 281474722412848
data_len = 187650720602212
packet = 0x3b
request = 0xaaab195e5ad0
sock = 0xaaab195e5350
status = 43691
#8 0x0000aaaad68b1398 in dual_tls_recv (listener=0xaaab195e5180) at src/main/tls_listen.c:769
packet = 0xaaab185489e0
fun = 0x0
sock = 0xaaab195e5350
client = 0xaaab16a94210
rbio = 0x3
#9 0x0000aaaad68951b8 in event_socket_handler (xel=0xaaab16a181f0, fd=392, ctx=0xaaab195e5180) at src/main/process.c:5390
listener = 0xaaab195e5180
#10 0x0000ffff8aa6e9f4 in fr_event_loop (el=0xaaab16a181f0) at src/lib/event.c:721
ef = 0xaaab16a18468
i = 10
rcode = 1
when = {tv_sec = 1735943242, tv_usec = 742057}
wake = 0xfffff0d7bb28
read_fds = {fds_bits = {0, 0, 0, 0, 0, 0, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0}}
write_fds = {fds_bits = {0 <repeats 16 times>}}
#11 0x0000aaaad6897648 in radius_event_process () at src/main/process.c:6630
No locals.
#12 0x0000aaaad687dea4 in main (argc=3, argv=0xfffff0d7be88) at src/main/radiusd.c:653
rcode = 0
status = 0
argval = -1
spawn_flag = true
display_version = false
flag = 0
from_child = {-1, -1}
p = 0x0
state = 0xaaaad68eed78 <global_state>
autofree = 0xaaab1668b300
I've wrote a small python script to test this: import multiprocessing
import time
import socket
import ssl
import logging
class SSLClient:
def __init__(self, ip, client_cert_file_location, trusted_cas_file_location):
self.client_cert_file_location = client_cert_file_location
self.trusted_cas_file_location = trusted_cas_file_location
self.socket: ssl.SSLSocket = self.connect_to_server(ip, 2083, self.client_cert_file_location, self.trusted_cas_file_location)
def connect_to_server(self, ip, port, client_cert_file, ca_file_location):
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
context.verify_mode = ssl.CERT_REQUIRED
context.load_cert_chain(certfile=client_cert_file)
context.load_verify_locations(cafile=ca_file_location)
context.check_hostname = False
sock = context.wrap_socket(sock, server_hostname=ip)
connection = sock.connect((ip, int(port)))
return sock
except Exception as e:
logging.error(f'Radius tcp monitor: RADIUS server {ip} is DOWN. err: ' + str(e))
return None
def send_stuff(x):
try:
test = SSLClient('127.0.0.1', './certs/radsec/client.pem', './certs/radsec/ca.crt')
test.socket.send(b'asdlkfjasldkfj')
test.socket.shutdown(socket.SHUT_WR)
test.socket.recv(1024)
test.socket.close()
except Exception as e:
print('error while sending things')
finally:
try:
test.socket.close()
except:
pass
if __name__ == '__main__':
with multiprocessing.Pool(16) as p:
while True:
p.map(send_stuff, range(400))
time.sleep(1)
|
I've added that python script as My guess is that the socket is somehow being deleted while it's still in use. But I'd have to reproduce the issue in order to know for sure. |
I'm also on OSX but running the server is running in a linux docker container. The entrypoint I'm using will copy the current raddb folder to one which is attached as volume to the host if the environment variable INIT is true and if it's not true it will copy everything from the volume to /etc/raddb. It's done that way because it's a nightmare dealing with file permissions if it's exposed to the host. The network is made with traefik to be able to test with PROXY_PROTOCOL as well if needed. The host folder docker-compose.yml: name: radius-vanilla
services:
radius:
image: radius-server-vanilla
build:
context: .
container_name: vanillaradius
cap_add:
- SYS_PTRACE
security_opt:
- seccomp=unconfined
hostname: radius
environment:
- INIT=false
entrypoint: ['/bin/sh', '-c', 'while true; do sleep 5; echo "waiting" ;done']
volumes:
- ./runtime/runningraddb:/etc/runningraddb
- ./runtime/logs/radius:/usr/local/var/log/radius
- ./config:/etc/toraddb
- ./docker-entrypoint.sh:/docker-entrypoint.sh
labels:
- "traefik.enable=true"
- 'traefik.tcp.routers.radius.entrypoints=radius'
- 'traefik.tcp.services.radius.loadbalancer.server.port=2083'
- 'traefik.tcp.services.radius.loadbalancer.server.address=host.docker.internal'
# - 'traefik.tcp.services.radius.loadbalancer.proxyprotocol.version=1'
- 'traefik.tcp.routers.radius.rule=HostSNI(`*`)'
- 'traefik.tcp.routers.radius.service=radius'
- 'traefik.tcp.routers.radius.tls.passthrough=true'
extra_hosts:
- host.docker.internal:host-gateway
networks:
- traefik
traefik:
image: "traefik:v2.5.5"
container_name: "traefik"
hostname: "traefik"
ports:
- "80:80"
- "2083:2083"
command:
- '--providers.docker=true'
- '--accesslog=true'
- '--entryPoints.radius.address=:2083'
- '--providers.docker.network=traefik'
- '--api.dashboard=true'
- '--api.insecure=true'
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
extra_hosts:
- host.docker.internal:host-gateway
networks:
- traefik
networks:
traefik:
name: traefik
Dockerfile I'm using: ARG from=ubuntu:22.04
FROM ${from} as build
#
# Install build tools
#
ARG APT_OPTS='-yq --option=Dpkg::options::=--force-unsafe-io'
ARG DEBIAN_FRONTEND='noninteractive'
ARG REGISTRYUSER=FAIL
ARG REGISTRYPW=FAIL
ARG PYTHONVERSION=3.10
RUN apt clean
RUN apt update $APT_OPTS && apt upgrade $APT_OPTS
RUN apt $APT_OPTS install \
devscripts \
equivs \
git \
quilt \
gcc \
gdb \
lldb
#
# Create build directory
#
RUN mkdir -p /build/repositories/freeradius-server
WORKDIR /build/repositories
COPY ./freeradius-server-source ./freeradius-server
WORKDIR /build/repositories/freeradius-server
# Install build dependencies
#
# essential
RUN apt $APT_OPTS update && apt $APT_OPTS upgrade && apt $APT_OPTS update --fix-missing
RUN apt $APT_OPTS install \
libc-dev \
libtalloc-dev \
libssl-dev
RUN apt $APT_OPTS install \
linux-headers-generic \
libpcre3-dev \
libidn11-dev \
krb5-multidev \
samba-dev \
libcurl4-openssl-dev \
libjson-c-dev \
lsb-release \
ubuntu-dbgsym-keyring
# needed for debug symbols
RUN <<EOR
echo "deb http://ddebs.ubuntu.com $(lsb_release -cs) main restricted universe multiverse
deb http://ddebs.ubuntu.com $(lsb_release -cs)-updates main restricted universe multiverse
deb http://ddebs.ubuntu.com $(lsb_release -cs)-proposed main restricted universe multiverse" | \
tee -a /etc/apt/sources.list.d/ddebs.list
EOR
RUN apt $APT_OPTS update
RUN apt $APT_OPTS install libssl3-dbgsym
ARG cc=gcc
RUN ./configure --with-openssl=yes --build=x86_64-unknown-linux-gnu --enable-developer
RUN make -j$(($(getconf _NPROCESSORS_ONLN) + 1))
RUN make install
#
# These are needed for the server to start
#
RUN apt $APT_OPTS update \
&& apt $APT_OPTS install libtalloc-dev libssl-dev libssl3-dbgsym libpcre3-dev sssd libpam-sss libnss-sss sssd-tools samba \
&& apt $APT_OPTS install libcurl4-openssl-dev libjson-c-dev python3 \
\
&& ln -s /usr/local/etc/raddb /etc/raddb
RUN ln -s /etc/raddb/sites-available/tls /etc/raddb/sites-enabled/tls
## Set requirements
# allow all ip addresses and set max_connections to 0
RUN sed -i '/client 127\.0\.0\.1 /{n;s/ipaddr = 127\.0\.0\.1/ipaddr = *\nlimit {max_connections = 0 }/}' /etc/raddb/sites-available/tls
# RUN sed -i 's/#.*proxy_protocol.*/proxy_protocol = yes/' /etc/raddb/sites-available/tls
RUN sed -i 's/#.*check_client_connections .*/check_client_connections = yes/' /etc/raddb/sites-available/tls
# set all other default max_connection settings to unlimited
RUN sed -i 's/max_connections = 16.*/max_connections = 0/' /etc/raddb/sites-available/tls
# allow core_dumps
RUN sed -i 's/allow_core_dumps .*/allow_core_dumps = yes/' /etc/raddb/radiusd.conf
RUN apt $APT_OPTS update && apt $APT_OPTS upgrade
RUN apt install nano tmux curl dnsutils tcpdump -yq
COPY docker-entrypoint.sh /
RUN mkdir /etc/runningraddb
RUN ln -n /etc/raddb /etc/runningraddb
RUN chmod -R 755 /usr/local/etc/raddb
ENV INIT=true
WORKDIR /etc/raddb
EXPOSE 1812/udp 1813/udp 2083/tcp
ENTRYPOINT ["/bin/bash"]
CMD ["/docker-entrypoint.sh"] docker-entrypoint.sh #!/bin/bash
set -e
if [ ! -d "/etc/runningraddb" ]; then
mkdir /etc/runningraddb
fi
if [ "${INIT:-}" == 'true' ]; then
cp -Lr /etc/raddb/* /etc/runningraddb
else
ulimit -c unlimited
cp -r /etc/runningraddb/* /etc/raddb
cp -r /etc/toraddb/raddb/* /etc/raddb
fi |
What type of defect/bug is this?
Crash or memory corruption (segv, abort, etc...)
How can the issue be reproduced?
Enable the site
tls
and setcheck_client_connections
in it to yes.Then init and close some tls sessions until the server crashes.
Log output from the FreeRADIUS daemon
Relevant log output from client utilities
No response
Backtrace from LLDB or GDB
The text was updated successfully, but these errors were encountered: