Closed symphorien closed 3 years ago
This has no link with the plugin, right ? (according to the debug data)
Yes it does, as it disappears if I downgrade. Surely fts_xapian is corrupting some memory that segfaults later in dovecot.
Log under valgrind suggest the segfault happens just after fts_xapian returns:
server # 2021-11-11T09:52:21.702939+00:00 server dovecot: imap(user1@example.com)<1461><xChKTIDQSp/AqAEB>: FTS Xapian: Index path = /var/vmail/example.com/user1/xapian-indexes
server # [ 55.850037] dovecot[1009]: imap(user1@example.com)<1461><xChKTIDQSp/AqAEB>: Debug: Namespace : /var/vmail/example.com/user1 doesn't exist yet, using default permissions
server # [ 55.851668] dovecot[1009]: imap(user1@example.com)<1461><xChKTIDQSp/AqAEB>: Debug: Namespace : Using permissions from /var/vmail/example.com/user1: mode=0700 gid=default
server # 2021-11-11T09:52:21.710702+00:00 server dovecot: imap(user1@example.com)<1461><xChKTIDQSp/AqAEB>: Debug: Namespace : /var/vmail/example.com/user1 doesn't exist yet, using default p>
server # 2021-11-11T09:52:21.712333+00:00 server dovecot: imap(user1@example.com)<1461><xChKTIDQSp/AqAEB>: Debug: Namespace : Using permissions from /var/vmail/example.com/user1: mode=0700 >
server # [ 55.858304] dovecot[1009]: imap(user1@example.com)<1461><xChKTIDQSp/AqAEB>: FTS Xapian: Starting with partial=2 full=20 verbose=1 lowmemory=200
server # 2021-11-11T09:52:21.718969+00:00 server dovecot: imap(user1@example.com)<1461><xChKTIDQSp/AqAEB>: FTS Xapian: Starting with partial=2 full=20 verbose=1 lowmemory=200
server # [ 55.873913] dovecot[1009]: imap(user1@example.com)<1461><xChKTIDQSp/AqAEB>: Debug: quota: quota_over_flag check: quota_over_script unset - skipping
server # 2021-11-11T09:52:21.734576+00:00 server dovecot: imap(user1@example.com)<1461><xChKTIDQSp/AqAEB>: Debug: quota: quota_over_flag check: quota_over_script unset - skipping
server # [ 55.882177] rspamd[1451]: <bmwaxo>; upstream; rspamd_upstream_fail: upstream 127.0.0.1 failed; reason: timeout waiting reply
server # [ 55.883363] rspamd[1451]: <>; rdns; rdns_process_timer: reschedule request with id: 14567
server # 2021-11-11T09:52:21.742841+00:00 server rspamd[1451]: <bmwaxo>; upstream; rspamd_upstream_fail: upstream 127.0.0.1 failed; reason: timeout waiting reply
server # 2021-11-11T09:52:21.744030+00:00 server rspamd[1451]: <>; rdns; rdns_process_timer: reschedule request with id: 14567
server # [ 55.886819] rspamd[1451]: <>; ; rspamd_dns_select_upstream_retransmit: select forced 127.0.0.1
server # [ 55.888295] rspamd[1451]: <bmwaxo>; upstream; rspamd_upstream_fail: upstream 127.0.0.1 failed; reason: timeout waiting reply
server # 2021-11-11T09:52:21.747483+00:00 server rspamd[1451]: <>; ; rspamd_dns_select_upstream_retransmit: select forced 127.0.0.1
server # 2021-11-11T09:52:21.748960+00:00 server rspamd[1451]: <bmwaxo>; upstream; rspamd_upstream_fail: upstream 127.0.0.1 failed; reason: timeout waiting reply
server # [ 55.893712] rspamd[1451]: <>; rdns; rdns_process_timer: reschedule request with id: 9337
server # [ 55.895303] rspamd[1451]: <>; ; rspamd_dns_select_upstream_retransmit: select forced 127.0.0.1
server # 2021-11-11T09:52:21.754376+00:00 server rspamd[1451]: <>; rdns; rdns_process_timer: reschedule request with id: 9337
server # 2021-11-11T09:52:21.755968+00:00 server rspamd[1451]: <>; ; rspamd_dns_select_upstream_retransmit: select forced 127.0.0.1
server # [ 55.930083] dovecot[1009]: imap: Error: ==1461== Invalid read of size 8
server # 2021-11-11T09:52:21.790747+00:00 server dovecot: imap: Error: ==1461== Invalid read of size 8
server # [ 55.931885] dovecot[1009]: imap: Error: ==1461== at 0x51A74D2: fts_user_autoindex_exclude.cold (fts-user.c:347)
server # 2021-11-11T09:52:21.792549+00:00 server dovecot: imap: Error: ==1461== at 0x51A74D2: fts_user_autoindex_exclude.cold (fts-user.c:347)
server # [ 55.934571] dovecot[1009]: imap: Error: ==1461== by 0x51B0685: fts_mailbox_allocated (fts-storage.c:806)
server # 2021-11-11T09:52:21.795236+00:00 server dovecot: imap: Error: ==1461== by 0x51B0685: fts_mailbox_allocated (fts-storage.c:806)
server # 2021-11-11T09:52:21.797845+00:00 server dovecot: imap: Error: ==1461== by 0x48B7E87: hook_mailbox_allocated (mail-storage-hooks.c:256)
server # [ 55.937180] dovecot[1009]: imap: Error: ==1461== by 0x48B7E87: hook_mailbox_allocated (mail-storage-hooks.c:256)
server # [ 55.941311] dovecot[1009]: imap: Error: ==1461== by 0x48B3008: mailbox_alloc (mail-storage.c:885)
server # [ 55.943485] dovecot[1009]: imap: Error: ==1461== by 0x123585: select_open (cmd-select.c:285)
server # 2021-11-11T09:52:21.801976+00:00 server dovecot: imap: Error: ==1461== by 0x48B3008: mailbox_alloc (mail-storage.c:885)
server # 2021-11-11T09:52:21.804150+00:00 server dovecot: imap: Error: ==1461== by 0x123585: select_open (cmd-select.c:285)
server # [ 55.947278] dovecot[1009]: imap: Error: ==1461== by 0x123585: cmd_select_full (cmd-select.c:416)
server # 2021-11-11T09:52:21.807943+00:00 server dovecot: imap: Error: ==1461== by 0x123585: cmd_select_full (cmd-select.c:416)
server # [ 55.950415] dovecot[1009]: imap: Error: ==1461== by 0x12B4E3: command_exec (imap-commands.c:201)
server # [ 55.953618] dovecot[1009]: imap: Error: ==1461== by 0x1294DE: client_command_input (imap-client.c:1230)
server # 2021-11-11T09:52:21.811079+00:00 server dovecot: imap: Error: ==1461== by 0x12B4E3: command_exec (imap-commands.c:201)
server # 2021-11-11T09:52:21.814284+00:00 server dovecot: imap: Error: ==1461== by 0x1294DE: client_command_input (imap-client.c:1230)
server # 2021-11-11T09:52:21.821083+00:00 server dovecot: imap: Error: ==1461== by 0x129589: client_command_input (imap-client.c:1297)
server # [ 55.960418] dovecot[1009]: imap: Error: ==1461== by 0x129589: client_command_input (imap-client.c:1297)
server # [ 55.962951] dovecot[1009]: imap: Error: ==1461== by 0x129A04: client_handle_next_command (imap-client.c:1339)
server # 2021-11-11T09:52:21.823616+00:00 server dovecot: imap: Error: ==1461== by 0x129A04: client_handle_next_command (imap-client.c:1339)
server # [ 55.966629] dovecot[1009]: imap: Error: ==1461== by 0x129A04: client_handle_input (imap-client.c:1353)
server # 2021-11-11T09:52:21.827294+00:00 server dovecot: imap: Error: ==1461== by 0x129A04: client_handle_input (imap-client.c:1353)
server # [ 55.975239] dovecot[1009]: imap: Error: ==1461== by 0x129F6F: client_input (imap-client.c:1397)
server # [ 55.976252] dovecot[1009]: imap: Error: ==1461== by 0x4ADCC88: io_loop_call_io (ioloop.c:737)
server # 2021-11-11T09:52:21.835902+00:00 server dovecot: imap: Error: ==1461== by 0x129F6F: client_input (imap-client.c:1397)
server # [ 55.976252] dovecot[1009]: imap: Error: ==1461== by 0x4ADCC88: io_loop_call_io (ioloop.c:737)
server # 2021-11-11T09:52:21.835902+00:00 server dovecot: imap: Error: ==1461== by 0x129F6F: client_input (imap-client.c:1397)
server # 2021-11-11T09:52:21.836919+00:00 server dovecot: imap: Error: ==1461== by 0x4ADCC88: io_loop_call_io (ioloop.c:737)
server # [ 55.980347] dovecot[1009]: imap: Error: ==1461== by 0x4ADE321: io_loop_handler_run_internal (ioloop-epoll.c:222)
server # 2021-11-11T09:52:21.841012+00:00 server dovecot: imap: Error: ==1461== by 0x4ADE321: io_loop_handler_run_internal (ioloop-epoll.c:222)
server # [ 56.012588] dovecot[1009]: imap: Error: ==1461== by 0x4ADCD2F: io_loop_handler_run (ioloop.c:789)
server # 2021-11-11T09:52:21.873252+00:00 server dovecot: imap: Error: ==1461== by 0x4ADCD2F: io_loop_handler_run (ioloop.c:789)
server # [ 56.014879] dovecot[1009]: imap: Error: ==1461== by 0x4ADCEEF: io_loop_run (ioloop.c:762)
server # 2021-11-11T09:52:21.875530+00:00 server dovecot: imap: Error: ==1461== by 0x4ADCEEF: io_loop_run (ioloop.c:762)
server # [ 56.016842] dovecot[1009]: imap: Error: ==1461== by 0x4A509F2: master_service_run (master-service.c:863)
server # 2021-11-11T09:52:21.877507+00:00 server dovecot: imap: Error: ==1461== by 0x4A509F2: master_service_run (master-service.c:863)
server # [ 56.019133] dovecot[1009]: imap: Error: ==1461== by 0x11AF89: main (main.c:564)
server # [ 56.019962] dovecot[1009]: imap: Error: ==1461== Address 0x50 is not stack'd, malloc'd or (recently) free'd
server # 2021-11-11T09:52:21.879799+00:00 server dovecot: imap: Error: ==1461== by 0x11AF89: main (main.c:564)
server # 2021-11-11T09:52:21.880629+00:00 server dovecot: imap: Error: ==1461== Address 0x50 is not stack'd, malloc'd or (recently) free'd
server # [ 56.023130] dovecot[1009]: imap: Error: ==1461==
server # [ 56.023725] dovecot[1009]: imap: Error: ==1461==
server # 2021-11-11T09:52:21.883796+00:00 server dovecot: imap: Error: ==1461==
server # 2021-11-11T09:52:21.884392+00:00 server dovecot: imap: Error: ==1461==
server # [ 56.025640] dovecot[1009]: imap: Error: ==1461== Process terminating with default action of signal 11 (SIGSEGV): dumping core
Since address is 0x50, maybe fts_xapian is returning a null pointer when it shouldn't ?
I bisected the bug down to 8b97b97ded078540e21458412ccba29998045574
It looks like you forgot to add the new AC_DEFINED variable to fts-xapian-config.h.in: here is the content of fts-xapian-config.h after ./configure:
/* fts-xapian-config.h. Generated from fts-xapian-config.h.in by configure. */
#define FTS_XAPIAN_NAME "Dovecot FTS Xapian"
#define FTS_XAPIAN_VERSION "1.5.0"
then DOVECOT_VERSION_MINOR_MINOR is undefined and CHECK_VERSION is false when it should be true.
you can compile with -Wundef to see that:
In file included from fts-xapian-plugin.c:4:
fts-xapian-plugin.c: In function 'fts_xapian_mail_user_created':
fts-xapian-plugin.h:50:83: warning: "DOVECOT_VERSION_MINOR_MINOR" is not defined, evaluates to 0 [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wundef-Wundef8;;]
50 | #define CHECK_VERSION() (DOVECOT_VERSION_MAJOR > 2 || DOVECOT_VERSION_MINOR >3 || DOVECOT_VERSION_MINOR_MINOR > 16)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
fts-xapian-plugin.c:104:5: note: in expansion of macro 'CHECK_VERSION'
104 | #if CHECK_VERSION()
| ^~~~~~~~~~~~~
Please try with latest git
Running dovecot during configure is incompatible with cross-compilation. Using ac_package version was better. Maybe you could do the version comparison inside ./configure with https://www.gnu.org/software/autoconf-archive/ax_compare_version.html instead of in the c preprocessor ?
@symphorien how to get the current dovecot version from the configure.ac file ?
@cmouse any idea on this topic of having "DOVECOT_VERSION" from configure.ac ?
Maybe an approach like this could work:
AC_MSG_CHECKING([Whether fts_mail_user_init has 3 args])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[
#include "dovecot/lib.h"
#include "dovecot/fts-user.h"
void f(struct mail_user *s, const char **error) {
fts_mail_user_init(s, 0, error);
}
]])], [
AC_MSG_RESULT([yes])
AC_DEFINE([FTS_MAIL_USER_INIT_3_ARGS], [1], ["yay"])
], [
AC_MSG_RESULT([no])
AC_DEFINE([FTS_MAIL_USER_INIT_3_ARGS], [0], ["yay"])
])
but I get weird errors including dovecot headers:
configure:18147: checking Whether fts_mail_user_init has 3 args
configure:18166: gcc -c -std=gnu99 -fstack-protector-strong -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 conftest.c >&5
In file included from /nix/store/v15ahq9q9yps4k88mniyj3fwl12r38r1-dovecot-2.3.16/include/dovecot/lib.h:26,
from conftest.c:24:
/nix/store/v15ahq9q9yps4k88mniyj3fwl12r38r1-dovecot-2.3.16/include/dovecot/compat.h:68:4: error: #error uoff_t size not set
68 | # error uoff_t size not set
| ^~~~~
In file included from /nix/store/q141hd8jl7in5223jmf7kmx9h517km4p-glibc-2.32-54-dev/include/sys/socket.h:33,
from /nix/store/v15ahq9q9yps4k88mniyj3fwl12r38r1-dovecot-2.3.16/include/dovecot/compat.h:154,
from /nix/store/v15ahq9q9yps4k88mniyj3fwl12r38r1-dovecot-2.3.16/include/dovecot/lib.h:26,
from conftest.c:24:
/nix/store/q141hd8jl7in5223jmf7kmx9h517km4p-glibc-2.32-54-dev/include/bits/socket.h:33:21: error: conflicting types for 'socklen_t'
33 | typedef __socklen_t socklen_t;
| ^~~~~~~~~
In file included from /nix/store/v15ahq9q9yps4k88mniyj3fwl12r38r1-dovecot-2.3.16/include/dovecot/lib.h:26,
from conftest.c:24:
/nix/store/v15ahq9q9yps4k88mniyj3fwl12r38r1-dovecot-2.3.16/include/dovecot/compat.h:88:13: note: previous declaration of 'socklen_t' was here
88 | typedef int socklen_t;
| ^~~~~~~~~
In file included from /nix/store/v15ahq9q9yps4k88mniyj3fwl12r38r1-dovecot-2.3.16/include/dovecot/lib.h:26,
from conftest.c:24:
/nix/store/v15ahq9q9yps4k88mniyj3fwl12r38r1-dovecot-2.3.16/include/dovecot/compat.h:181:8: error: redefinition of 'struct iovec'
181 | struct iovec {
| ^~~~~
In file included from /nix/store/q141hd8jl7in5223jmf7kmx9h517km4p-glibc-2.32-54-dev/include/sys/socket.h:26,
from /nix/store/v15ahq9q9yps4k88mniyj3fwl12r38r1-dovecot-2.3.16/include/dovecot/compat.h:154,
from /nix/store/v15ahq9q9yps4k88mniyj3fwl12r38r1-dovecot-2.3.16/include/dovecot/lib.h:26,
from conftest.c:24:
/nix/store/q141hd8jl7in5223jmf7kmx9h517km4p-glibc-2.32-54-dev/include/bits/types/struct_iovec.h:26:8: note: originally defined here
26 | struct iovec
| ^~~~~
In file included from /nix/store/v15ahq9q9yps4k88mniyj3fwl12r38r1-dovecot-2.3.16/include/dovecot/lib.h:27,
from conftest.c:24:
/nix/store/v15ahq9q9yps4k88mniyj3fwl12r38r1-dovecot-2.3.16/include/dovecot/mempool.h: In function 'p_malloc':
/nix/store/v15ahq9q9yps4k88mniyj3fwl12r38r1-dovecot-2.3.16/include/dovecot/mempool.h:104:35: error: 'SSIZE_T_MAX' undeclared (first use in this function); did you mean 'SSIZE_MAX'?
104 | if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
| ^~~~~~~~~~~~~~~~~~~
/nix/store/v15ahq9q9yps4k88mniyj3fwl12r38r1-dovecot-2.3.16/include/dovecot/mempool.h:104:35: note: each undeclared identifier is reported only once for each function it appears in
/nix/store/v15ahq9q9yps4k88mniyj3fwl12r38r1-dovecot-2.3.16/include/dovecot/mempool.h: In function 'p_realloc':
/nix/store/v15ahq9q9yps4k88mniyj3fwl12r38r1-dovecot-2.3.16/include/dovecot/mempool.h:113:43: error: 'SSIZE_T_MAX' undeclared (first use in this function); did you mean 'SSIZE_MAX'?
113 | if (unlikely(new_size == 0 || new_size > POOL_MAX_ALLOC_SIZE))
| ^~~~~~~~~~~~~~~~~~~
In file included from /nix/store/v15ahq9q9yps4k88mniyj3fwl12r38r1-dovecot-2.3.16/include/dovecot/lib.h:49,
from conftest.c:24:
/nix/store/v15ahq9q9yps4k88mniyj3fwl12r38r1-dovecot-2.3.16/include/dovecot/strnum.h: At top level:
/nix/store/v15ahq9q9yps4k88mniyj3fwl12r38r1-dovecot-2.3.16/include/dovecot/strnum.h:167:34: error: unknown type name 'uoff_t'; did you mean 'off_t'?
167 | int str_to_uoff(const char *str, uoff_t *num_r)
| ^~~~~~
| off_t
/nix/store/v15ahq9q9yps4k88mniyj3fwl12r38r1-dovecot-2.3.16/include/dovecot/strnum.h:169:37: error: unknown type name 'uoff_t'; did you mean 'off_t'?
169 | int str_parse_uoff(const char *str, uoff_t *num_r,
| ^~~~~~
| off_t
conftest.c:26:35: warning: 'struct mail_user' declared inside parameter list will not be visible outside of this definition or declaration
@symphorien Please kindly try latest git
You need this for it to work correctly:
diff --git a/configure.ac b/configure.ac
index 5e428a2..106e813 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,6 +47,7 @@ AC_COMPILE_IFELSE(
#include "dovecot/config.h"
#include "dovecot/lib.h"
#include "dovecot/mail-user.h"
+ #include "dovecot/fts-user.h"
void f(struct mail_user *s, const char **error) {
fts_mail_user_init(s, 0, error);
}
otherwise the compilation succeeds even for dovecot 2.3.16: in config.log:
configure:18061: checking Whether fts_mail_user_init has 3 args
configure:18082: gcc -c -std=gnu99 -fstack-protector-strong -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 conftest.c >&5
conftest.c: In function 'f':
conftest.c:26:23: warning: implicit declaration of function 'fts_mail_user_init'; did you mean 'mail_user_init'? [-Wimplicit-function-declaration]
26 | fts_mail_user_init(s, 0, error);
| ^~~~~~~~~~~~~~~~~~
| mail_user_init
configure:18082: $? = 0
configure:18085: result: yes
Now it doestn't compile anymore with dovecot 2.3.13 I ran autoreconf -fsi and reran ./configure:
/bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -O2 -I/usr/include/dovecot -DFTS_MAIL_USER_INIT_THREE_ARGS=1 -g -O2 -std=gnu99 -fstack-protector-strong -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -MT fts-xapian-plugin.lo -MD -MP -MF .deps/fts-xapian-plugin.Tpo -c -o fts-xapian-plugin.lo fts-xapian-plugin.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -O2 -I/usr/include/dovecot -DFTS_MAIL_USER_INIT_THREE_ARGS=1 -g -O2 -std=gnu99 -fstack-protector-strong -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -MT fts-xapian-plugin.lo -MD -MP -MF .deps/fts-xapian-plugin.Tpo -c fts-xapian-plugin.c -fPIC -DPIC -o .libs/fts-xapian-plugin.o
fts-xapian-plugin.c: In function ‘fts_xapian_mail_user_created’:
fts-xapian-plugin.c:105:6: error: too many arguments to function ‘fts_mail_user_init’
105 | if (fts_mail_user_init(user, FALSE, &error) < 0)
| ^~~~~~~~~~~~~~~~~~
In file included from fts-xapian-plugin.h:10,
from fts-xapian-plugin.c:4:
/usr/include/dovecot/fts-user.h:21:5: note: declared here
21 | int fts_mail_user_init(struct mail_user *user, const char **error_r);
| ^~~~~~~~~~~~~~~~~~
can you try #103 (comment) ?
doestn't help. And the problem is not the missing declaration of fts_mail_user_init. The problem is that the function gained an argument in 2.3.17 which didn't exist in older versions So the old version isn't correctly detected with the git changes for #103
config.log says this about the check:
configure:16964: checking Whether fts_mail_user_init has 3 args
configure:16985: gcc -c -g -O2 -std=gnu99 -fstack-protector-strong -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 conftest.c >&5
conftest.c: In function 'f':
conftest.c:26:23: warning: implicit declaration of function 'fts_mail_user_init'; did you mean 'mail_user_init'? [-Wimplicit-function-declaration]
26 | fts_mail_user_init(s, 0, error);
| ^~~~~~~~~~~~~~~~~~
| mail_user_init
configure:16985: $? = 0
configure:16987: result: yes
Humm we are probably calling the compiler without the correct -I flags. It's not needed on my distro, but probably on yours. Can you try this ?
diff --git a/configure.ac b/configure.ac
index 5e428a2..1596be1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,7 +21,7 @@ PKG_PROG_PKG_CONFIG
DC_DOVECOT
DC_DOVECOT_MODULEDIR
LIBDOVECOT_INCLUDE="$LIBDOVECOT_INCLUDE"
-CFLAGS="$CFLAGS $EXTRA_CFLAGS"
+CFLAGS="$CFLAGS $EXTRA_CFLAGS $DOVECOT_CFLAGS"
LIBS="$DOVECOT_LIBS"
BINARY_LDFLAGS="$PIE_LDFLAGS $RELRO_LDFLAGS"
BINARY_CFLAGS="$PIE_CFLAGS"
@@ -47,6 +47,7 @@ AC_COMPILE_IFELSE(
#include "dovecot/config.h"
#include "dovecot/lib.h"
#include "dovecot/mail-user.h"
+ #include "dovecot/fts-user.h"
void f(struct mail_user *s, const char **error) {
fts_mail_user_init(s, 0, error);
}
Now it works.
Mmh probably this prevents false positives because of implicit function declaration:
diff --git a/configure.ac b/configure.ac
index 5e428a2..74ec31d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,7 +21,7 @@ PKG_PROG_PKG_CONFIG
DC_DOVECOT
DC_DOVECOT_MODULEDIR
LIBDOVECOT_INCLUDE="$LIBDOVECOT_INCLUDE"
-CFLAGS="$CFLAGS $EXTRA_CFLAGS"
+CFLAGS="$CFLAGS $EXTRA_CFLAGS $DOVECOT_CFLAGS"
LIBS="$DOVECOT_LIBS"
BINARY_LDFLAGS="$PIE_LDFLAGS $RELRO_LDFLAGS"
BINARY_CFLAGS="$PIE_CFLAGS"
@@ -40,13 +40,39 @@ ICU_LIBS=$($PKG_CONFIG --libs icu-uc icu-io icu-i18n)
ICU_CFLAGS=$($PKG_CONFIG --cflags-only-I icu-uc icu-io icu-i18n)
ICU_INCLUDE=$($PKG_CONFIG --variable=includedir icu-uc)
-AC_MSG_CHECKING([Whether fts_mail_user_init has 3 args])
+AC_MSG_CHECKING([for fts_mail_user_init])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#include "dovecot/config.h"
#include "dovecot/lib.h"
#include "dovecot/mail-user.h"
+ #include "dovecot/fts-user.h"
+ void f() {
+ void *ptr = &fts_mail_user_init;
+ (void)ptr;
+ return 0;
+ }
+ ]])],
+ [
+ AC_MSG_RESULT([yes])
+ ],[
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([fts_mail_user_init not found in
+ dovecot/fts-user.h, dovecot is not installed
+ correctly])
+ ])
+
+AC_MSG_CHECKING([whether fts_mail_user_init has 3 args])
+dnl this check incorrectly concludes yes if the headers
+dnl don't contain fts_mail_user_init because of implicit function declaration,
+dnl hence the previous check
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include "dovecot/config.h"
+ #include "dovecot/lib.h"
+ #include "dovecot/mail-user.h"
+ #include "dovecot/fts-user.h"
void f(struct mail_user *s, const char **error) {
fts_mail_user_init(s, 0, error);
}
Please check latest git
Please check latest git
compiles fine with old dovecot 2.3.13
@symphorien issue solved ?
Yes thanks
@grosjo, did this issue intentionally force -O2
?
CFLAGS="$CFLAGS $EXTRA_CFLAGS $DOVECOT_FLAGS -O2"
I believe this means that user-supplied CFLAGS
/ EXTRA_CFLAGS
can't override the -O
level.
I asked/noticed because Gentoo's CI noticed and flagged it: https://bugs.gentoo.org/887887
This segfault does not happen when I downgrade to 1.4.14
dovecot 2.3.17