Fix to CISCO_ACCOUNTING_HACK
Hi all. We had some random crashes while processing ~600 RPS of accounting with freeradius 2.1.7 and rlm_sql (MySQL). Coredumps showed that crashes occurs mostly in MySQL library. MySQL handle was used twice by different threads. Problem is so simple that I wonder why it has not been catched long ago. Here comes a patch: --- freeradius-server-2.1.7/src/modules/rlm_sql/rlm_sql.c 2009-09-14 10:43:29.000000000 -0400 +++ freeradius-server-2.1.7-patched/src/modules/rlm_sql/rlm_sql.c 2009-10-11 15:03:12.000000000 -0400 @@ -1323,7 +1323,7 @@ radius_xlat(logstr, sizeof(logstr), "stop packet with zero session length. [user '%{User-Name}', nas '%{NAS-IP-Address}']", request, NULL); radlog_request(L_ERR, 0, request, "%s", logstr); sql_release_socket(inst, sqlsocket); - ret = RLM_MODULE_NOOP; + return RLM_MODULE_NOOP; } #endif Mutex is released in sql_release_socket, but socket is still used below. This is not what CISCO_ACCOUNTING_HACK is supposed to do. Processing should stop here. It looks like this bug has been fixed in ic-radius 0.17 at 2001. -- Pavel Levshin OJSC "Megafon", North-West branch
Pavel Levshin wrote:
We had some random crashes while processing ~600 RPS of accounting with freeradius 2.1.7 and rlm_sql (MySQL).
Coredumps showed that crashes occurs mostly in MySQL library. MySQL handle was used twice by different threads. Problem is so simple that I wonder why it has not been catched long ago. Here comes a patch:
Fixed, thanks.
It looks like this bug has been fixed in ic-radius 0.17 at 2001.
About when he stopped sending patches back to FreeRADIUS. Oh well. Alan DeKok.
participants (2)
-
Alan DeKok -
Pavel Levshin