Seg-fault with proxy and fail-overs

Chris Moules chris at gms.lu
Thu Mar 5 09:52:26 CET 2009


Morning,

it looks like this is not 100% resolved. I installed a patched version on FreeRADIUS stable:

-----------------

git branch
   master
* stable

commit 2b79682e175312703743acd6ed98b988a3e74884
Author: Alan T. DeKok <aland at freeradius.org>
Date:   Wed Mar 4 13:52:35 2009 +0100

     Simplified use of syslog options

     Patch from Hermann Lauer

commit cb291079f09cdea0ecf75948b10377b6ef6b3687
Author: Alan T. DeKok <aland at freeradius.org>
Date:   Wed Mar 4 13:38:03 2009 +0100

     Cleaned up code based on report of crash.

     Added additional notes on coa

     moved "check for reply" in received_proxy_response to earlier,
     as it shouldn't be done later.

     Simplified check for CoA divorce.  This is the code that crashed
     (still no idea why), but the new code should do the intended checks,
     without the un-intended side effects

commit c191369bc562b9f9b83b511270c417e8988d2454
Author: Alan T. DeKok <aland at freeradius.org>
Date:   Mon Mar 2 10:31:16 2009 +0100

     Keep track of total responses for clients, too

-----------------

After installation, I ran my home_server proxy, reading the local log file. This ran for about a minute and then crashed. I then 
installed the dbg package and ran it again with gdb. Attached is the gdb log file.

Apart from the content of the log file, there was a dump to stderr:

Going to the next request
Delaying next detail event for 1.0 seconds.
rad_recv: Accounting-Response packet from host <home_server_ip> port 4367, id=93, length=20
*** glibc detected *** /usr/sbin/freeradius: double free or corruption (top): 0x0000000002773790 ***
======= Backtrace: =========
/lib/libc.so.6[0x7fc0148ee948]
/lib/libc.so.6(cfree+0x76)[0x7fc0148f0a56]
/usr/lib/freeradius/libfreeradius-radius-2.1.4.so(rad_free+0x38)[0x7fc015c4e0a8]
/usr/sbin/freeradius[0x4128cd]
/usr/sbin/freeradius[0x42173e]
/usr/lib/freeradius/libfreeradius-radius-2.1.4.so(fr_event_loop+0x36b)[0x7fc015c5929b]
/usr/sbin/freeradius(main+0x56d)[0x41aebd]
/lib/libc.so.6(__libc_start_main+0xe6)[0x7fc0148991a6]
/usr/sbin/freeradius[0x408689]
======= Memory map: ========
00400000-0043c000 r-xp 00000000 fe:01 144774                             /usr/sbin/freeradius
0063b000-0063f000 rw-p 0003b000 fe:01 144774                             /usr/sbin/freeradius
0063f000-00640000 rw-p 0063f000 00:00 0
02622000-02793000 rw-p 02622000 00:00 0                                  [heap]
7fc00c000000-7fc00c021000 rw-p 7fc00c000000 00:00 0
7fc00c021000-7fc010000000 ---p 7fc00c021000 00:00 0
7fc01321e000-7fc013234000 r-xp 00000000 fe:00 62788                      /lib/libgcc_s.so.1
7fc013234000-7fc013434000 ---p 00016000 fe:00 62788                      /lib/libgcc_s.so.1
7fc013434000-7fc013435000 rw-p 00016000 fe:00 62788                      /lib/libgcc_s.so.1
7fc013435000-7fc013436000 r-xp 00000000 fe:01 186390                     /usr/lib/freeradius/rlm_always-2.1.4.so
7fc013436000-7fc013636000 ---p 00001000 fe:01 186390                     /usr/lib/freeradius/rlm_always-2.1.4.so
7fc013636000-7fc013637000 rw-p 00001000 fe:01 186390                     /usr/lib/freeradius/rlm_always-2.1.4.so
7fc013637000-7fc01363a000 r-xp 00000000 fe:01 186417                     /usr/lib/freeradius/rlm_logintime-2.1.4.so
7fc01363a000-7fc013839000 ---p 00003000 fe:01 186417                     /usr/lib/freeradius/rlm_logintime-2.1.4.so
7fc013839000-7fc01383a000 rw-p 00002000 fe:01 186417                     /usr/lib/freeradius/rlm_logintime-2.1.4.so
7fc01383a000-7fc01383c000 r-xp 00000000 fe:01 186411                     /usr/lib/freeradius/rlm_expiration-2.1.4.so
7fc01383c000-7fc013a3b000 ---p 00002000 fe:01 186411                     /usr/lib/freeradius/rlm_expiration-2.1.4.so
7fc013a3b000-7fc013a3c000 rw-p 00001000 fe:01 186411                     /usr/lib/freeradius/rlm_expiration-2.1.4.so
7fc013a3c000-7fc013a3e000 r-xp 00000000 fe:01 186412                     /usr/lib/freeradius/rlm_expr-2.1.4.so
7fc013a3e000-7fc013c3e000 ---p 00002000 fe:01 186412                     /usr/lib/freeradius/rlm_expr-2.1.4.so
7fc013c3e000-7fc013c3f000 rw-p 00002000 fe:01 186412                     /usr/lib/freeradius/rlm_expr-2.1.4.so
7fc013c3f000-7fc013c41000 r-xp 00000000 fe:01 186410                     /usr/lib/freeradius/rlm_exec-2.1.4.so
7fc013c41000-7fc013e40000 ---p 00002000 fe:01 186410                     /usr/lib/freeradius/rlm_exec-2.1.4.so
7fc013e40000-7fc013e41000 rw-p 00001000 fe:01 186410                     /usr/lib/freeradius/rlm_exec-2.1.4.so
7fc013e41000-7fc013e4b000 r-xp 00000000 fe:00 62759                      /lib/libnss_files-2.7.so
7fc013e4b000-7fc01404b000 ---p 0000a000 fe:00 62759                      /lib/libnss_files-2.7.so
7fc01404b000-7fc01404d000 rw-p 0000a000 fe:00 62759                      /lib/libnss_files-2.7.so
7fc01404d000-7fc014057000 r-xp 00000000 fe:00 62748                      /lib/libnss_nis-2.7.so
7fc014057000-7fc014256000 ---p 0000a000 fe:00 62748                      /lib/libnss_nis-2.7.so
7fc014256000-7fc014258000 rw-p 00009000 fe:00 62748                      /lib/libnss_nis-2.7.so
7fc014258000-7fc01425f000 r-xp 00000000 fe:00 62754                      /lib/libnss_compat-2.7.so
7fc01425f000-7fc01445e000 ---p 00007000 fe:00 62754                      /lib/libnss_compat-2.7.so
7fc01445e000-7fc014460000 rw-p 00006000 fe:00 62754                      /lib/libnss_compat-2.7.so
7fc014460000-7fc014476000 r-xp 00000000 fe:01 176723                     /usr/lib/libz.so.1.2.3.3
7fc014476000-7fc014676000 ---p 00016000 fe:01 176723                     /usr/lib/libz.so.1.2.3.3
7fc014676000-7fc014677000 rw-p 00016000 fe:01 176723                     /usr/lib/libz.so.1.2.3.3
7fc014677000-7fc014679000 r-xp 00000000 fe:00 62766                      /lib/libdl-2.7.so
7fc014679000-7fc014879000 ---p 00002000 fe:00 62766                      /lib/libdl-2.7.so
7fc014879000-7fc01487b000 rw-p 00002000 fe:00 62766                      /lib/libdl-2.7.so
7fc01487b000-7fc0149c5000 r-xp 00000000 fe:00 62762                      /lib/libc-2.7.so
7fc0149c5000-7fc014bc4000 ---p 0014a000 fe:00 62762                      /lib/libc-2.7.so
7fc014bc4000-7fc014bc7000 r--p 00149000 fe:00 62762                      /lib/libc-2.7.so
7fc014bc7000-7fc014bc9000 rw-p 0014c000 fe:00 62762                      /lib/libc-2.7.so
7fc014bc9000-7fc014bce000 rw-p 7fc014bc9000 00:00 0
7fc014bce000-7fc014d3f000 r-xp 00000000 fe:01 177147                     /usr/lib/libcrypto.so.0.9.8
7fc014d3f000-7fc014f3f000 ---p 00171000 fe:01 177147                     /usr/lib/libcrypto.so.0.9.8
7fc014f3f000-7fc014f65000 rw-p 00171000 fe:01 177147                     /usr/lib/libcrypto.so.0.9.8
7fc014f65000-7fc014f69000 rw-p 7fc014f65000 00:00 0
7fc014f69000-7fc014fb3000 r-xp 00000000 fe:01 177148                     /usr/lib/libssl.so.0.9.8
7fc014fb3000-7fc0151b3000 ---p 0004a000 fe:01 177148                     /usr/lib/libssl.so.0.9.8
7fc0151b3000-7fc0151ba000 rw-p 0004a000 fe:01 177148                     /usr/lib/libssl.so.0.9.8
7fc0151ba000-7fc0151c1000 r-xp 00000000 fe:01 178225                     /usr/lib/libltdl.so.3.1.6
7fc0151c1000-7fc0153c0000 ---p 00007000 fe:01 178225                     /usr/lib/libltdl.so.3.1.6
7fc0153c0000-7fc0153c1000 rw-p 00006000 fe:01 178225                     /usr/lib/libltdl.so.3.1.6
7fc0153c1000-7fc0153c9000 r-xp 00000000 fe:00 62760                      /lib/libcrypt-2.7.so
7fc0153c9000-7fc0155c9000 ---p 00008000 fe:00 62760                      /lib/libcrypt-2.7.so
7fc0155c9000-7fc0155cb000 rw-p 00008000 fe:00 62760                      /lib/libcrypt-2.7.so
7fc0155cb000-7fc0155f9000 rw-p 7fc0155cb000 00:00 0
7fc0155f9000-7fc01560f000 r-xp 00000000 fe:00 62758                      /lib/libpthread-2.7.so
7fc01560f000-7fc01580f000 ---p 00016000 fe:00 62758                      /lib/libpthread-2.7.so
7fc01580f000-7fc015811000 rw-p 00016000 fe:00 62758                      /lib/libpthread-2.7.so
7fc015811000-7fc015815000 rw-p 7fc015811000 00:00 0
7fc015815000-7fc015825000 r-xp 00000000 fe:00 62756                      /lib/libresolv-2.7.so
7fc015825000-7fc015a25000 ---p 00010000 fe:00 62756                      /lib/libresolv-2.7.so
7fc015a25000-7fc015a27000 rw-p 00010000 fe:00 62756                      /lib/libresolv-2.7.so
7fc015a27000-7fc015a29000 rw-p 7fc015a27000 00:00 0
7fc015a29000-7fc015a3e000 r-xp 00000000 fe:00 62752                      /lib/libnsl-2.7.so
7fc015a3e000-7fc015c3d000 ---p 00015000 fe:00 62752                      /lib/libnsl-2.7.so
7fc015c3d000-7fc015c3f000 rw-p 00014000 fe:00 62752                      /lib/libnsl-2.7.so
7fc015c3f000-7fc015c41000 rw-p 7fc015c3f000 00:00 0
7fc015c41000-7fc015c60000 r-xp 00000000 fe:01 186387                     /usr/lib/freeradius/libfreeradius-radius-2.1.4.so
7fc015c60000-7fc015e60000 ---p 0001f000 fe:01 186387                     /usr/lib/freeradius/libfreeradius-radius-2.1.4.so
7fc015e60000-7fc015e62000 rw-p 0001f000 fe:01 186387                     /usr/lib/freeradius/libfreeradius-radius-2.1.4.so
7fc015e62000-7fc015e63000 rw-p 7fc015e62000 00:00 0
7fc015e63000-7fc015e7f000 r-xp 00000000 fe:00 62765                      /lib/ld-2.7.so
7fc016071000-7fc016077000 rw-p 7fc016071000 00:00 0
7fc016079000-7fc01607e000 rw-p 7fc016079000 00:00 0
7fc01607e000-7fc016080000 rw-p 0001b000 fe:00 62765                      /lib/ld-2.7.so
7fff1e067000-7fff1e07f000 rw-p 7ffffffe7000 00:00 0                      [stack]
7fff1e1fe000-7fff1e1ff000 r-xp 7fff1e1fe000 00:00 0                      [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fc016071ae0 (LWP 25399)]


Chris

Chris Moules wrote:
> Alan DeKok wrote:
>> Chris Moules wrote:
>>> Alan DeKok wrote:
>>>> Chris Moules wrote:
>>>>> OK, I have re-done the debugging. This time I have left gdb running in
>>>>> case you want more output.
>>>>   Thanks...  if you could also show:
>>>>
>>>> (gdb) p/x request->proxy
>>
>>   Sorry...
>>
>> (gdb) p/x *request->proxy
>>
>>   Little characters make all the difference.
>>
>>   Alan DeKok.
>> -
>> List info/subscribe/unsubscribe? See 
>> http://www.freeradius.org/list/devel.html
>>
> 
> Hi Alan,
> 
> no problem, I did wonder.
> 
> hope this is more helpful.
> 
> (gdb) p/x request->proxy
> $2 = 0xeebff0
> (gdb) p/x *request->proxy
> $3 = {sockfd = 0x8, src_ipaddr = {af = 0x2, ipaddr = {ip4addr = {s_addr 
> = 0x0}, ip6addr = {in6_u = {u6_addr8 = {0x0, 0x0, 0x0, 0x0, 0x12, 0xe0, 
> 0x15, 0x7a,
>             0x38, 0x7f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u6_addr16 = {0x0, 
> 0x0, 0xe012, 0x7a15, 0x7f38, 0x0, 0x0, 0x0}, u6_addr32 = {0x0, 
> 0x7a15e012, 0x7f38,
>             0x0}}}}}, dst_ipaddr = {af = 0x2, ipaddr = {ip4addr = 
> {s_addr = 0x9bef482}, ip6addr = {in6_u = {u6_addr8 = {0x82, 0xf4, 0xbe, 
> 0x9,
>             0x0 <repeats 12 times>}, u6_addr16 = {0xf482, 0x9be, 0x0, 
> 0x0, 0x0, 0x0, 0x0, 0x0}, u6_addr32 = {0x9bef482, 0x0, 0x0, 0x0}}}}},
>   src_port = 0x542, dst_port = 0x110f, id = 0xc3, code = 0x4, hash = 
> 0x268b44dc, vector = {0xed, 0xd6, 0xfe, 0xd5, 0x5e, 0xec, 0xe6, 0x3e, 
> 0x9a, 0x4e,
>     0x5e, 0xb6, 0x4e, 0x5d, 0x9b, 0xdb}, timestamp = 0x0, data = 
> 0xeea910, data_len = 0x48, vps = 0xeec070, offset = 0x0}
> 
> 
> Chris
> -
> List info/subscribe/unsubscribe? See 
> http://www.freeradius.org/list/devel.html
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gdb-radiusd3.log
Type: text/x-log
Size: 2571 bytes
Desc: not available
URL: <http://lists.freeradius.org/pipermail/freeradius-devel/attachments/20090305/903f30b5/attachment.bin>


More information about the Freeradius-Devel mailing list