BIND 9.11.4 terminates with SIGBUS error when compiled with Oracle Developer Studio 12.6
Summary
Since 9.11.4, when I compile BIND with Oracle Developer Studio 12.6 on Solaris 11, the process terminates with a SIGBUS error shortly after it has been started. This only started with 9.11.4. 9.11.3 worked fine, using the same built host and the same compile-time options.
When using GCC (v4.8.2), and using the same compile options, the process does not terminate and runs fine.
Steps to reproduce
Build any version of BIND 9.11.4 with Oracle Developer Studio 12.6 and using the following compile-time options:
===============================================================================
Configuration summary:
-------------------------------------------------------------------------------
Optional features enabled:
Multiprocessing support (--enable-threads)
Mutex lock type: adaptive
Large-system tuning (--with-tuning)
GSS-API (--with-gssapi)
Algorithm: aes
IPv6 support (--enable-ipv6)
OpenSSL cryptography/DNSSEC (--with-openssl)
Python tools (--with-python)
XML statistics (--with-libxml2)
JSON statistics (--with-libjson)
HTTP zlib compression (--with-zlib)
ECDSA algorithm support (--with-ecdsa)
Print backtrace on crash (--enable-backtrace)
Use symbol table for backtrace, named only (--enable-symtable)
Dynamically loadable zone (DLZ) drivers:
None
-------------------------------------------------------------------------------
Features disabled or unavailable on this platform:
Allow 'dnstap' packet logging (--enable-dnstap)
GeoIP access control (--with-geoip)
Allow 'fixed' rrset-order (--enable-fixed-rrset)
PKCS#11/Cryptoki support (--with-pkcs11)
Native PKCS#11/Cryptoki support (--enable-native-pkcs11)
GOST algorithm support (--with-gost)
EDDSA algorithm support (--with-eddsa)
Use libseccomp system call filtering (--enable-seccomp)
Very verbose query trace logging (--enable-querytrace)
Use GNU libtool (--with-libtool)
Automated Testing Framework (--with-atf)
LMDB database to store configuration for 'addzone' zones (--with-lmdb)
IDN support (--with-libidn2)
-------------------------------------------------------------------------------
Configured paths:
prefix: /prod/bind9
sysconfdir: /etc
localstatedir: /var
===============================================================================
What is the current bug behavior?
Once started, BIND seems to be starting up fine, the last log message is that it is running:
29-Aug-2018 15:20:37.394 notice: all zones loaded
29-Aug-2018 15:20:37.601 notice: running
However, shortly after the "running" log message the process is terminating without logging any errors (not even with debug log level 3).
Checking the core file that is generated I see the following:
> ::status
debugging core file of named (64-bit)
file: /prod/bind9/sbin/named
initial argv: /prod/bind9/sbin/named -u named -t /chroot -c /etc/named.conf
threading model: native threads
status: process terminated by SIGBUS (Bus Error), addr=ffffffff7aaff92f
> $C
ffffffff7aafee61 named`process_cmsg+0x174(1124dcae0, ffffffff7aaffa78, 1124e1540, 100819118, 3c, 100870440)
ffffffff7aafefb1 named`doio_recv+0x958(1124dcae0, 1124e1540, 80000000, 100819118, 3c, 100870440)
ffffffff7aaff351 named`internal_recv+0x50c(10a4423f0, 1124dcb98, 1124dcb98, 1006e77e0, ffffffff7c00d240, ff000000)
ffffffff7aaff4c1 named`dispatch+0xb50(100892700, 0, 0, ffffffff7c00d240, ffffffff7c00d240, ff000000)
ffffffff7aaff6a1 named`run+0x18(100892700, 0, 0, 1006b64b0, 0, 1)
ffffffff7aaff751 libc.so.1`_lwp_start(0, 0, 0, 0, 0, 0)
Running a truss on the process returns this:
20325/7: lwp_park(0x00000000, 0) = 0
20325/11: ioctl(9, DP_POLL, 0xFFFFFFFF7A1FFF08) = 1
20325/9: write(8, "\0\00216FFFFFFFD", 8) = 8
20325/11: read(6, "\0\00216FFFFFFFD", 8) = 8
20325/7: recvmsg(529, 0xFFFFFFFF7AAFFA78, 32768) = 28
20325/9: connect(534, 0x10D4E87B8, 32, SOV_XPG4_2) = 0
20325/11: write(9, "\0\00216\001\0\0", 8) = 8
20325/9: sendmsg(534, 0xFFFFFFFF7A6FEB50, 32768) = 40
20325/11: read(6, 0xFFFFFFFF7A1FFBA0, 8) Err#11 EAGAIN
20325/7: Incurred fault #5, FLTACCESS %pc = 0x1006DC384
20325/7: siginfo: SIGBUS BUS_ADRALN addr=0xFFFFFFFF7AAFF92F
20325/2: getrandom(0xFFFFFFFF7B4FE10C, 4, 0) = 4
20325/7: Received signal #10, SIGBUS [default]
20325/7: siginfo: SIGBUS BUS_ADRALN addr=0xFFFFFFFF7AAFF92F
20325/9: getrandom(0xFFFFFFFF7A6FE79C, 4, 0) = 4
What is the expected correct behavior?
BIND to start up and answer queries as usual.
Relevant configuration files
Can be provided, if required, but I don't think configuration is an issue as it works fine when compiling BIND with GCC and using the same BIND config.
Possible fixes
Use GCC instead of Oracle Developer Studio compiler