4.9 KiB
Summary of the Problem and Solution
Problem Overview
You were attempting to run an Oracle 11g Docker container using the command:
docker run -idt --name oracle -h oracle --privileged=true -p 1521:1521 -p 2222:22 \
lhrbest/oracle_11g_ee_lhr_11.2.0.4:2.0 init
- Issue Experienced:
- The Docker container exited immediately after starting, without any error messages.
- The exit code was 139, indicating a segmentation fault (SIGSEGV).
- The issue occurred on a Debian system but not on OpenSUSE.
Root Cause
The segmentation fault was due to the way modern Linux kernels handle vsyscall (virtual system call):
-
vsyscallDeprecation:- Modern kernels have deprecated
vsyscallin favor of vDSO (virtual dynamic shared object) for security reasons. - By default,
vsyscallmight be disabled or set to a mode incompatible with older applications.
- Modern kernels have deprecated
-
Impact on Oracle 11g:
- Oracle 11g, being legacy software, relies on the old
vsyscallmechanism for certain operations. - Without proper
vsyscallsupport, Oracle binaries can crash with a segmentation fault.
- Oracle 11g, being legacy software, relies on the old
-
Difference Between Systems:
- OpenSUSE may have
vsyscallsupport enabled or set to emulate by default. - Debian, especially with newer kernels, has
vsyscalldisabled or set to a mode that doesn't support the required legacy behavior.
- OpenSUSE may have
Solution
Enable vsyscall Emulation on the Debian System:
-
Verify Current
vsyscallMapping:sudo grep vsyscall /proc/self/maps- If no output is returned,
vsyscallis not currently mapped.
- If no output is returned,
-
Edit GRUB Configuration:
-
Open the GRUB configuration file:
sudo nano /etc/default/grub -
Locate the line starting with
GRUB_CMDLINE_LINUX_DEFAULT. -
Append
vsyscall=emulateto the existing parameters within the quotes.Example:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash vsyscall=emulate"
-
-
Update GRUB Settings:
-
Apply the changes by updating GRUB:
sudo update-grub
-
-
Reboot the System:
-
Restart your machine to apply the new kernel parameter:
sudo reboot
-
-
Confirm
vsyscallis Enabled:-
After rebooting, check if
vsyscallis now mapped:sudo grep vsyscall /proc/self/maps -
You should see an output similar to:
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
-
-
Run the Docker Container Again:
-
With
vsyscallemulation enabled, attempt to start the Oracle container:docker run -idt --name oracle -h oracle --privileged=true --shm-size=2g \ -p 1521:1521 -p 2222:22 lhrbest/oracle_11g_ee_lhr_11.2.0.4:2.0 init -
The container should now start successfully without exiting.
-
Explanation of the Solution
-
vsyscall=emulateKernel Parameter:- Tells the kernel to emulate the old
vsyscallbehavior, allowing legacy applications to function correctly. - Balances compatibility with security, as emulation is safer than direct mapping.
- Tells the kernel to emulate the old
-
Why It Works:
- Restores the expected environment for Oracle 11g, preventing segmentation faults caused by missing
vsyscallsupport.
- Restores the expected environment for Oracle 11g, preventing segmentation faults caused by missing
Additional Considerations
-
Security Implications:
- Enabling
vsyscallemulation is generally safe but reintroduces some legacy code paths. - The risk is minimal for most users, but it's important to keep the system updated.
- Enabling
-
Alternate Solutions:
- Upgrade Oracle Version:
- Consider using a newer version of Oracle that doesn't rely on
vsyscall.
- Consider using a newer version of Oracle that doesn't rely on
- Use an Older Kernel:
- Downgrading the kernel to a version where
vsyscallis enabled by default. - Not recommended due to potential security vulnerabilities.
- Downgrading the kernel to a version where
- Upgrade Oracle Version:
-
Documentation and References:
- Similar issues and solutions have been documented in various repositories:
Summary
-
Problem:
- The Oracle 11g Docker container was exiting with a segmentation fault on Debian due to
vsyscallbeing disabled in the kernel.
- The Oracle 11g Docker container was exiting with a segmentation fault on Debian due to
-
Solution:
- Enabling
vsyscallemulation by addingvsyscall=emulateto the kernel boot parameters in GRUB. - Updating GRUB and rebooting the system applied the changes.
- The container then started successfully.
- Enabling
By adjusting the kernel parameter to enable vsyscall emulation, you resolved the compatibility issue between Oracle 11g and the modern Debian kernel, allowing the Docker container to run without errors.
If you have any further questions or need assistance with other issues, feel free to ask!