Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000290 [Yate - Yet Another Telephony Engine] module minor always 2012-01-23 15:27 2012-01-25 15:29
Reporter lojza View Status public  
Assigned To
Priority normal Resolution open  
Status feedback   Product Version SVN
Summary 0000290: crash on Unloading module Signalling Channel
Description We are testing modules

  sigtransport
  ysigchan
  lksctp

and in configuration is one connection with SCTP protocol

when program yate end (is shutting down) an exception

  "pure virtual method called"

is raised an program is Aborted

Additional Information program log:

  Yate (16882) is starting Mon Jan 23 13:50:04 2012
  Loading module LKSCTP
  Loaded module Signalling Channel
  Loaded module SigTransport
  Initializing plugins
  Initializing module SigTransport
  Initialize module LKSCTP
  Initializing module Signalling Channel
  Initialization complete
  Yate engine is initialized and starting up on debian
  ...
  ...
  ^C
  Yate engine is shutting down with code 0
  <GOON> Unloading 'ysigchan' removed 0 out of 1 plugins
  <GOON> Unloading 'lksctp' removed 0 out of 1 plugins
  Unloading module SigTransport
  Unloading module LKSCTP
  Unloading module Signalling Channel
  pure virtual method called
  terminate called without an active exception
  Aborted

In yate.conf is

  [general]
  modload=disable

  [modules]
  sigtransport.yate=on
  ysigchan.yate=on
  lksctp.yate=on

Problem is in file

  ./modules/server/lksctp.cpp

in line 86 is global variable

  Mutex s_countMutex(true,s_mutexName);

which is used in desctructor

  LKSocket::~LKSocket()

on line 112

When yate is shutting down, modules are unloaded. At this phase
modlule lksctp.yate is unloaded before ysigchan.yate. When module
lksctp is unloaded, its global variables are deleted (destrucor is
called) but next module ysigchan has some clases from this module (LKSocket),
which use global variables, but they was just deleted (s_countMutex).
Program fails, and possible next modules are not unloaded correctly.

To prevent this situation is needed to remove cross module dependecies
or define somewhere this dependecies and change modules order when they
are loaded/unloaded. Or allow to change modules ordering somewhere
in config files. Change modules order in yate.conf now doesn't help.

tested on SVN version 4815
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0000411)
paulc (administrator)
2012-01-25 12:20

This is caused by some obscure Linux glibc bug or poorly documented "feature" causing the modules not to be unloaded promptly when the last dlopen() reference to them is dlclose()d.

In your log above you can see:
<GOON> Unloading 'ysigchan' removed 0 out of 1 plugins
<GOON> Unloading 'lksctp' removed 0 out of 1 plugins

If the modules are not unloaded they do not clean up. Eventually they are all unloaded when some other module is unloaded but we lose control over the unload order.

A workaround is to run Yate with -Du so instead of unloading the modules they are just finalized. However, this will prevent unloading or reloading any module at runtime.
(0000413)
lojza (reporter)
2012-01-25 14:42

Yes, your workaround works.
Thank you.
(0000414)
paulc (administrator)
2012-01-25 15:29

SVN Rev. 4820 now hides the unload and reload commands if -Du was specified although the users are free to shoot themselves in the foot manually.

- Issue History
Date Modified Username Field Change
2012-01-23 15:27 lojza New Issue
2012-01-23 17:09 lojza Issue Monitored: lojza
2012-01-23 17:09 lojza Issue End Monitor: lojza
2012-01-25 12:20 paulc Note Added: 0000411
2012-01-25 12:20 paulc Status new => feedback
2012-01-25 14:42 lojza Note Added: 0000413
2012-01-25 15:29 paulc Note Added: 0000414


Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker