docker-mongo icon indicating copy to clipboard operation
docker-mongo copied to clipboard

entrypoint.sh Illegal instruction

Open azambranogalbis-etraid opened this issue 7 years ago • 6 comments

Hi,

I am facing this issue when trying to start the container in clean machine. The docker container never starts.

$ docker run -d -p 27017:27017 --name mongo khezen/mongo:latest
1dc83708724e879933d3f5443591c88b4d721f007f7f5be2aaa1b8d25498edae
$ docker logs mongo
$@
/entrypoint.sh: line 11:     7 Illegal instruction     (core dumped) $@

The docker version I am using:

$ docker version
Client:
 Version:       18.03.0-ce
 API version:   1.37
 Go version:    go1.9.4
 Git commit:    0520e24
 Built: Wed Mar 21 23:10:01 2018
 OS/Arch:       linux/amd64
 Experimental:  false
 Orchestrator:  swarm

Server:
 Engine:
  Version:      18.03.0-ce
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.9.4
  Git commit:   0520e24
  Built:        Wed Mar 21 23:08:31 2018
  OS/Arch:      linux/amd64
  Experimental: false

Thanks for the support!

azambranogalbis-etraid avatar Apr 20 '18 12:04 azambranogalbis-etraid

I can not reproduce.

Could you try to run the following docker run -d -p 27017:27017 --name mongo -v /:{path} khezen/mongo:latest replace {path} by whatever you want on your host.

Then you should have the following {path}/core. This file should contain logs pointing which instruction caused the core dump.

khezen avatar Apr 23 '18 09:04 khezen

Hi,

core file is not being created due to the core_pattern configuration inside the container (which apparently cannot be changed...). Nevertheless, I managed to run mongod inside the container with gdb:

$ docker run -it khezen/mongo:latest bash
$@
root@f2f2642c5d53:/# apt-get install gdb
[...]
root@f2f2642c5d53:/# gdb -ex=r mongod
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from mongod...(no debugging symbols found)...done.
Starting program: /bin/mongod
warning: Error disabling address space randomization: Operation not permitted
During startup program terminated with signal SIGILL, Illegal instruction.
(gdb)

So, mongod is terminating with signal SIGILL, no further information is given...

azambranogalbis-etraid avatar Apr 24 '18 14:04 azambranogalbis-etraid

How about running docker run -d -p 27017:27017 --name mongo --ulimit core=-1 -v /:{path} khezen/mongo:latest and check if there is a core dump generated.

khezen avatar Apr 24 '18 14:04 khezen

I fail to reproduce this issue. If anyone here is having the same and is willing to share some of his investigation that'd be great.

khezen avatar Apr 30 '18 22:04 khezen

Hi!

I managed to generate the core dump (attached) core.mongod.16.bab995a4c647.1525247014.tar.gz

azambranogalbis-etraid avatar May 02 '18 07:05 azambranogalbis-etraid

@khezen, Most likely this is due to the fact that MongoDB 5.0+ requires AVX instructions, to solve this problem you need to build with my patch, or edit SConstruct build configuration file yourself. https://github.com/GermanAizek/mongodb-without-avx

GermanAizek avatar Feb 28 '23 16:02 GermanAizek