Perl Segmentation Fault - Oracle 12c install - Docker Mac - Mac Pro

Expected behavior

I noticed the following during testing.
Installing Oracle Express Database - oracle-xe In docker works perfect on recent Mac Pro - but attempting to test Oracle Database 12c (12.1.0.2) installation on latest Mac using Docker on Mac does not work and the same errors as was noted in Virtualbox.

Actual behavior

When running the Oracle Database Installer - in silent mode to install the Oracle 12c 12.1.0.2 Database software the installation fail with similar issue that was noticed in VirtualBox - http://dbaontap.com/2016/01/13/vbox5/
The oraclelinux:6.8 image is used and all pre-requisite packages was installed.

The main question here is it possible that the same issue noted for VirtualBox (Meaning the issue regarding the 4th cache level being passed through) could be the culprit here - and is there a possible work-around? Maybe a setting or option that can be passed in to hyperkit for the underlying vm?

Example following the silent install the end result is that the Perl in the Oracle install is producing segment faults - which will cause further issues during install - example (from within container):

[oracle@db1 bin]$ cd /u01/app/oracle/product/12.1.0.2/dbhome_1/perl/
[oracle@db1 perl]$ ls
bin  lib  man
[oracle@db1 perl]$ cd bin
[oracle@db1 bin]$ ./perl
Segmentation fault

Information

Docker for Mac info:

Docker for Mac: version: win-v1.12.0-beta19
OS X: version 10.11.5 (build: 15F34)
logs: /tmp/20160715-171200.tar.gz
[OK] docker-cli
[OK] app
[OK] moby-syslog
[OK] virtualization
[OK] menubar
[OK] system
[OK] osxfs
[OK] db
[OK] slirp
[OK] moby-console
[OK] logs
[OK] vmnetd
[OK] env
[OK] moby
[OK] driver.amd64-linux

Inside the container when looking at the CPU info I get:

[oracle@db1 bin]$ cat /proc/cpuinfo
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 70
model name	: Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
stepping	: 1
cpu MHz		: 2493.841
cache size	: 6144 KB
physical id	: 0
siblings	: 1
core id		: 0
cpu cores	: 1
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht pbe syscall nx pdpe1gb lm constant_tsc rep_good nopl xtopology nonstop_tsc eagerfpu pni pclmulqdq dtes64 ds_cpl ssse3 sdbg fma cx16 xtpr pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm arat fsgsbase bmi1 hle avx2 bmi2 erms rtm xsaveopt
bugs		:
bogomips	: 4987.68
clflush size	: 64
cache_alignment	: 64
address sizes	: 39 bits physical, 48 bits virtual
power management:



more info on CPU as seen from within a container - using lscpu command

Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             4
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 70
Model name:            Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
Stepping:              1
CPU MHz:               2492.323
BogoMIPS:              5106.80
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              6144K
L4 cache:              131072K

Steps to reproduce the behavior

The high level steps are:

  1. Use oraclelinux:6.8
  2. Install required software using yum
  3. Download the oracle database software and install it using a silent installation
  4. Note that this can be done in manual steps to see the issue

example dockerfile:

=========================================

FROM	oraclelinux:6.8                                                                                                                                                                                              
                                                                                                                                                                                                                  
MAINTAINER anton.els@orcon.net.nz                                                                                                                                                                                 
                                                                                                                                                                                                                  
USER root                                                                                                                                                                                                         
                                                                                                                                                                                                                  
# Add Oracle user and groups                                                                                                                                                                                      
#                                                                                                                                                                                                                 
RUN groupadd -g 501 oinstall \                                                                                                                                                                                    
&& groupadd -g 502 dba \                                                                                                                                                                                        
&& groupadd -g 503 oper \                                                                                                                                                                                       
&& groupadd -g 504 asmadmin \                                                                                                                                                                                   
&& groupadd -g 505 asmdba \                                                                                                                                                                                     
&& groupadd -g 506 asmoper \                                                                                                                                                                                    
&& groupadd -g 507 bkpdba \                                                                                                                                                                                     
&& groupadd -g 508 dgdba \                                                                                                                                                                                      
&& groupadd -g 509 kmdba \                                                                                                                                                                                      
&& useradd -m -g oinstall -G oinstall,dba,oper,asmadmin,asmdba,bkpdba,dgdba,kmdba -u 501 oracle \                                                                                                               
&& mkdir /install                                                                                                                                                                                               
                                                                                                                                                                                                                  
                                                                                                                                                                                                                  
RUN rpm --rebuilddb \                                                                                                                                                                                             
&& yum update -y \                                                                                                                                                                                               
&& yum -y --enablerepo=ol6_latest,ol6_optional_latest install oracle-rdbms-server-12cR1-preinstall perl wget unzip libaio glibc make binutils gcc bc sysstat lsof tar zip gzip tree strace wget which sudo net-to
&& yum clean all \                                                                                                                                                                                               
&& rm -rf /var/cache/yum/*                                                                                                                                                                                       
                                                                                                                                                                                                                  
# Copy software and response files into /install                                                                                                                                                                  
#                                                                                                                                                                                                                 
COPY	linuxamd64_12102_database_se2_1of2.zip /install/                                                                                                                                                             
COPY	linuxamd64_12102_database_se2_2of2.zip /install/                                                                                                                                                             
COPY	db_install.rsp /install/                                                                                                                                                                                     
COPY	netca.rsp /install/                                                                                                                                                                                          
COPY	dbca.rsp /install/                                                                                                                                                                                           
                                                                                                                                                                                                                  
# Create Oracle Directories                                                                                                                                                                                       
#                                                                                                                                                                                                                 
RUN mkdir -p /u01/app/oracle \                                                                                                                                                                                    
&& chown -R oracle:oinstall /u01/app \                                                                                                                                                                           
&& chown -R oracle:oinstall /install                                                                                                                                                                             
                                                                                                                                                                                                                  
# Switch to user Oracle                                                                                                                                                                                           
#                                                                                                                                                                                                                 
USER	oracle                                                                                                                                                                                                       
WORKDIR	/install                                                                                                                                                                                                 
                                                                                                                                                                                                                  
# Unzip software                                                                                                                                                                                                  
RUN	unzip linuxamd64_12102_database_se2_1of2.zip \                                                                                                                                                               
&& rm -rf linuxamd64_12102_database_se2_1of2.zip \                                                                                                                                                              
&& unzip linuxamd64_12102_database_se2_2of2.zip \                                                                                                                                                               
&& rm -rf linuxamd64_12102_database_se2_2of2.zip                                                                                                                                                                
                                                                                                                                                                                                                  
# Install Oracle Software                                                                                                                                                                                         
#                                                                                                                                                                                                                 
RUN	/install/database/runInstaller -silent -force -waitforcompletion -responsefile /install/db_install.rsp -ignoresysprereqs -ignoreprereq                                                                       
                                                                                                                                                                                                                  
                                                                                                                                                                                                                  
# Switch back to root                                                                                                                                                                                             
#                                                                                                                                                                                                                 
USER	root                                                                                                                                                                                                         
RUN	/u01/app/oraInventory/orainstRoot.sh \                                                                                                                                                                       
&& /u01/app/oracle/product/12.1.0.2/dbhome_1/root.sh -silent \                                                                                                                                                   
&& rm -rf /install/database                                                                                                                                                                                      
                                                                                                                                                                                                                  
# Config sudo                                                                                                                                                                                                     
#                                                                                                                                                                                                                 
RUN echo "oracle           ALL=(ALL)       NOPASSWD:ALL" >> /etc/sudoers \                                                                                                                                        
&& echo "Defaults !requiretty"  >> /etc/sudoers                                                                                                                                                                  
                                                                                                                                                                                                                  
# Switch back to Oracle user                                                                                                                                                                                      
#                                                                                                                                                                                                                 
USER oracle                                                                                                                                                                                                       
WORKDIR	/home/oracle                                                                                                                                                                                             
                                                                                                                                                                                                                  
# set current environment                                                                                                                                                                                         
#                                                                                                                                                                                                                 
ENV ORACLE_BASE=/u01/app/oracle                                                                                                                                                                                   
ENV ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/dbhome_1                                                                                                                                                         
ENV PATH=/u01/app/oracle/product/12.1.0.2/dbhome_1/bin:$PATH                                                                                                                                                      
ENV NLS_DATE_FORMAT=dd/mm/yyyy:hh24:mi:ss                                                                                                                                                                         
ENV ORACLE_SID=DEV                                                                                                                                                                                                
                                                                                                                                                                                                                  
# Expose ports                                                                                                                                                                                                    
#                                                                                                                                                                                                                 
EXPOSE 1521                                                                                                                                                                                                       
                                                                                                                                                                                                                  
# Copy Entrypoint Script                                                                                                                                                                                          
#                                                                                                                                                                                                                 
# COPY dbvs-entry.sh /home/oracle/dbvs-entry.sh                                                                                                                                                                   
# RUN chown oracle:oinstall /home/oracle/dbvs-entry.sh \                                                                                                                                                          
#  && chmod +x /home/oracle/dbvs-entry.sh                                                                                                                                                                         
                                                                                                                                                                                                                  
USER oracle                                                                                                                                                                                                       
# ENTRYPOINT ["/home/oracle/dbvs-entry.sh"]                                                                                                                                                                       
# CMD ["bash"] 

#docker-for-mac

Update:

Tested with a known working image that does have 12c installed and working on another system and on the Mac Pro it has the same issue - basic test running Perl in the Oracle software home fails with Segmentation Fault.

So the issue does match the VirtualBox one - http://dbaontap.com/2016/01/13/vbox5/ - (and there seem to be a reference to vmware having same issue on latest mac pro CPU models - but I have not tested that).

Anyone have any idea on how to pass these options or allow for the changing of the CPUID bits in hyperkit for the underlying vm?

The commands to fix this on VirtualBox (per VM) is as follow:

VBoxManage setextradata <VM name> "VBoxInternal/CPUM/HostCPUID/Cache/Leaf" "0x4"
VBoxManage setextradata <VM name> "VBoxInternal/CPUM/HostCPUID/Cache/SubLeaf" "0x4"
VBoxManage setextradata <VM name> "VBoxInternal/CPUM/HostCPUID/Cache/eax" "0"
VBoxManage setextradata <VM name> "VBoxInternal/CPUM/HostCPUID/Cache/ebx" "0"
VBoxManage setextradata <VM name> "VBoxInternal/CPUM/HostCPUID/Cache/ecx" "0"
VBoxManage setextradata <VM name> "VBoxInternal/CPUM/HostCPUID/Cache/edx" "0"
VBoxManage setextradata <VM name> "VBoxInternal/CPUM/HostCPUID/Cache/SubLeafMask" "0xffffffff"

Any help with this will be much appreciated as it would be nice to use the Docker for Mac locally and not revert to using other VM hosts.

Temporary work-around if anyone is interested, modify the dockerfile to include the temp fix - install/replace perl I had to link libjavavm12.a to $ORACLE_HOME/lib - not sure if this is related.

...
...
...
# Switch to user Oracle
#
USER	oracle
WORKDIR	/install

# set current environment
#
ENV ORACLE_BASE=/u01/app/oracle
ENV ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/dbhome_1
ENV PATH=/u01/app/oracle/product/12.1.0.2/dbhome_1/bin:$PATH
ENV NLS_DATE_FORMAT=dd/mm/yyyy:hh24:mi:ss
ENV ORACLE_SID=DEV

# Unzip software
RUN	unzip linuxamd64_12102_database_se2_1of2.zip \
  && rm -rf linuxamd64_12102_database_se2_1of2.zip \
  && unzip linuxamd64_12102_database_se2_2of2.zip \
  && rm -rf linuxamd64_12102_database_se2_2of2.zip
  
# Install Oracle Software
# 
RUN /install/database/runInstaller -silent -force -waitforcompletion -responsefile /install/db_install.rsp -ignoresysprereqs -ignoreprereq

## Now lets fix a few things
#
RUN cd /install \
 && mv $ORACLE_HOME/perl $ORACLE_HOME/perl.old \
 && wget http://www.cpan.org/src/5.0/perl-5.14.1.tar.gz \
 && tar -xzf perl-5.14.1.tar.gz \
 && cd perl-5.14.1 \
 && ./Configure -des -Dprefix=$ORACLE_HOME/perl -Doptimize=-O3 -Dusethreads -Duseithreads -Duserelocatableinc \
 && make clean \
 && make \
 && make install \
 && cd $ORACLE_HOME/perl \
 && rm -rf lib/ man/ \
 && cp -r ../perl.old/lib/ . \
 && cp -r ../perl.old/man/ . \
 && cp ../perl.old/bin/dbilogstrip bin/ \
 && cp ../perl.old/bin/dbiprof bin/ \
 && cp ../perl.old/bin/dbiproxy bin/ \
 && cp ../perl.old/bin/ora_explain bin/ \
 && cd $ORACLE_HOME/lib \
 && ln -s ../javavm/jdk/jdk7/lib/libjavavm12.a

## Now Relink Oracle
#
RUN cd $ORACLE_HOME/bin \
 && relink all

# Switch back to root
#
USER	root
RUN /u01/app/oraInventory/orainstRoot.sh \
 && /u01/app/oracle/product/12.1.0.2/dbhome_1/root.sh -silent \
 && rm -rf /install/database 
...
...
...