2015-06-12 8:18 GMT+02:00 joris dedieu <[email protected]>:
> 2015-06-12 0:47 GMT+02:00 joris dedieu <[email protected]>:
>> Hi Willy,
>> 2015-06-11 17:04 GMT+02:00 Willy Tarreau <[email protected]>:
>>> Hi Joris,
>>
>>>
>>> On Thu, Jun 11, 2015 at 03:57:27PM +0200, joris dedieu wrote:
>>>> Ok. I have checked out the main repo
>>>> I'm at 28b48ccbc879a552f988e6e1db22941e3362b4db
>>> (...)
>>>
>>>> Same issue same solution with minor adjustments for the patch to apply
>>>>
>>>> Joris
>>>>
>>>> diff --git a/include/common/compat.h b/include/common/compat.h
>>>> index ecbc3b1..48ea1f7 100644
>>>> --- a/include/common/compat.h
>>>> +++ b/include/common/compat.h
>>>> @@ -27,6 +27,8 @@
>>>>  #include <sys/types.h>
>>>>  #include <sys/socket.h>
>>>>  #include <arpa/inet.h>
>>>> +#include <common/config.h>
>>>> +#include <common/standard.h>
>>>>
>>>>  #ifndef BITS_PER_INT
>>>>  #define BITS_PER_INT    (8*sizeof(int))
>>>> diff --git a/include/common/config.h b/include/common/config.h
>>>> index 27b8f14..5833cfc 100644
>>>> --- a/include/common/config.h
>>>> +++ b/include/common/config.h
>>>> @@ -23,7 +23,6 @@
>>>>  #define _COMMON_CONFIG_H
>>>>
>>>>  #include <common/compiler.h>
>>>> -#include <common/compat.h>
>>>>  #include <common/defaults.h>
>>>>
>>>>  /* this reduces the number of calls to select() by choosing appropriate
>>>> diff --git a/include/types/global.h b/include/types/global.h
>>>> index b3b9672..3812771 100644
>>>> --- a/include/types/global.h
>>>> +++ b/include/types/global.h
>>>> @@ -25,7 +25,6 @@
>>>>  #include <netinet/in.h>
>>>>
>>>>  #include <common/config.h>
>>>> -#include <common/standard.h>
>>>>  #include <import/da.h>
>>>>  #include <types/freq_ctr.h>
>>>>  #include <types/listener.h>
>>>
>>> Since in theory that doesn't make sense at all, I suspect that we're falling
>>> into a case of a #ifndef <something> where <something> is defined on your
>>> platform.
>>>
>>> Could you please try the following with and without the patch above :
>>>
>>>   make clean
>>>   make [your usual options] DEBUG_CFLAGS="-dM -E"
>>>
>>> It will not complete, as it will dump all known defines into each .o file.
>>> By archiving them between the builds, you can diff the trees and see if
>>> a define appears/disappears from one .o file (probably the one where you
>>> see the crash). I'd bet that we'll find that FreeBSD uses a macro with a
>>> similar name as one in haproxy and that it changes a struct size or
>>> something depending on how the .h are included.
>>
>> Thanks for the tip !  I have not found the guilty header for now but I
>> will continue to search it tomorrow
>>
>> 2 files attached :
>>
>> - headers.diff (the output of diff -Nru)
>> - defined.txt with the output of a small script with things like
>>
>> upstream : src/sessionhash.o : #define MAXSYMLINKS 32
>> patched : src/uri_auth.o : #define _POSIX_OPEN_MAX 20
>>
>> MAXSYMLINKS 32 is defined in sessionhash.o without the patch but not with it
>> _POSIX_OPEN_MAX 20 is defined in uri_auth.o patched but not in
>> upstream version ...
>
> Hi,
>
> Here the list of the values that differ between one version and the
> other. You can see that without the patch (last value) some haproxy
> default apply to some values. I continue this way.
>
> Joris
>
> src/protocol.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/standard.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/chunk.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/queue.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/buffer.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/memory.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/namespace.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/freq_ctr.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/map.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/pipe.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/proto_http.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/stick_table.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/pattern.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/haproxy.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/listener.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/regex.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/frontend.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/raw_sock.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/auth.o    SHRT_MAX    __SHRT_MAX    __SHRT_MAX__
> src/auth.o    SCHAR_MIN    __SCHAR_MIN    (-SCHAR_MAX - 1)
> src/auth.o    SHRT_MIN    __SHRT_MIN    (-SHRT_MAX - 1)
> src/auth.o    SCHAR_MAX    __SCHAR_MAX    __SCHAR_MAX__
> src/auth.o    LONG_MAX    __LONG_MAX    __LONG_MAX__
> src/auth.o    USHRT_MAX    __USHRT_MAX    (SHRT_MAX * 2 + 1)
> src/auth.o    LONG_MIN    __LONG_MIN    (-LONG_MAX - 1L)
> src/auth.o    ULONG_MAX    __ULONG_MAX    (LONG_MAX * 2UL + 1UL)
> src/auth.o    CHAR_BIT    __CHAR_BIT    __CHAR_BIT__
> src/auth.o    UCHAR_MAX    __UCHAR_MAX    (SCHAR_MAX * 2 + 1)
> src/auth.o    INT_MAX    __INT_MAX    __INT_MAX__
> src/auth.o    INT_MIN    __INT_MIN    (-INT_MAX - 1)
> src/auth.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/auth.o    UINT_MAX    __UINT_MAX    (INT_MAX * 2U + 1U)
> src/acl.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/checks.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/base64.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/time.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/payload.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/appsession.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/session.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/stream.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/sample.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/uri_auth.o    SHRT_MAX    __SHRT_MAX    __SHRT_MAX__
> src/uri_auth.o    SCHAR_MIN    __SCHAR_MIN    (-SCHAR_MAX - 1)
> src/uri_auth.o    SHRT_MIN    __SHRT_MIN    (-SHRT_MAX - 1)
> src/uri_auth.o    SCHAR_MAX    __SCHAR_MAX    __SCHAR_MAX__
> src/uri_auth.o    LONG_MAX    __LONG_MAX    __LONG_MAX__
> src/uri_auth.o    USHRT_MAX    __USHRT_MAX    (SHRT_MAX * 2 + 1)
> src/uri_auth.o    LONG_MIN    __LONG_MIN    (-LONG_MAX - 1L)
> src/uri_auth.o    ULONG_MAX    __ULONG_MAX    (LONG_MAX * 2UL + 1UL)
> src/uri_auth.o    CHAR_BIT    __CHAR_BIT    __CHAR_BIT__
> src/uri_auth.o    UCHAR_MAX    __UCHAR_MAX    (SCHAR_MAX * 2 + 1)
> src/uri_auth.o    INT_MAX    __INT_MAX    __INT_MAX__
> src/uri_auth.o    INT_MIN    __INT_MIN    (-INT_MAX - 1)
> src/uri_auth.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/uri_auth.o    UINT_MAX    __UINT_MAX    (INT_MAX * 2U + 1U)
> src/channel.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/backend.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/arg.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/signal.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/stream_interface.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/task.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/hdr_idx.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/sessionhash.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/log.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64
> src/applet.o    MAX_HOSTNAME_LEN    MAXHOSTNAMELEN    64

All those one are innocents. Including sys/limits.h on common/compat.h
correct  those differences and not the segfault.

Joris

diff --git a/include/common/compat.h b/include/common/compat.h
index ecbc3b1..d0153e7 100644
--- a/include/common/compat.h
+++ b/include/common/compat.h
@@ -22,6 +22,7 @@
 #ifndef _COMMON_COMPAT_H
 #define _COMMON_COMPAT_H

+#include <sys/limits.h>
 /* This is needed on Linux for Netfilter includes */
 #include <sys/param.h>
 #include <sys/types.h>


>
>
>>
>> I also confirm that the issue appends with the binary package provided
>> by FreeBSD as net/haproxy-devel
>>
>> Best regards
>> Joris
>>>
>>> Thanks,
>>> Willy
>>>

Reply via email to