VirtualBox

Ignore:
Timestamp:
Aug 25, 2021 5:08:03 PM (3 years ago)
Author:
vboxsync
Message:

Audio/VKAT: The ATS callback context has to be on the heap, not on the stack, otherwise things go south. bugref:10008

Location:
trunk/src/VBox/ValidationKit/utils/audio
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/utils/audio/vkatCommon.cpp

    r90887 r90891  
    5151*   Defined Constants And Macros                                                                                                 *
    5252*********************************************************************************************************************************/
    53 /**
    54  * Structure for keeping a user context for the test service callbacks.
    55  */
    56 typedef struct ATSCALLBACKCTX
    57 {
    58     /** The test environment bound to this context. */
    59     PAUDIOTESTENV pTstEnv;
    60     /** Absolute path to the packed up test set archive.
    61      *  Keep it simple for now and only support one (open) archive at a time. */
    62     char          szTestSetArchive[RTPATH_MAX];
    63     /** File handle to the (opened) test set archive for reading. */
    64     RTFILE        hTestSetArchive;
    65     /** Number of currently connected clients. */
    66     uint8_t       cClients;
    67 } ATSCALLBACKCTX;
    68 typedef ATSCALLBACKCTX *PATSCALLBACKCTX;
    6953
    7054
     
    911895            RTStrCopy(pTstEnv->TcpOpts.szBindAddr, sizeof(pTstEnv->TcpOpts.szBindAddr), "0.0.0.0");
    912896
     897    /* Set a back reference to the test environment for the callback context. */
     898    pTstEnv->CallbackCtx.pTstEnv = pTstEnv;
     899
     900    ATSCALLBACKS Callbacks;
     901    RT_ZERO(Callbacks);
     902    Callbacks.pvUser = &pTstEnv->CallbackCtx;
     903
    913904    if (pTstEnv->enmMode == AUDIOTESTMODE_GUEST)
    914905    {
    915         ATSCALLBACKCTX Ctx;
    916         Ctx.pTstEnv = pTstEnv;
    917 
    918         ATSCALLBACKS Callbacks;
    919         RT_ZERO(Callbacks);
    920906        Callbacks.pfnHowdy            = audioTestGstAtsHowdyCallback;
    921907        Callbacks.pfnBye              = audioTestGstAtsByeCallback;
     
    927913        Callbacks.pfnTestSetSendRead  = audioTestGstAtsTestSetSendReadCallback;
    928914        Callbacks.pfnTestSetSendEnd   = audioTestGstAtsTestSetSendEndCallback;
    929         Callbacks.pvUser              = &Ctx;
    930915
    931916        if (!pTstEnv->TcpOpts.uBindPort)
     
    951936    else /* Host mode */
    952937    {
    953 
    954         ATSCALLBACKCTX Ctx;
    955         Ctx.pTstEnv = pTstEnv;
    956 
    957         ATSCALLBACKS Callbacks;
    958         RT_ZERO(Callbacks);
    959         Callbacks.pvUser = &Ctx;
    960 
    961938        if (!pTstEnv->TcpOpts.uBindPort)
    962939            pTstEnv->TcpOpts.uBindPort = ATS_TCP_DEF_BIND_PORT_HOST;
  • trunk/src/VBox/ValidationKit/utils/audio/vkatInternal.h

    r90887 r90891  
    193193/** Pointer to audio test TCP options. */
    194194typedef AUDIOTESTENVTCPOPTS *PAUDIOTESTENVTCPOPTS;
     195
     196/**
     197 * Structure for keeping a user context for the test service callbacks.
     198 */
     199typedef struct ATSCALLBACKCTX
     200{
     201    /** The test environment bound to this context. */
     202    PAUDIOTESTENV pTstEnv;
     203    /** Absolute path to the packed up test set archive.
     204     *  Keep it simple for now and only support one (open) archive at a time. */
     205    char          szTestSetArchive[RTPATH_MAX];
     206    /** File handle to the (opened) test set archive for reading. */
     207    RTFILE        hTestSetArchive;
     208    /** Number of currently connected clients. */
     209    uint8_t       cClients;
     210} ATSCALLBACKCTX;
     211typedef ATSCALLBACKCTX *PATSCALLBACKCTX;
    195212
    196213/**
     
    236253    /** ATS server instance to use. */
    237254    ATSSERVER               Srv;
     255    /** ATS callback context to use. */
     256    ATSCALLBACKCTX          CallbackCtx;
    238257    union
    239258    {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette