[MDEV-4601] FR: Failure to build on OpenBSD Created: 2013-05-31 Updated: 2013-06-17 Due: 2013-07-02 Resolved: 2013-06-17 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 5.5.31 |
| Fix Version/s: | 5.5.32 |
| Type: | Bug | Priority: | Major |
| Reporter: | Brad Smith | Assignee: | Vladislav Vaintroub |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | client | ||
| Environment: |
OpenBSD / Bitrig |
||
| Description |
|
MariaDB fails to build on OpenBSD / Bitrig. The code in question utilizes POSIX user contexts which has been made obsolete within POSIX (2001) 12 years ago and was removed from POSIX (2008) 5 years ago.
|
| Comments |
| Comment by Kristian Nielsen [ 2013-06-01 ] |
|
What is the bug here? ucontext is the standard way to implement co-routines, it has been available everywhere for ages. Surely OpenBSD has had it for ages also? Co-routines is an important feature to support for any OS. If Bitrig has removed ucontext for some reason, it needs to provide some other mechanism, and be prepared to port software to use the non-standard mechanism provided, right? There is an inline assembly implementation available in the source code also, if Bitrig uses the standard register convention it should be usable directly, or it could be modified as appropriate... |
| Comment by Brad Smith [ 2013-06-01 ] |
|
The bug is that new code was added which does not build and is relying upon API which is not guaranteed to be around or even work properly, as has been found on a few Linux architectures by the QEMU guys. As I said ucontext is obsolete and has been removed from POSIX. OpenBSD / Bitrig do not have ucontext support and it never existed. QEMU for example has a sigaltstack backend for its co-routine support which is used on OpenBSD / Bitrig. http://git.qemu.org/?p=qemu.git;a=blob;f=coroutine-ucontext.c;h=4bf2cde279b9ccab0d4b5e8b7b18948402a39749;hb=HEAD |
| Comment by Kristian Nielsen [ 2013-06-01 ] |
|
Thanks for the link to using sigaltstack to setup a new stack. It is interesting, though As I said coroutines is a very important (and underestimated) tool. Just Still, it is a valid feature request to add an option to use sigaltstack for coroutines Doesn't the GCC inline asm assembly work for OpenBSD/Bitrig? It is faster |
| Comment by Brad Smith [ 2013-06-01 ] |
|
Yes, the x86 GCC inline asm works on x86, but we also support, alpha / arm / hppa / m68k / m88k / mips64 / powerpc / sh / sparc / sparc64. |
| Comment by Sergei Golubchik [ 2013-06-02 ] |
|
Kristian, do you think you can quickly add a configure-time check to see what coroutine implementation to use (ucontext, assembly, etc) and disable async library completely if nothing is available? |
| Comment by Sergei Golubchik [ 2013-06-13 ] |