mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02:00
BUG/MEDIUM: errors: include missing obj_type file
A tiny change in commit 6af81f80f ("MEDIUM: errors: implement parsing context type") triggered an awful bug in gcc 5 and below (4.7.4 to 5.5 confirmed affected, at least on aarch64/mips/x86_64) causing the startup to loop forever in acl_find_target(). This was tracked down to the acl.c file seeing a different definition of the struct proxy than other files. The reason for this is that it sees an unpacked "enum obj_type" (4 bytes) while others see it packed (1 byte), thus all fields in the struct are having a different alignment, and the "acl" list is shifted one pointer to the next struct and seems to loop onto itself. The commit above did nothing more than adding "enum obj_type *obj" in a new struct without including obj_type.h, and that was apparently enough for the compiler to internally declare obj_type as a regular enum and silently ignore the packed attribute that it discovers later, so depending on the order of includes, some files would see it as 1 byte and others as 4. This patch simply adds the missing include but due to the nature of the bug, probably that creating a special "packed_enum" definition to disable the packed attribute on such compilers could be a safer option. No backport is needed as this is only in -dev.
This commit is contained in:
parent
3faf0cbba6
commit
c12bf9af0b
@ -26,6 +26,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include <haproxy/buf-t.h>
|
||||
#include <haproxy/obj_type-t.h>
|
||||
|
||||
/* These flags may be used in various functions which are called from within
|
||||
* loops (eg: to start all listeners from all proxies). They provide enough
|
||||
|
Loading…
x
Reference in New Issue
Block a user