We try to port our virtual machine on Net Bsd 7.0 (amd64). Already ported from Linux to Free BSD and Open BSD, among others, with success. We have several issues on a fresh and standard install of Net BSD.
Code is compiled with gcc and the following flags : CC_OPTIONS=-pedantic -Wall -Wno-trigraphs -Wno-long-long -Wno-variadic-macros -fshort-wchar -x c++ -fPIC -pipe -fno-omit-frame-pointer -g -I"/usr/local"/include -I"$(UAS_SRC)"
LD_OPTIONS=-shared-libgcc -L"/usr/lib" -L"/usr/local/lib" -L"$(UAS_HOME)vtm/lib"When attempting to create a thread with pthread_create(), the process receives SIGABRT from libc run-time : gdb backtrace :
- in _lwp_kill() from /usr/lib/libc.so.12
- in __lwd_thr_create_stub() from /usr/lib/libc.so.12
- in _pthread_create() from /usr/libpthread.so.1
- in CreerThread2() in /home/../syspsx_nt.cpp
When attempting to use spin locks, we receive a segment violation. Here is the test case :
typedef struct typmttsysnatsynchronisationdirect
{
union-
{
pthread_spinlock_t HandleSpinLock;
} Selection;
TypMttSysNatSynchronisationDirect SynchronisationCourant;
int Reponse;
SynchronisationCourant=(TypMttSysNatSynchronisationDirect)malloc(sizeof(struct typmttsysnatsynchronisationdirect));
if (SynchronisationCourant==NULL)
-
return(0);
Reponse=pthread_spin_init(&(SynchronisationCourant->Selection.HandleSpinLock), PTHREAD_PROCESS_SHARED);
if (Reponse!=0)
-
return(0);
if (Reponse!=0)
-
return(0);
When disassemblying code of pthread_spin_init() and pthread_spin_lock(), it seems that there is a function pointer inside pthread_spinlock that is set to NULL in pthread_spin_init() and that is indirectly called into pthread_spintrylock() called by pthread_spinlock().
Thank your for your help.