Closed computezrmle closed 2 months ago
While it builds fine on my local Linux system I get these errors on the github build system:
vbox_vboxmanage.o: In function `VBOX_VM::remove_race_mitigation_lock(int&, std::string&)':
/__w/boinc/boinc/samples/vboxwrapper/vbox_vboxmanage.cpp:2315: undefined reference to `shm_unlink'
vbox_vboxmanage.o: In function `VBOX_VM::set_race_mitigation_lock(int&, std::string&, std::string const&)':
/__w/boinc/boinc/samples/vboxwrapper/vbox_vboxmanage.cpp:2415: undefined reference to `shm_open'
vbox_vboxmanage.o: In function `VBOX_VM::remove_race_mitigation_lock(int&, std::string&)':
/__w/boinc/boinc/samples/vboxwrapper/vbox_vboxmanage.cpp:2315: undefined reference to `shm_unlink'
collect2: error: ld returned 1 exit status
Any idea what's wrong?
@computezrmle, these two builds are building on Ubuntu 13.04, because we still need to provide the binaries for the old libc version:
I believe, it works on your machine because you're using more fresh version of one of the libraries
@AenBleidd I'm using openSUSE Tumbleweed [6.7.4-1-default|libc 2.39] Can I do anything to solve this?
@computezrmle, try to add -lrt
here at the very end between -lboinc
and $(STDCPPTC)
https://github.com/BOINC/boinc/blob/6cd441f6a6e8b8323a8103ec6e874a8a71908972/samples/vboxwrapper/Makefile#L80
A case is not handled correctly in is_disk_image_registered()
when a VM restarts.
Set the PR to draft to work out a solution.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 10.54%. Comparing base (
6cd441f
) to head (85bc766
). Report is 38 commits behind head on master.
A reliable volunteer from LHC@home and I tested the artifact from yesterday with real project tasks on Windows and Linux. They work as expected and solve the issues addressed in the first comment of this PR. Thus, it's ready for review now.
Introduction
Vboxwrapper allows to use VirtualBox multiattach/differencing disk images since version 26206. Attaching a disk in this mode can't be done in 1 step. Hence, a workaround suggested by VirtualBox had to be implemented in vboxwrapper and improved.
The required steps (in short):
For more details see:
4602
4603
Long term experience with LHC@home shows that errors like these happen more often than expected:
They usually happen when
VirtualBox processes all incoming commands FIFO, hence "closemedium" and "storageattach" (normal/multiattach) from different vboxwrappers can easily be mixed.
Suggested Solution
This PR introduces a lock to protect the critical code sections. All vboxwrapper instances trying to modify the same parent disk entry must own the lock or wait. This is important when a VM gets registered as well as when a VM gets deregistered.
Also included in this PR
Tests done
Several series of concurrently starting VMs (CMS subproject from LHC@home)