Skip to content

[1.x] possibly deadlock in audiobridge #3570

@spscream

Description

@spscream

What version of Janus is this happening on?
1.3.2, our branch based on fd24309 commit(audiobridge isn't modified by us)

Have you tested a more recent version of Janus too?
Not yet, but we hit a deadlock condition on one of our customers using the specified version.

Was this working before?
not sure

Is there a gdb or libasan trace of the issue?
Here are gdb logs from two broken servers:
https://gist.github.com/spscream/7dafebd6bb1a39493f838aebf88fba26

Additional context
I looked into the code of ab, in janus_audiobridge_handler:

janus_mutex_lock(&sessions_mutex);

a mutex is locked here.
and in
janus_mutex_lock(&rooms_mutex);

it locks rooms_mutex
So the lock order is: lock sessions_mutex -> lock rooms_mutex -> unlock rooms_mutex-> unlock sessions_mutex

This could possibly lead to a deadlock condition in other places, e.g. here:

janus_mutex_lock(&sessions_mutex);

Here the lock order is: lock sessions_mutex -> unlock sessions_mutex -> lock rooms_mutex -> unlock rooms_mutex

I'm not sure this is exactly our case, but it could potentially lead to such a condition in other places too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions