Re: Redundant SQL servers accounting problem, FreeRadius 1.1.4

2007-03-26 Thread Alan DeKok
Alexander V. Klepikov wrote: I make some additional tests. When DB connection suddenly breakes, sqlsocket-state == sockconnected. I' ve committed a fix to -r branch_1_1. Please test it, to see if it works. Alan DeKok. -- http://deployingradius.com - The web site of the book

Re: Redundant SQL servers accounting problem, FreeRadius 1.1.4

2007-03-26 Thread Alexander V. Klepikov
Hello, Alan! You wrote on Mon, 26 Mar 2007 10:50:17 +0100: AD I' ve committed a fix to -r branch_1_1. Please test it, to see AD if AD it works. To get it I typed cvs -d :pserver:[EMAIL PROTECTED]:/source checkout -r branch_1_1 radiusd Am I right? I got troubles with running it:

Re: Redundant SQL servers accounting problem, FreeRadius 1.1.4

2007-03-26 Thread Alan DeKok
Alexander V. Klepikov wrote: To get it I typed cvs -d :pserver:[EMAIL PROTECTED]:/source checkout -r branch_1_1 radiusd Am I right? Yes. I got troubles with running it: ... Program received signal SIGSEGV, Segmentation fault. 0x28349e28 in rad_mangle () from

Re : Redundant SQL servers accounting problem, FreeRadius 1.1.4

2007-03-26 Thread Eshun Benjamin
: FreeRadius users mailing list freeradius-users@lists.freeradius.org Envoyé le : Lundi, 26 Mars 2007, 14h40mn 11s Objet : Re: Redundant SQL servers accounting problem, FreeRadius 1.1.4 Hello, Alan! You wrote on Mon, 26 Mar 2007 10:50:17 +0100: AD I' ve committed a fix to -r branch_1_1

Re: Redundant SQL servers accounting problem, FreeRadius 1.1.4

2007-03-26 Thread Alexander V. Klepikov
Hello, Eshun! You wrote on Mon, 26 Mar 2007 14:50:52 + (GMT): EB $ cvs -d :pserver:[EMAIL PROTECTED]:/source login CVS EB password: anoncvs $ cvs -d EB :pserver:[EMAIL PROTECTED]:/source checkout -r branch_1_1 Yes, I already did it, thank you! With best regards, Alexander V. Klepikov.

Re: Redundant SQL servers accounting problem, FreeRadius 1.1.4

2007-03-26 Thread Alexander V. Klepikov
Hello, Alan! You wrote on Mon, 26 Mar 2007 10:50:17 +0100: AD I' ve committed a fix to -r branch_1_1. Please test it, to see AD if AD it works. Yes, freeradius works without crashes when DB suddenly comes down and then up. With best regards, Alexander V. Klepikov. E-mail: [EMAIL

Re: Redundant SQL servers accounting problem, FreeRadius 1.1.4

2007-03-22 Thread Alexander V. Klepikov
Hello, Alan! You wrote on Wed, 21 Mar 2007 12:57:46 +0100: After Nicolas Baradakis's patch some things changed. Now I know that if connection to PostgreSQL DB became broken, libpq does not free pg_sock-conn, so PQfinish(pg_sock-conn) MUST be called. AD If pg_sock-conn is freed, that pointer

Re: Redundant SQL servers accounting problem, FreeRadius 1.1.4

2007-03-22 Thread Alan DeKok
Alexander V. Klepikov wrote: It seemes to me, it's almost impossible to write code which will allow sqlsocket-conn to provide accurate information about connection state. But again, I'm not a programmer. If that's true, then we still need to audit all of the sql code. Some code does if

Re: Redundant SQL servers accounting problem, FreeRadius 1.1.4

2007-03-21 Thread Alexander V. Klepikov
Hello, Alan! You wrote on Tue, 20 Mar 2007 12:47:01 +0100: AD Alexander V. Klepikov wrote: I applied the patch and it does not work. It seemes to me, it's becuase SQL socket may be unconnected and sqlsocket-conn != NULL, AD That sounds like a bug to me. It seemes to me I begin to

Re: Redundant SQL servers accounting problem, FreeRadius 1.1.4

2007-03-21 Thread Nicolas Baradakis
Alexander V. Klepikov wrote: I did not find any information about what is going on when database or SQL server suddenly comes down, but it looks like pg_sock-conn is freed when connection to DB became broken. And pg_sock-conn != NULL . That's why libpq crashes when PQfinish(pg_sock-conn)

Re: Redundant SQL servers accounting problem, FreeRadius 1.1.4

2007-03-21 Thread Alan DeKok
Alexander V. Klepikov wrote: ... If connection to DB fails, PQfinish(pg_sock-conn) is called, which frees pg_sock-conn - need to do this is described in libpq docs. So even in case of unsuccessefull connection we have good database handle sqlsocket-conn, which should not be NULL. If

Re: Redundant SQL servers accounting problem, FreeRadius 1.1.4

2007-03-21 Thread Alan DeKok
Nicolas Baradakis wrote: It seems to me this is the real cause of the problem: pg_sock-conn becomes an invalid pointer. The libpq manpage says the PGconn pointer should not be used after PQfinish has been called. Please try the following patch: I think it should be applied, independent of

Re: Redundant SQL servers accounting problem, FreeRadius 1.1.4

2007-03-21 Thread Alexander V. Klepikov
Hello, Nicolas! You wrote on Wed, 21 Mar 2007 12:37:03 +0100: NB It seems to me this is the real cause of the problem: pg_sock-conn NB becomes NB an invalid pointer. The libpq manpage says the PGconn pointer should NB not be NB used after PQfinish has been called. NB Please try the following

Re: Redundant SQL servers accounting problem, FreeRadius 1.1.4

2007-03-20 Thread Alexander V. Klepikov
Hello, Alan! You wrote on Mon, 19 Mar 2007 17:54:52 +0100: AD Hmm... it looks like similar patches were added in revision 1.72 AD of AD that file. I've double-checked the code, and found one more AD location. AD Please try the attached patch. I applied the patch and it does not work. It

Re: Redundant SQL servers accounting problem, FreeRadius 1.1.4

2007-03-20 Thread Alan DeKok
Alexander V. Klepikov wrote: I applied the patch and it does not work. It seemes to me, it's becuase SQL socket may be unconnected and sqlsocket-conn != NULL, That sounds like a bug to me. so I think it's better to check sqlsocket-state . Corrected patch is attached. OK. Alan DeKok.

Re: Redundant SQL servers accounting problem, FreeRadius 1.1.4

2007-03-19 Thread Alan DeKok
Alexander V. Klepikov wrote: ... rlm_sql_postgresql: PostgreSQL Query failed Error: no connection to the server radiusd in free(): error: chunk is already free Please run the server under valgrind. I don't use postgresql, so I can't tell what's going wrong. Alan DeKok. --

Re: Redundant SQL servers accounting problem, FreeRadius 1.1.4

2007-03-19 Thread Alexander V. Klepikov
Hello, Alexander! You wrote to All on Fri, 16 Mar 2007 17:23:19 +0200: AVK It looks like accounting module cannot properly make a connection AVK to SQL AVK server, but authorize module can. I found that with num_sql_socks AVK = 2 AVK FreeRadius works perfect, I made several tests stopping and AVK

Re: Redundant SQL servers accounting problem, FreeRadius 1.1.4

2007-03-19 Thread Alan DeKok
Alexander V. Klepikov wrote: Well, I think I found why FreeRadius crashes. Unconnected SQL socket is passed to sql_close function in module rlm_sql in function rlm_sql_query (src/modules/rlm_sql/sql.c line 499). Here is the patch: Hmm... it looks like similar patches were added in