[vbox-dev] Problems with porting a VritualBox frontend from Windows to Linux

Klaus Espenlaub klaus.espenlaub at oracle.com
Tue Mar 31 13:16:22 UTC 2015


On 31.03.2015 13:22, Rūdolfs Bundulis wrote:
> Hi,
> ok I found the root issue - my code did not call  RTR3InitExe(argc,
> &argv, 0) since I built the application only from looking at the API
> interfaces and was not aware that I need to do this (actually maybe it
> makes sense to include a comment int the xpcom tstVBoxAPIXPCOM.cpp
> sample about this?).

"Regular" API clients don't need this, they can happily live with the 
implicit, delayed initialization which disables some functionality. 
That's why it makes no sense to talk about it in tstVBoxAPIXPCOM.cpp - 
it's happily working.

Only API clients actually running VMs inside them absolutely need the 
full initialization as the very first thing, otherwise they won't work.

> Now after I've taken a closer look to the frontends
> I see that all them call the initialization function the first thing. I
> added it and my IFrambuffer implementation started to get invocations.

Pretty sure that e.g. VBoxManage.cpp only does it because in uses quite 
some runtime functionality, and doesn't want to run any risk (in the old 
days it was far less "optional" to do the initialization).

> Since my Windows code worked fine without it - should I add it to
> Windows as well? Any chance it is responsible for the weird recompiler
> longjmp crash I get? Thanks in advance.

Did you by any chance extend the CPUCTX struct or any other data 
structure which might be used by the recompiler? Just hours ago we 
tracked down a MingW gcc bug in the very same area which smells very 

> Best Regards,
> Rudolfs Bundulis
> 2015-03-30 2:42 GMT+03:00 Rūdolfs Bundulis <rudolfs.bundulis at gmail.com
> <mailto:rudolfs.bundulis at gmail.com>>:
>     Hi,
>     I compiled debug version of 4.3.26 and tried my code against it -
>     now the log has a much nicer assert message just before it ends:
>     00:00:55.619996 TM: GIP - u32Mode=1 (SyncTSC) u32UpdateHz=83
>     00:00:55.652313 TM: cTSCTicksPerSecond=0xa0861eba (2 693 144 250)
>     fTSCVirtualized=true  fTSCUseRealTSC=false
>     00:00:55.652322 TM: fMaybeUseOffsettedHostTSC=true
>     TSCTiedToExecution=false TSCNotTiedToHalt=false
>     00:00:55.652373
>     00:00:55.652376 !!Assertion Failed!!
>     00:00:55.652378 Expression: <NULL>
>     00:00:55.652380 Location  :
>     /home/rudolfs/VirtualBox-4.3.26/src/VBox/VMM/VMMR3/TM.cpp(576) int
>     TMR3Init(PVM)
>     00:00:55.652508 Failed to create timer, u32Millies=10
>     I put a breakpoint in TM.cpp:576, and it seems that I am failing
>     because of the code in RTTimerCreateEx():
>          /*
>           * We need the signal masks to be set correctly, which they
>     won't be in
>           * unobtrusive mode.
>           */
>          if (RTR3InitIsUnobtrusive())
>              return VERR_NOT_SUPPORTED;
>     What is unobtrusive mode and what signal masks do I need to set?
>     I'll have a look at what is done in the frontends, but I guess that
>     you guys here can explain it in more detail.
>     Best Reagrds,
>     Rudolfs Bundulis

More information about the vbox-dev mailing list