#620 OpenSIPS terminates when calling dlg_db_sync

1.10.x
closed-fixed
modules (454)
5
2013-05-10
2013-03-05
No

Only one call is in session. That is, only one dialog is in the DB.
I call dlg_db_sync and then the SIP server terminates.

Discussion

  • Nick Altmann

    Nick Altmann - 2013-03-05

    This bug only reproduced when db_mode=0 because we try to free uinitialized db-handler in sync_dlg_db_mem after select_entire_dialog_table() in error: label.
    Here is the patch to disable dlg_db_sync fifo cmd when db_mode = 0.

    You cannot use db_sync in no_db mode (db_mode=0).

     
  • Nick Altmann

    Nick Altmann - 2013-03-05

    I have no access to attach files. :-(

    Index: modules/dialog/dlg_db_handler.c

    --- modules/dialog/dlg_db_handler.c (revision 9854)
    +++ modules/dialog/dlg_db_handler.c (working copy)
    @@ -1804,6 +1804,8 @@

    struct mi_root* mi_sync_db_dlg(struct mi_root *cmd, void *param)
    {
    + if (dlg_db_mode == 0)
    + return init_mi_tree( 400, MI_SSTR("Cannot sync in no-db mode"));
    if (sync_dlg_db_mem() < 0)
    return init_mi_tree( 400, MI_SSTR("Sync mem with DB failed"));
    else

     
  • Chen-Che Huang

    Chen-Che Huang - 2013-03-05

    Hi nikbyte,

    Very grateful for your quick response. However, I set db_mode to 1 rather than 0 (modparam("dialog', "db_mode", 1)).
    I'll try your patch. Thanks so much.

    Best regard,
    Chen-Che

     
  • Vladut-Stefan Paiu

    • assigned_to: nobody --> vladut-paiu
     
  • Vladut-Stefan Paiu

    Hello,

    csmicrox, which OpenSIPS version are you using ? Also, can you please post the output of 'bt full' from GDB ?

    Nick, thanks for the patch, applied on trunk, 1.9 and 1.8

    Best Regards,
    Vlad

     
  • Vladut-Stefan Paiu

    Hello,

    Please try the attached patch ( dlg_db_sync.patch ), should fix your issue.

    Regards,
    Vlad

     
  • Chen-Che Huang

    Chen-Che Huang - 2013-03-05

    Hi Vlad,

    I use version-1.9.0 and the "bt full" information was attached when I report this bug.
    You should be able to download the core_dump_for_dlg_db_sync.txt from the attached files on this
    item page.

    Best wishes,
    Chen-Che

     
  • Vladut-Stefan Paiu

    Hi,

    Yes, saw the core dump after I replied :)
    See the patch I've attached below, apply it and give it another go, should be fine now.

    Best Regards,
    Vlad

     
  • Chen-Che Huang

    Chen-Che Huang - 2013-03-07

    Hi,

    After applying your patch, when calling dlg_db_sync, the following information are shown.
    dlg_db_sync: 400 Sync mem with DB failed
    SIP server: Error:dialog:sync_dlg_db_mem: inconsistent hash data in the dialog database: you restarted opensips using a different hash_size: please erase dialog database and restart

    I have followed the instruction and the problem remains. I also reinstall OpenSIPS and create a new database, but
    have the same result. Please look into this issue. I'm very grateful to your help.

    Yours sincerely,
    Chen-Che

     
  • Vladut-Stefan Paiu

    • status: open --> closed-fixed
     
  • Vladut-Stefan Paiu

    Hello,

    Indeed, sorry for this, there was another leftover bug. I have just committed the fix on 1.9 and trunk.

    Please remove the patch I've sent you and update your sources from the stable 1.9 branch.

    Best Regards,
    Vlad

     

Log in to post a comment.