[vlc-devel] [PATCH] win32: assert when VLC_CANCEL_ADDR_SET has another address already set

Steve Lhomme robux4 at videolabs.io
Thu Jun 16 17:56:37 CEST 2016


On Thu, Jun 16, 2016 at 4:05 PM, Steve Lhomme <robux4 at videolabs.io> wrote:
> in par with the assert in VLC_CANCEL_ADDR_CLEAR but we can tell who's guilty

Here is stacktrace when it asserts. We have a vlc_cond_wait() called
inside a vlc_cond_wait(). The latter is from a static mutex, the
former is a general/local wait condition.

    ucrtbased.dll!common_assert_to_message_box<wchar_t>(const wchar_t
* const expression, const wchar_t * const file_name, const unsigned
int line_number, void * const return_address) Line 351    C++
    ucrtbased.dll!common_assert<wchar_t>(const wchar_t * const
expression, const wchar_t * const file_name, const unsigned int
line_number, void * const return_address) Line 387   C++
    ucrtbased.dll!_wassert(const wchar_t * expression, const wchar_t *
file_name, unsigned int line_number) Line 405    C++
>   libvlccore.dll!vlc_control_cancel(int cmd, ...) Line 794    C
    libvlccore.dll!vlc_cancel_addr_set(void * addr) Line 994    C
    libvlccore.dll!vlc_cancel_addr_prepare(void * addr) Line 65 C
    libvlccore.dll!vlc_cond_wait(vlc_cond_t * cond, vlc_mutex_t *
mutex) Line 168   C
    libvlccore.dll!vlc_mutex_lock(vlc_mutex_t * p_mutex) Line 121   C
    libvlccore.dll!vlc_cond_wait(vlc_cond_t * cond, vlc_mutex_t *
mutex) Line 173   C
    libvlccore.dll!vlc_rwlock_rdlock(vlc_rwlock * lock) Line 260    C
    libvlccore.dll!vlc_interrupt_get() Line 164 C
    libvlccore.dll!vlc_killed() Line 251    C
    libvlccore.dll!stream_ReadRaw(stream_t * s, void * buf, unsigned
int len) Line 339  C
    libvlccore.dll!stream_Read(stream_t * s, void * buf, unsigned int
len) Line 391 C
    librecord_plugin.dll!Read(stream_t * s, void * p_read, unsigned
int i_read) Line 126    C

> ---
>  src/win32/thread.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/win32/thread.c b/src/win32/thread.c
> index 963a8d7..f23be65 100644
> --- a/src/win32/thread.c
> +++ b/src/win32/thread.c
> @@ -677,6 +677,7 @@ void vlc_control_cancel (int cmd, ...)
>              void *addr = va_arg(ap, void *);
>
>              EnterCriticalSection(&th->wait.lock);
> +            assert(th->wait.addr == NULL);
>              th->wait.addr = addr;
>              LeaveCriticalSection(&th->wait.lock);
>              break;
> --
> 2.8.2
>


More information about the vlc-devel mailing list