Re: strange cppcheck finding

2018-03-20 Thread Willy Tarreau
On Tue, Mar 20, 2018 at 03:05:12PM +0100, Willy Tarreau wrote: > On Tue, Mar 20, 2018 at 06:45:08PM +0500, ??? wrote: > > "UB" stands for undefined behaviour. that's the reason why cppcheck is > > unhappy. > > how do that properly - that's the question :) > > The thing is that I'm not

Re: strange cppcheck finding

2018-03-20 Thread Willy Tarreau
On Tue, Mar 20, 2018 at 06:45:08PM +0500, ??? wrote: > "UB" stands for undefined behaviour. that's the reason why cppcheck is > unhappy. > how do that properly - that's the question :) The thing is that I'm not aware of any other way to safely detect integer overflows, it's always done

Re: strange cppcheck finding

2018-03-20 Thread Илья Шипицин
"UB" stands for undefined behaviour. that's the reason why cppcheck is unhappy. how do that properly - that's the question :) 2018-03-20 10:48 GMT+05:00 Willy Tarreau : > On Mon, Mar 19, 2018 at 06:55:46PM +0500, ??? wrote: > > (it's master) > > > > is it in purpose ? > > >

Re: strange cppcheck finding

2018-03-19 Thread Willy Tarreau
On Mon, Mar 19, 2018 at 06:55:46PM +0500, ??? wrote: > (it's master) > > is it in purpose ? > > [src/ssl_sock.c:1553]: (warning) Invalid test for overflow > 'msg+rec_len overflow is UB. The code is : rec_len =

strange cppcheck finding

2018-03-19 Thread Илья Шипицин
(it's master) is it in purpose ? [src/ssl_sock.c:1553]: (warning) Invalid test for overflow 'msg+rec_len

Re: cppcheck finding

2018-03-19 Thread Willy Tarreau
Hi, On Thu, Mar 15, 2018 at 04:27:43PM +0500, ??? wrote: > [src/51d.c:373]: (error) Invalid number of character '{' when no macros are > defined. Just a small hint, please always mention which version (or ideally commit) you report issues like this. >From what I'm seeing, the program

cppcheck finding

2018-03-15 Thread Илья Шипицин
Hi, [src/51d.c:373]: (error) Invalid number of character '{' when no macros are defined. ?

Re: cppcheck finding

2018-03-14 Thread Willy Tarreau
Hi, On Wed, Mar 14, 2018 at 06:09:26PM +0500, ??? wrote: > any action on that ? It was merged : - ec9516a6 in mainline - 60238357 in 1.8 branch Thanks, Willy

Re: cppcheck finding

2018-03-14 Thread Илья Шипицин
any action on that ? 2018-03-08 22:29 GMT+05:00 Olivier Houchard : > Hi, > > On Thu, Mar 08, 2018 at 05:44:31PM +0100, Willy Tarreau wrote: > > Hi, > > > > On Wed, Mar 07, 2018 at 03:26:25PM +0500, ??? wrote: > > > Hello, > > > > > > [src/proto_uxst.c:160]:

Re: cppcheck finding

2018-03-08 Thread Olivier Houchard
Hi, On Thu, Mar 08, 2018 at 05:44:31PM +0100, Willy Tarreau wrote: > Hi, > > On Wed, Mar 07, 2018 at 03:26:25PM +0500, ??? wrote: > > Hello, > > > > [src/proto_uxst.c:160]: (warning) Redundant assignment of > > 'xfer_sock->next->prev' to itself. > > > > is it in purpose ? > > I

Re: cppcheck finding

2018-03-08 Thread Willy Tarreau
Hi, On Wed, Mar 07, 2018 at 03:26:25PM +0500, ??? wrote: > Hello, > > [src/proto_uxst.c:160]: (warning) Redundant assignment of > 'xfer_sock->next->prev' to itself. > > is it in purpose ? I suspect it's a mistake and that it was meant to be xfer_sock->prev instead. CCing Olivier to

cppcheck finding

2018-03-07 Thread Илья Шипицин
Hello, [src/proto_uxst.c:160]: (warning) Redundant assignment of 'xfer_sock->next->prev' to itself. is it in purpose ?

Re: another cppcheck finding

2017-10-05 Thread Baptiste
I also fixed it in a patch set to make the resolution pool dynamic :) Baptiste

Re: another cppcheck finding

2017-10-04 Thread Christopher Faulet
Le 04/10/2017 à 11:54, Илья Шипицин a écrit : Hi, I'm working on the DNS part to make it thread-safe. In my patch set, among other things, I fixed this one. I will send everything to Willy in few days. So don't bother with it. ... using ThreadSanitizer from google ? No. We

Re: another cppcheck finding

2017-10-04 Thread Илья Шипицин
2017-10-04 14:00 GMT+05:00 Christopher Faulet : > Le 04/10/2017 à 07:49, Илья Шипицин a écrit : > >> >> >> 2017-10-04 9:15 GMT+05:00 Willy Tarreau >: >> >> Hi Ilya, >> >> [also CCing Baptiste] >> >> On Tue, Oct 03, 2017 at

Re: another cppcheck finding

2017-10-04 Thread Christopher Faulet
Le 04/10/2017 à 07:49, Илья Шипицин a écrit : 2017-10-04 9:15 GMT+05:00 Willy Tarreau >: Hi Ilya, [also CCing Baptiste] On Tue, Oct 03, 2017 at 05:25:17PM +0500, ??? wrote: > [src/dns.c:2502]: (error) Memory leak: buffer > >

Re: another cppcheck finding

2017-10-03 Thread Илья Шипицин
2017-10-04 9:15 GMT+05:00 Willy Tarreau : > Hi Ilya, > > [also CCing Baptiste] > > On Tue, Oct 03, 2017 at 05:25:17PM +0500, ??? wrote: > > [src/dns.c:2502]: (error) Memory leak: buffer > > > > > > I do not see any "buffer" usage except conditional free. > > should we just

Re: another cppcheck finding

2017-10-03 Thread Willy Tarreau
Hi Ilya, [also CCing Baptiste] On Tue, Oct 03, 2017 at 05:25:17PM +0500, ??? wrote: > [src/dns.c:2502]: (error) Memory leak: buffer > > > I do not see any "buffer" usage except conditional free. > should we just remove "buffer" from there ? I think you're referring to this part :

another cppcheck finding

2017-10-03 Thread Илья Шипицин
hello! [src/dns.c:2502]: (error) Memory leak: buffer I do not see any "buffer" usage except conditional free. should we just remove "buffer" from there ? Cheers, Ilya Shipitsin

Re: cppcheck finding

2017-09-15 Thread Cyril Bonté
Hi all, Le 15/09/2017 à 18:40, Willy Tarreau a écrit : I once had an interesting discussion with PHK who proposed to extend the varnish test program to also cover haproxy so that we could write various test cases, as he wrote this tool to address exactly the same issue. It could be an option,

Re: cppcheck finding

2017-09-15 Thread Willy Tarreau
On Fri, Sep 15, 2017 at 03:04:26PM +0200, Christopher Faulet wrote: > You're right, there are bugs there. The worst is on the compression filter. > I attached patches to fix them. > > Willy, could you merge it please ? Some of them must be backported in 1.7. Now applied, thanks Christopher.

Re: cppcheck finding

2017-09-15 Thread Willy Tarreau
Hi Aleks, On Fri, Sep 15, 2017 at 06:29:42PM +0200, Aleksandar Lazic wrote: > Hi. > > Willy Tarreau wrote on 15.09.2017: > > > On Fri, Sep 15, 2017 at 06:36:20PM +0500, ??? wrote: > >> I'd say, it's chicken and egg situation. Whichever comes first, tests or > >> CI. > >> if we start a

Re: cppcheck finding

2017-09-15 Thread Илья Шипицин
2017-09-15 21:29 GMT+05:00 Aleksandar Lazic : > Hi. > > Willy Tarreau wrote on 15.09.2017: > > > On Fri, Sep 15, 2017 at 06:36:20PM +0500, ??? wrote: > >> I'd say, it's chicken and egg situation. Whichever comes first, tests > or CI. > >> if we start a CI with "just

Re: cppcheck finding

2017-09-15 Thread Aleksandar Lazic
Hi. Willy Tarreau wrote on 15.09.2017: > On Fri, Sep 15, 2017 at 06:36:20PM +0500, ??? wrote: >> I'd say, it's chicken and egg situation. Whichever comes first, tests or CI. >> if we start a CI with "just build", it will evolve, people will start >> writing tests (I beleive so) > I

Re: cppcheck finding

2017-09-15 Thread Willy Tarreau
On Fri, Sep 15, 2017 at 06:36:20PM +0500, ??? wrote: > I'd say, it's chicken and egg situation. Whichever comes first, tests or CI. > if we start a CI with "just build", it will evolve, people will start > writing tests (I beleive so) I tend to believe it as well. However what I'm less

Re: cppcheck finding

2017-09-15 Thread Илья Шипицин
2017-09-15 18:22 GMT+05:00 Christopher Faulet : > Le 15/09/2017 à 15:07, Илья Шипицин a écrit : > >> and what about CI ? >> >> something like gitlab-ci, travis, jenkins ? I'll invest some efforts in >> that >> >> > No CI. This would be useful to have one but we have no time

Re: cppcheck finding

2017-09-15 Thread Christopher Faulet
Le 15/09/2017 à 15:07, Илья Шипицин a écrit : and what about CI ? something like gitlab-ci, travis, jenkins ? I'll invest some efforts in that No CI. This would be useful to have one but we have no time to work on it for now. Having a CI is not a big deal. The harder is to write tests and

Re: cppcheck finding

2017-09-15 Thread Илья Шипицин
and what about CI ? something like gitlab-ci, travis, jenkins ? I'll invest some efforts in that 2017-09-15 18:04 GMT+05:00 Christopher Faulet : > Le 15/09/2017 à 08:36, Илья Шипицин a écrit : > >> great, thank for the feedback. >> >> there're few things like that >> >>

Re: cppcheck finding

2017-09-15 Thread Christopher Faulet
Le 15/09/2017 à 08:36, Илья Шипицин a écrit : great, thank for the feedback. there're few things like that [src/flt_http_comp.c:926] -> [src/flt_http_comp.c:926]: (warning) Either the condition 'txn' is redundant or there is possible null pointer dereference: txn. [src/flt_spoe.c:2765] ->

Re: cppcheck finding

2017-09-15 Thread Илья Шипицин
great, thank for the feedback. there're few things like that [src/flt_http_comp.c:926] -> [src/flt_http_comp.c:926]: (warning) Either the condition 'txn' is redundant or there is possible null pointer dereference: txn. [src/flt_spoe.c:2765] -> [src/flt_spoe.c:2766]: (warning) Either the

Re: cppcheck finding

2017-09-15 Thread Willy Tarreau
Hello Ilya, On Thu, Sep 14, 2017 at 11:11:36PM +0500, ??? wrote: > hello, > > [src/flt_http_comp.c:926] -> [src/flt_http_comp.c:926]: (warning) Either > the condition 'txn' is redundant or there is possible null pointer > dereference: txn. > > should there be && instead of || ? You're

cppcheck finding

2017-09-14 Thread Илья Шипицин
hello, [src/flt_http_comp.c:926] -> [src/flt_http_comp.c:926]: (warning) Either the condition 'txn' is redundant or there is possible null pointer dereference: txn. should there be && instead of || ? Cheers, Ilya Shipitsin