grosjo / fts-xapian

Dovecot FTS plugin based on Xapian
GNU Lesser General Public License v2.1
97 stars 21 forks source link

undefined symbol _ZTIN6icu_668ByteSinkE #42

Closed JohnRDOrazio closed 4 years ago

JohnRDOrazio commented 4 years ago

I have attempted to compile fts-xapian on Ubuntu 16.04. After updating the system icu to the latest version 66.1 the compile completed without errors and fts-xapian was installed to the dovecot modules. I added the configurations to dovecot.conf as per the readme, but I am seeing this error in my maillog: Error: Couldn't load required plugin /usr/lib/dovecot/modules/lib21_fts_xapian_plugin.so: dlopen() failed: /usr/lib/dovecot/modules/lib21_fts_xapian_plugin.so: undefined symbol: _ZTIN6icu_668ByteSinkE I'm pretty much a novice when it comes to compiling, what could be wrong here? Any suggestions how to fix? I found a similar issue in a mailing list where someone said they checked their linking and it seemed correct, in fact if I issue ldd /usr/lib/dovecot/modules/lib21_fts_xapian_plugin.so I get this, which seems good to me:

        linux-vdso.so.1 =>  (0x00006f7de3cbf000)
        libxapian.so.30 => /usr/lib/x86_64-linux-gnu/libxapian.so.30 (0x00006f7de3658000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00006f7de32d0000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00006f7de2f00000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00006f7de2ce8000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00006f7de2ae0000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00006f7de28c0000)
        libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00006f7de26b8000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00006f7de23a8000)
        /lib64/ld-linux-x86-64.so.2 (0x00006f7de3c98000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00006f7de2188000)

In the same mailing list it seemed like they found a solution by "changing external C", but I have no idea what that means. Might there be a problem with a version of one of the external libraries that's being linked against?

JohnRDOrazio commented 4 years ago

looking closer at the "undefined symbol", I see it has something to do with ICU 66. https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/classicu_1_1ByteSink.html

Any ideas how to fix this?

grosjo commented 4 years ago

Are you actually using the command on the https://github.com/grosjo/fts-xapian/blob/master/README.md to compile the module ?

It seems the module is not linked to ICU at all (libicu* shall appear in the ldd)

JohnRDOrazio commented 4 years ago

Yes I am following instructions exactly as on the Readme. You are right, it doesn't seem to be linked to ICU. Any suggestion on how to make this happen? If I issue icu-config --version I get '66.1'. If I issue pkg-config --cflags-only-I icu-uc icu-io icu-i18n I get an empty line, is it supposed to be empty? I have tried to recompile again but still the same error.

JohnRDOrazio commented 4 years ago

Does the libicu-dev version have to match the system ICU version? I have updated ICU on the system to 66.1 but I see that libicu-dev is at version 65.1.

$ apt install libicu-dev
libicu-dev is already at the most recent version (65.1-1+ubuntu16.04.1+deb.sury.org+1)

If I try to download and install http://launchpadlibrarian.net/469393757/libicu-dev_66.1-2ubuntu2_amd64.deb I get this error (translated from Italian): Some packages cannot be installed. This might mean that there is an impossible situation or, if you are using a development distribution, that some required packages have not yet been created or have been removed (from / by) Incoming. This information may help to solve the situation: The following packages have unmet dependencies: libicu-dev : Dipends: libicu66 (= 66.1-2ubuntu2) but it is not installable Dipends: icu-devtools (>= 66.1-2ubuntu2) E: Impossible to correct the problems, there are blocked damaged packages.

grosjo commented 4 years ago

Please try pkg-config --libs icu-uc icu-io icu-i18n and pkg-config --libs-only-L icu-uc

JohnRDOrazio commented 4 years ago

I tried $ pkg-config --libs icu-uc icu-io icu-i18n which gave me: -licuio -licui18n -licuuc -licudata Looking better already. Then I followed these steps again:

autoreconf -vi
./configure --with-dovecot=/path/to/dovecot
make
sudo make install

I enabled fts_xapian plugin in dovecot.conf, and now I'm not seeing any errors. I think that solved it.

EDIT: sorry it didn't solve it. I'm still getting the same error. I'll try the second option. $ pkg-config --libs-only-L icu-uc gives me an empty line again.

grosjo commented 4 years ago

the configure command shall be in your case : "./configure --with-dovecot=/usr/lib/dovecot/"

JohnRDOrazio commented 4 years ago

Yes obviously, I used /usr/lib/dovecot/. I tried now to install ICU 65.1, and then try to compile fts_xapian again. Now when I restart dovecot I see this in the maillog: Error: Couldn't load required plugin /usr/lib/dovecot/modules/lib21_fts_xapian_plugin.so: Module is for different ABI version 2.2.ABIv22(2.2.22) (we have 2.3.ABIv9(2.3.9.2))

grosjo commented 4 years ago

think about removing the file /usr/lib/dovecot/modules/lib21_fts_xapian_plugin.so

then recompile

It seems you have a conflict between whay you installed from your distrib and what you compiled yourself

On 2020-04-04 21:23, JohnRDOrazio wrote:

Yes obviously, I used /usr/lib/dovecot/. I tried now to install ICU 55.1, and then try to compile fts_xapian again. Now when I restart dovecot I see this in the maillog: Error: Couldn't load required plugin /usr/lib/dovecot/modules/lib21_fts_xapian_plugin.so: Module is for different ABI version 2.2.ABIv22(2.2.22) (we have 2.3.ABIv9(2.3.9.2))

-- You are receiving this because you commented. Reply to this email directly, view it on GitHub [1], or unsubscribe [2].

Links:

[1] https://github.com/grosjo/fts-xapian/issues/42#issuecomment-609084248 [2] https://github.com/notifications/unsubscribe-auth/AAROMB2DFQ6PMDY5C4PGZWLRK6JMJANCNFSM4LZAYXCQ

JohnRDOrazio commented 4 years ago

I didn't have an fts_xapian from my distribution, and I do delete before each compile. Anyways I just tried again, I deleted the three files: lib21_fts_xapian_plugin.a lib21_fts_xapian_plugin.la lib21_fts_xapian_plugin.so

Recompiled, restarted mail services. And I am still seeing this error pop up now in maillog: Error: Couldn't load required plugin /usr/lib/dovecot/modules/lib21_fts_xapian_plugin.so: Module is for different ABI version 2.2.ABIv22(2.2.22) (we have 2.3.ABIv9(2.3.9.2))

Does it have anything to do with me compiling the source ICU icu4c-65_1-src.tgz instead of using the Ubuntu 18.04 icu4c-65_1-Ubuntu18.04-x64.tgz ? Since I have Ubuntu 16.04 I wasn't sure if the pre-compiled Ubuntu18.04 would have worked.

I might also add that I'm on an OVH server which has it's version of the Ubuntu kernel, I don't know if that has anything to do with it. $ uname -r gives me this: 3.14.32-vps-grs-ipv6-64

JohnRDOrazio commented 4 years ago

Sorry I wrote ICU 55.1, I meant I downgraded to ICU 65.1 so it corresponds with libicu-dev. I see that others had the same ABI problem and solved simply by recompiling fts_xapian: https://forum.directadmin.com/threads/dovecot-2-3-10-released.60761/ I will maybe try to reach out on OVH forums and see if anyone has any ideas there?

JohnRDOrazio commented 4 years ago

I think I see the problem. dovecot-dev package is at v2.2.22 while dovecot is at v2.3.9.2

grosjo commented 4 years ago

Yes If I were you, I would take dovecot git, pigeonhole git and fts_xapian git and recompile them all

There are my compilation parameters

Dovecot:

./autogen.sh
PANDOC=false CPPFLAGS="-I/include -I/usr/include/tirpc/" LDFLAGS="-L/lib -ltirpc" ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libexec=/usr/libexec --with-sql=yes --without-sqlite --with-mysql --with-ssl --without-shadow --without-nss --without-pam --without-ldap --with-zlib --with-bzlib --with-libwrap --with-libcap --without-solr --without-gssapi --without-docs --without-sia --without-pgsql --without-lucene --without-stemmer
make clean
make -j16

Pigeonhole

./autogen.sh
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --with-dovecot=../dovecot --with-managesieve=yes --with-unfinished-features=no --with-dovecot-install-dirs --without-ldap
make clean
make -j16

fts_xapian

autoreconf -vi
./configure --with-dovecot=/usr/lib/dovecot
make clean
make
make install
JohnRDOrazio commented 4 years ago

I see that if I add the official dovecot repo to my sources.list, I now have a proposal for update on dovecot-dev to v2.3.10-2 . Will this work with dovecot v2.3.9.2? Or do you think it will still complain about ABI version?

grosjo commented 4 years ago

or uninstall dovecot , uninstall pigeonhole properly, and reinstall them from CenteOS and then recompile fts-xapian

grosjo commented 4 years ago

sorry , I meant Ubuntu, not CentOS

grosjo commented 4 years ago

You may use official repo of Ubuntu. Install from there. This plugin wors with any version of dovecot from 2.2

grosjo commented 4 years ago

You can use also dovecot repo, with any recent version. THe only thing is to rebuild fts-xapian after upgrade

grosjo commented 4 years ago

Have you sorted out ?

grosjo commented 4 years ago

@JohnRDOrazio Shall I close the issue ?

JohnRDOrazio commented 4 years ago

You can close the issue, I believe we pinpointed the problem. I haven't sorted it out yet because I use Plesk on this system, and I realized that Plesk had updated Dovecot. So I opened a topic on the Plesk forum asking if it would be possible to have a plesk-dovecot-dev package alongside the plesk-dovecot package. Or even better, a plesk-fts-xapian package. I don't want to have to recompile everything from scratch overriding the Plesk installation...

grosjo commented 4 years ago

ok