Open tacerus opened 7 months ago
Can you provide the configure line that was used for the build? You can usually get it from head -10 config.log
in the build directory. Please feel free to censor any sensitive details if necessary.
Here's mine, for example:
ellie@debian:master:~/fastmail/cyrus-imapd$head -10 config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by cyrus-imapd configure 3.11.0-alpha0-337-g1bca21baf, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ ./configure PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/home/ellie/bin:/home/ellie/fastmail/cyrus-build-tools:/usr/local/cyruslibs/bin 'CFLAGS=-g -O0 -Wall -Wextra -Werror -Wl,--as-needed -fstack-protector-all ' 'CXXFLAGS=-g -O0 -Wall -Wextra -Werror -fstack-protector-all ' --prefix=/dev/shm/cyrus/main --enable-http --enable-calalarmd --enable-unit-tests --enable-replication --with-openssl=yes --enable-nntp --enable-murder --enable-idled --enable-event-notification --enable-sieve --enable-autocreate --enable-silent-rules --enable-backup --with-lmdb --enable-xapian --enable-jmap --with-ldap
## --------- ##
## Platform. ##
If you're able to, can you also capture the "Cyrus Server configured components" information that's printed to stdout by configure? It's not logged anywhere, so to get it you'll need to run configure again, and capture it from there. It'll be the last ~80 or so lines.
I'm particularly interested in seeing what regex library you're configured to use, because it smells like that's where the issue is coming from. We mostly only test with PCRE/PCRE2, so if you're using something else, Cyrus might be doing something that's incompatible with it that we haven't noticed.
Hi @elliefm, thanks for getting back, and sure!
$ ./configure --host=x86_64-suse-linux-gnu --build=x86_64-suse-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/lib --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --disable-dependency-tracking --localstatedir=/var/lib --enable-autocreate --enable-idled --enable-murder --enable-nntp --enable-replication --enable-gssapi --enable-unit-tests --enable-xapian --with-com_err --with-cyrus-user=cyrus --prefix=/usr --libexecdir=/usr/lib/cyrus --with-gnu-ld --with-gss_impl=auto --with-ldap --with-libwrap --with-lock=fcntl --with-openssl --with-perl=perl --with-sasl --with-syslogfacility=DAEMON --with-zlib
[ 42s] Cyrus Server configured components
[ 42s]
[ 42s] gssapi: yes
[ 42s] autocreate: yes
[ 42s] idled: yes
[ 42s] httpd: no
[ 42s] kerberos V4: no
[ 42s] murder: yes
[ 42s] nntpd: yes
[ 42s] replication: yes
[ 42s] sieve: yes
[ 42s] srs: no
[ 42s] calalarmd: no
[ 42s] jmap: no
[ 42s] objectstore: no
[ 42s] backup: no
[ 42s] com_err: yes
[ 42s]
[ 42s] External dependencies:
[ 42s] ldap: yes
[ 42s] openssl: yes
[ 42s] zlib: yes
[ 42s] jansson: yes
[ 42s] pcre: yes
[ 42s] pcre2: no
[ 42s] clamav: yes
[ 42s] -----------------------
[ 42s] caringo: no
[ 42s] openio: no
[ 42s] -----------------------
[ 42s] nghttp2: no (httpd is not built)
[ 42s] wslay: no (httpd is not built)
[ 42s] brotli: no (httpd is not built)
[ 42s] zstd: no (httpd is not built)
[ 42s] xml2: no (httpd is not built)
[ 42s] ical: no (httpd is not built)
[ 42s] shapelib: no (httpd is not built)
[ 42s] icu4c: yes
[ 42s] chardet: no
[ 42s] cld2: no
[ 42s] guesstz: no
[ 42s]
[ 42s] Database support:
[ 42s] mysql: no
[ 42s] postgresql: no
[ 42s] sqlite: yes
[ 42s] zeroskip: no
[ 42s]
[ 42s] Search engine:
[ 42s] squat: yes
[ 42s] xapian: yes
[ 42s] xapian_cjk_tokens: ngrams
[ 42s]
[ 42s] Documentation dependencies:
[ 42s] sphinx-build:
[ 42s] Pod::POM::View::Restructured: no
[ 42s] GitPython: no
[ 42s]
[ 42s] Installation directories:
[ 42s] prefix: /usr
[ 42s] sysconfdir: /etc
[ 42s]
[ 42s] Build info:
[ 42s] shared: yes
[ 42s] static: no
[ 42s] cflags: -W -Wno-unused-parameter -g -O0 -Wall -Wextra -Werror -fPIC
[ 42s] cxxflags: -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-prote
ction -g
[ 42s] libs: -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lkrb5support -lpcreposix -lpcre -lz -lsqlite3
[ 42s] ldflags:
[ 42s] libm: -lm
[ 42s] unit tests (cunit): yes
[ 42s]
Given your hint, I now also tested building against pcre2 - same configure line and output as above, except for
[ 31s] pcre: no
[ 31s] pcre2: yes
However, that unfortunately does not let me use cyradm, hence I cannot test the issue at hand:
cyradm --auth login -u cyrus localhost
Can't load '/usr/lib/perl5/vendor_perl/5.26.1/x86_64-linux-thread-multi/auto/Cyrus/IMAP/IMAP.so' for module Cyrus::IMAP: /usr/lib/perl5/vendor_perl/5.26.1/x86_64-linux-thread-multi/auto/Cyrus/IMAP/IMAP.so: undefined symbol: pcre2_regexec at /usr/lib/perl5/5.26.1/x86_64-linux-thread-multi/DynaLoader.pm line 193.
at /usr/lib/perl5/vendor_perl/5.26.1/x86_64-linux-thread-multi/Cyrus/IMAP/Admin.pm line 43.
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.26.1/x86_64-linux-thread-multi/Cyrus/IMAP/Admin.pm line 43.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.26.1/x86_64-linux-thread-multi/Cyrus/IMAP/Admin.pm line 43.
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.26.1/x86_64-linux-thread-multi/Cyrus/IMAP/Shell.pm line 59.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.26.1/x86_64-linux-thread-multi/Cyrus/IMAP/Shell.pm line 59.
Compilation failed in require at /usr/bin/cyradm line 66.
BEGIN failed--compilation aborted at /usr/bin/cyradm line 66.
I should probably rather investigate that separately.
Now I built the Cyrus server with pcre2, and perl-Cyrus-IMAP/cyradm with pcre!
With this constellation, I can use cyradm without any segfaults on the server side.
So I think the issue in this report is only concerning legacy pcre.
Edit: upon applying a patch from Fedora to link the Perl libraries correctly, I can confirm that the full stack (server and client components) works correctly with pcre2.
What's the Fedora patch? We might be able to upstream it
I think your original crash might have just been #2629 saying hello again. The old PCRE library claimed ABI compatibility with libc, but had a different size regex_t. When an application was linked against both glibc and libpcre, it would end up calling the wrong regcomp/etc with the wrong regex_t, and crash like this. The only way to make it work is to use a PCRE built with Debian's patches (which rename the incompatible functions so they don't get in each others' way anymore). If the PCRE you were using did not have Debian's patches, then that's what the problem was.
I built the Cyrus server with pcre2, and perl-Cyrus-IMAP/cyradm with pcre!
Yeahhhh don't do that, you'll just bump into the same crash again, somewhere else 😅
The current PCRE2 doesn't have the same problem as PCRE did, so none of this matters if you can build with PCRE2.
What's the Fedora patch? We might be able to upstream it
I wanted to make a separate issue for it, the patch is this:
https://src.fedoraproject.org/rpms/cyrus-imapd/blob/rawhide/f/patch-cyrus-perl-linking
But it does not look quite right to me, because the server components do get correctly linked automatically, so I suppose the client ones should as well? And it requires the use of --disable-pcre
to work albeit the configure script reporting "No" for legacy pcre without it.
I think your original crash might have just been https://github.com/cyrusimap/cyrus-imapd/issues/2629 saying hello again.
Interesting, I did actually find that issue, but didn't pay more attention to it .. the tests all pass in my environment. Thanks for elaborating on this!
We have some patches, but none renaming functions:
https://build.opensuse.org/package/show/openSUSE:Leap:15.5:Update/pcre
Then yes, in my case it seems "resolved" with with the use of prce2. But maybe something could be done for it to fail at build or test time?
Hi,
this issue occurs on 3.8.2, which I am packaging for openSUSE, however I was able to reproduce it with 3.4.x and 3.2.12 as well.
I am generally building with:
However I also tried the CFLAGS recommended in the upstream guide (
-W -Wno-unused-parameter -g -O0 -Wall -Werror -Wextra -fPIC
) and collected the backtrace:Would appreciate any ideas! Georg