FTBFS of Dovecot 2.2.25 in Ubuntu due to -Bsymbolic-functions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dovecot (Ubuntu) |
Fix Released
|
High
|
Christian Ehrhardt |
Bug Description
I was wondering about a crash when building dovecot 2.2.25 on latest Ubuntu.
I wondered as I've had the same source building on Debian just fine.
Some debugging led me to this weird behavior:
Using this gdb command file called autoreportissue in my case:
break dcrypt_initialize
commands
p dcrypt_vfs
p &dcrypt_vfs
watch dcrypt_vfs
c
end
break dcrypt_set_vfs
commands
p dcrypt_vfs
p &dcrypt_vfs
c
end
r
Running test-crypto on Debian and Ubuntu reported those two behaviours:
gdb -d /root/dovecot-
Good:
Breakpoint 1, dcrypt_initialize (backend=
15 if (dcrypt_vfs != NULL) {
$1 = (struct dcrypt_vfs *) 0x0
$2 = (struct dcrypt_vfs **) 0x555555796370 <dcrypt_vfs>
Hardware watchpoint 3: dcrypt_vfs
Breakpoint 2, dcrypt_set_vfs (vfs=0x7ffff7835020 <dcrypt_
56 dcrypt_vfs = vfs;
$3 = (struct dcrypt_vfs *) 0x0
$4 = (struct dcrypt_vfs **) 0x555555796370 <dcrypt_vfs>
Hardware watchpoint 3: dcrypt_vfs
Old value = (struct dcrypt_vfs *) 0x0
New value = (struct dcrypt_vfs *) 0x7ffff7835020 <dcrypt_
dcrypt_set_vfs (vfs=0x7ffff7835020 <dcrypt_
57 }
Bad:
Breakpoint 1, dcrypt_initialize (backend=
11 {
$1 = (struct dcrypt_vfs *) 0x0
$2 = (struct dcrypt_vfs **) 0x555555798370 <dcrypt_vfs>
Hardware watchpoint 3: dcrypt_vfs
Breakpoint 2, dcrypt_set_vfs (vfs=0x7ffff780a020 <dcrypt_
56 dcrypt_vfs = vfs;
$3 = (struct dcrypt_vfs *) 0x0
$4 = (struct dcrypt_vfs **) 0x7ffff780a890 <dcrypt_vfs>
Panic: file dcrypt.c: line 34 (dcrypt_
Error: Raw backtrace: /root/dovecot-
Program received signal SIGABRT, Aborted.
One can see that in the bad case the pointer of dcrypt_vfs is pointing to something of the scope of the .libs/libdcrypt
That made me wonder even more - where would this issue of variable scope come from. After more debugging I found that the linker flag "-Bsymbolic-
Eventually what happens is that the dcrypt_vfs becomes part of the .libs/libdcrypt
I was unable to come up with a reasonable fix since I'm not enough into your sublib structure.
For now - on the merge - I'm adding a workaround to strip this flag in Ubuntu as other packages with the same issue did the same.
I'll write it in a way to make it Debian includeable if they are willing to accept to reduce more delta later on.
Changed in dovecot (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → High |
assignee: | nobody → ChristianEhrhardt (paelzer) |
I made some experiments if the smaller diff of adding "--dynamic- list-data" would be enough. functions" , but not for global symbols.
That would keep the effect of the otherwise default "-Bsymbolic-
Since the debugged case was for a variable that might have helped, but it did not. functions" option.
Therefore the solution is like in several other packages to strip the "-Bsymbolic-
I reported to upstream Dovecot in the hope to one day be able to drop the delta.
In case that fails the fix is guarded by a "ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes)".
That is used in other non-delta packages for similar things to make it into Debian.