Re: "Bus error" in dns_build_query on SPARC/Solaris 10

2016-04-03 Thread Willy Tarreau
On Sun, Apr 03, 2016 at 01:52:16PM +0200, Vincent Bernat wrote: > >l = calloc(1, sizeof(*l)); > > So, I did that too. Great! > >> 1. can we remove uneeded void* cast? > > > > As much as possible yes! > > OK, done. I did not consider casts of simple types (char*, ...) if they > were not

Re: "Bus error" in dns_build_query on SPARC/Solaris 10

2016-04-03 Thread Vincent Bernat
❦ 29 mars 2016 16:52 +0200, Willy Tarreau  : >> l = calloc(1, sizeof(struct listener)); > > I definitely agree. This code is quite old (2005) and we don't do that > much cleanup passes unfortunately. Oh and yes by the way, in case people > have doubts about this, I wrote it and used

Re: "Bus error" in dns_build_query on SPARC/Solaris 10

2016-03-29 Thread Baptiste
On Sat, Mar 26, 2016 at 7:16 PM, Vincent Bernat wrote: > ❦ 26 mars 2016 23:40 +0600, Александр Лебедев > : > >> Hi, Vincent! Thanks for your answer! >> I made some tests today. Yes, it crashes only if hostname contains an >> odd number of

Re: "Bus error" in dns_build_query on SPARC/Solaris 10

2016-03-29 Thread Willy Tarreau
On Tue, Mar 29, 2016 at 01:04:44PM -0700, Maciej Katafiasz wrote: > On 29 March 2016 at 07:52, Willy Tarreau wrote: > > On Sun, Mar 27, 2016 at 05:41:08PM +0200, Vincent Bernat wrote: > >> Willy, you always cast for functions returning void*. This is not > >> needed. For example: >

Re: "Bus error" in dns_build_query on SPARC/Solaris 10

2016-03-29 Thread Maciej Katafiasz
On 29 March 2016 at 07:52, Willy Tarreau wrote: > On Sun, Mar 27, 2016 at 05:41:08PM +0200, Vincent Bernat wrote: >> Willy, you always cast for functions returning void*. This is not >> needed. For example: >> >> l = (struct listener *)calloc(1, sizeof(struct listener)); >> >> Could

Re: "Bus error" in dns_build_query on SPARC/Solaris 10

2016-03-29 Thread Willy Tarreau
On Tue, Mar 29, 2016 at 05:44:17PM +0200, Vincent Bernat wrote: > ??? 29 mars 2016 17:27 +0200, Willy Tarreau  : > > >> > >> @@ > >> type T; > >> @@ > >> > >> - (T\( \|\)*) > >> (\(lua_touserdata\|malloc\|calloc\)(...)) > >> > >> So, I can rebase the patch as long as it's

Re: "Bus error" in dns_build_query on SPARC/Solaris 10

2016-03-29 Thread Vincent Bernat
❦ 29 mars 2016 17:27 +0200, Willy Tarreau  : >> >> @@ >> type T; >> @@ >> >> - (T\( \|\)*) >> (\(lua_touserdata\|malloc\|calloc\)(...)) >> >> So, I can rebase the patch as long as it's needed. > > Perfect. Then I'll try to flush the large queue ASAP so that we can > apply such

Re: "Bus error" in dns_build_query on SPARC/Solaris 10

2016-03-29 Thread Willy Tarreau
On Tue, Mar 29, 2016 at 05:03:23PM +0200, Vincent Bernat wrote: > OK, so, I'll propose a patch for this, including the sizeof() change (or > another patch for the sizeof() change?). For the record, I don't do this > manually, I use a semantic patch like this: > > @@ > type T; > @@ > > - (T\(

Re: "Bus error" in dns_build_query on SPARC/Solaris 10

2016-03-29 Thread Vincent Bernat
❦ 29 mars 2016 16:52 +0200, Willy Tarreau  : >l = calloc(1, sizeof(*l)); [...] >> I can propose a (large) patch to remove all those casts (using a >> semantic patch to not miss anything). Here is a preview (for master, >> only src/): >> >>

Re: "Bus error" in dns_build_query on SPARC/Solaris 10

2016-03-29 Thread Willy Tarreau
Hi Vincent, On Sun, Mar 27, 2016 at 05:41:08PM +0200, Vincent Bernat wrote: > I am trying to look if there are other cases of alignment problem. Some > time ago, gcc was emitting a warning if this was the case (-Wcast-align) > but there was too many false positives and this is not the case

Re: "Bus error" in dns_build_query on SPARC/Solaris 10

2016-03-27 Thread Vincent Bernat
❦ 26 mars 2016 18:16 +0100, Vincent Bernat  : >> Hi, Vincent! Thanks for your answer! >> I made some tests today. Yes, it crashes only if hostname contains an >> odd number of symbols! > > So, it should be easy to fix. Baptiste, do you want a patch or are my > explanations

Re: "Bus error" in dns_build_query on SPARC/Solaris 10

2016-03-26 Thread Vincent Bernat
❦ 26 mars 2016 23:40 +0600, Александр Лебедев   : > Hi, Vincent! Thanks for your answer! > I made some tests today. Yes, it crashes only if hostname contains an > odd number of symbols! So, it should be easy to fix. Baptiste, do you want a patch or are my

Re: "Bus error" in dns_build_query on SPARC/Solaris 10

2016-03-26 Thread Александр Лебедев
Hi, Vincent! Thanks for your answer! I made some tests today. Yes, it crashes only if hostname contains an odd number of symbols! Alexander 2016-03-26 22:04 GMT+06:00 Vincent Bernat : > ❦ 26 mars 2016 08:33 +0100, Baptiste : > > >> When I use resolvers check

Re: "Bus error" in dns_build_query on SPARC/Solaris 10

2016-03-26 Thread Vincent Bernat
❦ 26 mars 2016 08:33 +0100, Baptiste  : >> When I use resolvers check in 1.6.3 haproxy, it is crashed with "Bus error". >> pstack with core file shows me: >> >> 000a6d1c dns_build_query (11f921, 1c, 16a650, 21, 11f8f0, 1238f0) + a8 >> 000a6d58 dns_send_query (16a698, 10be18, 0,

Re: "Bus error" in dns_build_query on SPARC/Solaris 10

2016-03-26 Thread Baptiste
On Sat, Mar 26, 2016 at 7:44 AM, Александр Лебедев wrote: > Hello! > > When I use resolvers check in 1.6.3 haproxy, it is crashed with "Bus error". > pstack with core file shows me: > > 000a6d1c dns_build_query (11f921, 1c, 16a650, 21, 11f8f0, 1238f0) + a8 >

"Bus error" in dns_build_query on SPARC/Solaris 10

2016-03-26 Thread Александр Лебедев
Hello! When I use resolvers check in 1.6.3 haproxy, it is crashed with "Bus error". pstack with core file shows me: 000a6d1c dns_build_query (11f921, 1c, 16a650, 21, 11f8f0, 1238f0) + a8 000a6d58 dns_send_query (16a698, 10be18, 0, 13ac90, 0, 8f1b) + 24 00048f28 trigger_resolution (169db8,