Skip to content

ovs-p4ctl built with GitHub Actions crash with a segfault due to AVX512 support being enabled when run on Virtualbox or other systems lacking AVX support #118

@mestery

Description

@mestery

I just spent a few hours looking into an issue which turns out to be caused by the fact the images we are building and pushing to GHCR do not work.

Pull the GHCR Ubuntu 20.04 image like this:

docker pull ghcr.io/ipdk-io/ipdk-ubuntu2004-x86_64:main

Next, setup your ipdk.env file as shown:

vagrant@ubuntu-focal:~/ipdk/build$ cat ~/.ipdk/ipdk.env
#
# IPDK CLI configuration file
# See for more information https://github.com/ipdk-io/ipdk/blob/main/build/IPDK_Container/README_DOCKER.md#CLI-configuration-settings
#
# /home/vagrant/ipdk/build/scripts contains the location of the 'sourcing' ipdk script when read.
#
BASE_IMG=ubuntu:20.04
IMAGE_NAME=ghcr.io/ipdk-io/ipdk-ubuntu2004-x86_64
DOCKERFILE=/home/vagrant/ipdk/build/scripts/../Dockerfile.ubuntu
TAG=main
vagrant@ubuntu-focal:~/ipdk/build$

Star the container:

$ ipdk start -d

Login and see how ovs-vswitchd is not running, and when you start it manually, you see a segfault:

vagrant@ubuntu-focal:~/ipdk/build$ docker exec -it ipdk bash
root@f111597b0a04:~# ps axuw
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root           1  0.0  0.0   3976  3244 pts/0    Ss+  20:47   0:00 /bin/bash /root/scripts/start.sh rundaemon
root          45  0.0  0.0   2520   584 pts/0    S+   20:47   0:00 sleep infinity
root          95  0.0  0.0   5300  2708 ?        Ss   20:47   0:00 ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock --remote=db:Open_vSwitch,Open_vSwitch,ma
root         100  0.5  0.0   4240  3668 pts/1    Ss   20:50   0:00 bash
root         114  0.0  0.0   5896  2836 pts/1    R+   20:50   0:00 ps axuw
root@f111597b0a04:~# /root/scripts/start.sh rundaemon
Start as long running process.
1024
1024
Killing OVS Processes If Already Running....
Killing ovsdb-server process....
Creating /var/run/openvswitch
Starting OvS DB server....
Staring OvS VSWITCHD Process....
/root/scripts/run_ovs.sh: line 45:   153 Illegal instruction     (core dumped) GLOG_log_dir=/tmp/logs ovs-vswitchd --pidfile --detach --no-chdir --mlockall --log-file=/tmp/logs/ovs-vswitchd.log
^C
root@f111597b0a04:~#

Now, I have pulled down the IPDK code and built a container locally, and when I run that image, it works fine:

vagrant@ubuntu-focal:~/ipdk/build$ docker images
REPOSITORY                               TAG           IMAGE ID       CREATED          SIZE
ghcr.io/ipdk-io/ipdk-ubuntu2004-x86_64   sha-bb7a773   9141307b21db   10 minutes ago   3.23GB
ghcr.io/ipdk-io/ipdk-ubuntu2004-x86_64   main          840c958df8e8   30 hours ago     3.23GB
ubuntu                                   20.04         54c9d81cbb44   3 weeks ago      72.8MB
vagrant@ubuntu-focal:~/ipdk/build$ cat ~/.ipdk/ipdk.env
#
# IPDK CLI configuration file
# See for more information https://github.com/ipdk-io/ipdk/blob/main/build/IPDK_Container/README_DOCKER.md#CLI-configuration-settings
#
# /home/vagrant/ipdk/build/scripts contains the location of the 'sourcing' ipdk script when read.
#
BASE_IMG=ubuntu:20.04
IMAGE_NAME=ghcr.io/ipdk-io/ipdk-ubuntu2004-x86_64
DOCKERFILE=/home/vagrant/ipdk/build/scripts/../Dockerfile.ubuntu
vagrant@ubuntu-focal:~/ipdk/build$ ipdk start -d
Loaded /home/vagrant/ipdk/build/scripts/ipdk_default.env
Loaded /home/vagrant/.ipdk/ipdk.env
Can't find update-binfmts.
Using docker run!
b9aee9f0aa34e94785023274592a48b9b3bd1e5e2d2f7b3fce6c2a8435e766ba
vagrant@ubuntu-focal:~/ipdk/build$ docker exec -it ipdk bash
root@b9aee9f0aa34:~# ps axuw
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root           1  0.1  0.0   3976  3096 pts/0    Ss+  20:50   0:00 /bin/bash /root/scripts/start.sh rundaemon
root          41  0.0  0.0   5300  2676 ?        Ss   20:50   0:00 ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock --remote=db:Open_vSwitch,Open_vSwitch,ma
root          45 97.0  2.3 67827184 194716 ?     SLsl 20:50   0:07 ovs-vswitchd --pidfile --detach --no-chdir --mlockall --log-file=/tmp/logs/ovs-vswitchd.log
root          63  0.0  0.0   2520   596 pts/0    S+   20:50   0:00 sleep infinity
root          69  0.0  0.0   4240  3488 pts/1    Ss   20:50   0:00 bash
root          83  0.0  0.0   5896  2876 pts/1    R+   20:50   0:00 ps axuw
root@b9aee9f0aa34:~#

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions