Asterisk
  1. Asterisk
  2. ASTERISK-17058

[patch] Asterisk 1.8.1-rc1 crashes in cdr.c line 1201 after a parked call catched with parkedcall() is hungup

    Details

    • Type: Bug Bug
    • Status: Closed
    • Severity: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Target Release Version/s: None
    • Component/s: CDR/General
    • Labels:
      None
    • Mantis ID:
      18415
    • Regression:
      No

      Description

      The following combination makes asterisk-1.8.1-rc1 crash in cdr.c no matter if
      there is any config file for cdr or not:

      call gets parked:
      exten => _*81ZXX,n,Park(120000,CTX_ParkTimeout,s,1,s)

      other person picks up the call:
      exten => _*82ZXX,n,Set(CDR(userfield)=$

      {USERFIELD}

      )
      exten => _*82ZXX,n,ParkedCall($

      {EXTEN:3}

      )

      either party hangs up:
      asterisk crashes creating a core dump.

      The output of the core dump in gdb:
      >Core was generated by `/opt/asterisk/sbin/asterisk -f -vvvg -c'.
      >Program terminated with signal 11, Segmentation fault.
      >#0 ast_cdr_specialized_reset (cdr=0x0, _flags=0x0) at cdr.c:1201
      >1201 if (ast_test_flag(cdr, AST_CDR_FLAG_POST_DISABLED)) { /* But do NOT lose the NoCDR() setting */

      1. patch-18415
        0.5 kB
        jsolares
      2. extensions.conf
        0.1 kB
      3. backtrace-18415-1.8.1-rc1-park.txt
        27 kB
      4. backtrace-18415-1.8.1-rc1.txt
        26 kB
      5. backtrace-18415-1.8.0.txt
        28 kB
      6. backtrace.txt
        25 kB
      7. 20101209__issue18415.diff.txt
        1 kB
        Tilghman Lesher

        Issue Links

          Activity

          Hide
          jsolares added a comment -

          what actually happens afaict is that a bridge_cdr is created and posted at the end of ast_bridge_call whilst the cdrs for chan and peer get reset (where it was crashing) with ast_cdr_specialized_reset, so it won't post unless you have it configured to post unanswered channels (maybe)

          also remember that it was only setting the peer->cdr to null when CDR(userfield) was set on peer.

          Show
          jsolares added a comment - what actually happens afaict is that a bridge_cdr is created and posted at the end of ast_bridge_call whilst the cdrs for chan and peer get reset (where it was crashing) with ast_cdr_specialized_reset, so it won't post unless you have it configured to post unanswered channels (maybe) also remember that it was only setting the peer->cdr to null when CDR(userfield) was set on peer.
          Hide
          Leif Madsen added a comment -

          This looks like it will make it into the current sprint, so it should be resolved in 1.8.3-rc1.

          Show
          Leif Madsen added a comment - This looks like it will make it into the current sprint, so it should be resolved in 1.8.3-rc1.
          Hide
          Digium Subversion added a comment -

          Repository: asterisk
          Revision: 297952

          U branches/1.8/main/features.c

          ------------------------------------------------------------------------
          r297952 | twilson | 2010-12-09 14:48:44 -0600 (Thu, 09 Dec 2010) | 10 lines

          Don't crash after Set(CDR(userfield)=...) in ast_bridge_call

          Instead of setting peer->cdr = NULL, set it to not post.

          (closes issue ASTERISK-17058)
          Reported by: macbrody
          Patches:
          patch-18415 uploaded by jsolares (license 1167)
          Tested by: jsolares, twilson

          ------------------------------------------------------------------------

          http://svn.digium.com/view/asterisk?view=rev&revision=297952

          Show
          Digium Subversion added a comment - Repository: asterisk Revision: 297952 U branches/1.8/main/features.c ------------------------------------------------------------------------ r297952 | twilson | 2010-12-09 14:48:44 -0600 (Thu, 09 Dec 2010) | 10 lines Don't crash after Set(CDR(userfield)=...) in ast_bridge_call Instead of setting peer->cdr = NULL, set it to not post. (closes issue ASTERISK-17058 ) Reported by: macbrody Patches: patch-18415 uploaded by jsolares (license 1167) Tested by: jsolares, twilson ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=297952
          Hide
          Digium Subversion added a comment -

          Repository: asterisk
          Revision: 297956

          _U trunk/
          U trunk/main/features.c

          ------------------------------------------------------------------------
          r297956 | twilson | 2010-12-09 15:26:19 -0600 (Thu, 09 Dec 2010) | 17 lines

          Merged revisions 297952 via svnmerge from
          https://origsvn.digium.com/svn/asterisk/branches/1.8

          ........
          r297952 | twilson | 2010-12-09 14:48:44 -0600 (Thu, 09 Dec 2010) | 10 lines

          Don't crash after Set(CDR(userfield)=...) in ast_bridge_call

          Instead of setting peer->cdr = NULL, set it to not post.

          (closes issue ASTERISK-17058)
          Reported by: macbrody
          Patches:
          patch-18415 uploaded by jsolares (license 1167)
          Tested by: jsolares, twilson
          ........

          ------------------------------------------------------------------------

          http://svn.digium.com/view/asterisk?view=rev&revision=297956

          Show
          Digium Subversion added a comment - Repository: asterisk Revision: 297956 _U trunk/ U trunk/main/features.c ------------------------------------------------------------------------ r297956 | twilson | 2010-12-09 15:26:19 -0600 (Thu, 09 Dec 2010) | 17 lines Merged revisions 297952 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r297952 | twilson | 2010-12-09 14:48:44 -0600 (Thu, 09 Dec 2010) | 10 lines Don't crash after Set(CDR(userfield)=...) in ast_bridge_call Instead of setting peer->cdr = NULL, set it to not post. (closes issue ASTERISK-17058 ) Reported by: macbrody Patches: patch-18415 uploaded by jsolares (license 1167) Tested by: jsolares, twilson ........ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=297956
          Hide
          Leif Madsen added a comment -

          Looks like this made it in time, so it will indeed be part of 1.8.2-rc1 (not 1.8.3-rc1 as originally scheduled).

          Show
          Leif Madsen added a comment - Looks like this made it in time, so it will indeed be part of 1.8.2-rc1 (not 1.8.3-rc1 as originally scheduled).

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development