Plugin ABI compat between v2.3.8 and v2.3.9
Hi all!
This is my first post on this list. Please pardon me if I overlooked or misunderstood some things.
I had some imap crashes (sig11) starting at the end of 2019 after an upgrade of dovecot.
I found out, that I didn't have any problems using version v2.3.8, but any version v2.3.9 and higher would trigger the crashes.
After investigating more deeply and creating a core dump, I saw that the crash happened in an external plugin fetchmail_wakeup[1].
After recompiling that plugin with up to date dovecot headers, I didn't get crashes anymore.
So I suspect there were ABI incompatible changes and it was forgotten to bump the minimum Plugin-ABI version supported.
I could try to follow up some more details, but it would be quite a burden because of rebuilding the plugin with debug symbols against version 2.3.8 of dovecot and triggering the crash etc.
Despite that I think it should be possible to detect changes that are ABI incompatible, as otherwise plugin users would always have to find out first hand with unknown consequences.
That said there could be a possibility of the plugin using the API/ABI in an invalid way. If that was the cause, then the plugin should be changed.
Hope this report turns out to help improve the situation. I don't have problems currently and will in future be sensitive to this specific possible cause of problems, but not having such crashes in the first place, would be worth it and maybe could still help others.
Best regards, Alexander
1: slightly reduced version of: https://github.com/marschap/fetchmail_wakeup
On 2020-06-15, Alexander Strasser <eclipse7@gmx.net> wrote:
I had some imap crashes (sig11) starting at the end of 2019 after an upgrade of dovecot.
I found out, that I didn't have any problems using version v2.3.8, but any version v2.3.9 and higher would trigger the crashes.
After investigating more deeply and creating a core dump, I saw that the crash happened in an external plugin fetchmail_wakeup[1].
After recompiling that plugin with up to date dovecot headers, I didn't get crashes anymore.
So I suspect there were ABI incompatible changes and it was forgotten to bump the minimum Plugin-ABI version supported.
dovecot-2.3.8/configure #define DOVECOT_ABI_VERSION "2.3.ABIv8($PACKAGE_VERSION)"
dovecot-2.3.9/configure #define DOVECOT_ABI_VERSION "2.3.ABIv9($PACKAGE_VERSION)"
Did you disable version checking? (version_ignore = yes)
Hi!
On 2020-06-16 12:37 -0000, Stuart Henderson wrote:
On 2020-06-15, Alexander Strasser <eclipse7@gmx.net> wrote:
I had some imap crashes (sig11) starting at the end of 2019 after an upgrade of dovecot.
I found out, that I didn't have any problems using version v2.3.8, but any version v2.3.9 and higher would trigger the crashes.
After investigating more deeply and creating a core dump, I saw that the crash happened in an external plugin fetchmail_wakeup[1].
After recompiling that plugin with up to date dovecot headers, I didn't get crashes anymore.
So I suspect there were ABI incompatible changes and it was forgotten to bump the minimum Plugin-ABI version supported.
dovecot-2.3.8/configure #define DOVECOT_ABI_VERSION "2.3.ABIv8($PACKAGE_VERSION)"
dovecot-2.3.9/configure #define DOVECOT_ABI_VERSION "2.3.ABIv9($PACKAGE_VERSION)"
Did you disable version checking? (version_ignore = yes)
Thanks for the hint.
I couldn't find version_ignore anywhere in the configs. I also don't remember having changed it.
It's interesting that the ABI check didn't snap.
Alexander
On 2020-06-16 20:32 +0200, Alexander Strasser wrote:
On 2020-06-16 12:37 -0000, Stuart Henderson wrote:
On 2020-06-15, Alexander Strasser <eclipse7@gmx.net> wrote:
I had some imap crashes (sig11) starting at the end of 2019 after an upgrade of dovecot.
I found out, that I didn't have any problems using version v2.3.8, but any version v2.3.9 and higher would trigger the crashes.
After investigating more deeply and creating a core dump, I saw that the crash happened in an external plugin fetchmail_wakeup[1].
After recompiling that plugin with up to date dovecot headers, I didn't get crashes anymore.
So I suspect there were ABI incompatible changes and it was forgotten to bump the minimum Plugin-ABI version supported.
dovecot-2.3.8/configure #define DOVECOT_ABI_VERSION "2.3.ABIv8($PACKAGE_VERSION)"
dovecot-2.3.9/configure #define DOVECOT_ABI_VERSION "2.3.ABIv9($PACKAGE_VERSION)"
Did you disable version checking? (version_ignore = yes)
Thanks for the hint.
I couldn't find version_ignore anywhere in the configs. I also don't remember having changed it.
It's interesting that the ABI check didn't snap.
If I'm on the right track and the code src/lib/module-dir.c is responsible for loading plugins and doing the ABI check, then I think it does only check ABI compat for modules that define a symbol named <module-name>_version .
At first this looks a bit unsafe to me.
Though it explains why in my case there was no ABI check failing, as I found out the plugin does not define a version symbol.
The implementation should be really trivial, so I guess I will add it to the plugin.
I find the behaviour a bit surprising, but as I understand now, it's the plugin's fault and not a missed ABI bump in dovecot as I initially suspected.
Thanks for pointing me in the right direction.
Alexander
On 2020-06-16 22:47 +0200, Alexander Strasser wrote:
On 2020-06-16 20:32 +0200, Alexander Strasser wrote:
On 2020-06-16 12:37 -0000, Stuart Henderson wrote:
On 2020-06-15, Alexander Strasser <eclipse7@gmx.net> wrote:
I had some imap crashes (sig11) starting at the end of 2019 after an upgrade of dovecot.
[...]
So I suspect there were ABI incompatible changes and it was forgotten to bump the minimum Plugin-ABI version supported.
dovecot-2.3.8/configure #define DOVECOT_ABI_VERSION "2.3.ABIv8($PACKAGE_VERSION)"
dovecot-2.3.9/configure #define DOVECOT_ABI_VERSION "2.3.ABIv9($PACKAGE_VERSION)"
Did you disable version checking? (version_ignore = yes)
Thanks for the hint.
I couldn't find version_ignore anywhere in the configs. I also don't remember having changed it.
It's interesting that the ABI check didn't snap.
If I'm on the right track and the code src/lib/module-dir.c is responsible for loading plugins and doing the ABI check, then I think it does only check ABI compat for modules that define a symbol named <module-name>_version .
At first this looks a bit unsafe to me.
Though it explains why in my case there was no ABI check failing, as I found out the plugin does not define a version symbol.
The implementation should be really trivial, so I guess I will add it to the plugin.
I played around with the version in the plugin. This seems to work. If the plugin ABI version is different from the dovecot ABI version, the plugin is not loaded and a warning is printed:
imap(beastd-mail): Error: Couldn't load required plugin /usr/lib/dovecot/modules/lib_fetchmail_wakeup_plugin.so: Module is for different ABI version 1.2.3 (we have 2.3.ABIv10(2.3.10.1))
I find the behaviour a bit surprising, but as I understand now, it's the plugin's fault and not a missed ABI bump in dovecot as I initially suspected.
I'm still not sure why the behaviour is to assume a compatible ABI if no version is found. I would be curious, so if someone knows...
[...]
Alexander
participants (2)
-
Alexander Strasser
-
Stuart Henderson