[asterisk-dev] Scheduler problem

Kaloyan Kovachev kkovachev at varna.net
Tue Dec 3 05:26:07 CST 2013


Hello,
i am still fighting this problem without much success. Some times it 
works fine for weeks and then suddenly crashes.

What i have found so far, is that bridge config is somehow disappearing 
during the call - how could that happen?

In my scheduler callback i have separated the checks to pinpoint the 
structure causing the crash and:
The datastore structure is in place
The two channels are in place
struct ast_bridge_config *config when accessed is causing the crash

I have added a flag in the datastore structure, which i set immediately 
after the call to ast_bridge_call() and the flag is not set during a 
crash, so ...

How is it possible for the config to disappear during a call? How to 
prevent it?

On 2013-10-23 13:32, Kaloyan Kovachev wrote:
> Hello list,
> i have some crashes from time to time accessing the data from a
> callback function and can't find any reason.
> 
> The scheduler thread is created from a wrapper around
> ast_bridge_call() function and is running while the channels are
> bridged. After ast_bridge_call() returns the schedule is removed with
> ast_sched_del() inside a scheduler thread lock, then it is unlocked to
> run some other code and just after that, the datastore (and the
> structure passed to the callback it contains) is freed. This is also
> done inside a scheduler thread lock and a channel lock.
> 
> I can't think of any way the callback is called without the datastore
> (and it's callback data) being present, but still there is a crash
> inside the callback when the callback data is accessed ... What i am
> missing here?!



More information about the asterisk-dev mailing list