Traffic Server
  1. Traffic Server
  2. TS-1205

Crash report: double free when RecDataSet in cluster mode

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.3
    • Fix Version/s: 3.1.4
    • Component/s: Clustering, Configuration
    • Labels:
      None
    • Environment:

      v3.0.x, with cluster mode 2

      Description

      we have seen some config system syncing config files in cluster mode.

      *** glibc detected *** /usr/bin/traffic_server: double free or corruption (fasttop): 0x00002b639c0009a0 ***
      ======= Backtrace: =========
      /lib64/libc.so.6[0x3f8f0750c6]
      /usr/bin/traffic_server(RecDataSet(RecDataT, RecData*, RecData*)+0xb8)[0x65dd58]
      /usr/bin/traffic_server(RecForceInsert(RecRecord*)+0x74)[0x6584b4]
      /usr/bin/traffic_server[0x65cd62]
      /usr/bin/traffic_server(RecMessageRecvThis(void*, char*, int)+0x16)[0x65ed46]
      /usr/bin/traffic_server(BaseManager::executeMgmtCallback(int, char*, int)+0x3d)[0x5b562d]
      /usr/bin/traffic_server(ProcessManager::processEventQueue()+0x29)[0x5b5d49]
      /usr/bin/traffic_server(startProcessManager(void*)+0x8d)[0x5b633d]
      /lib64/libpthread.so.0[0x3f8f4077f1]
      /lib64/libc.so.6(clone+0x6d)[0x3f8f0e570d]
      ======= Memory map: ========
      

        Activity

        Zhao Yongming created issue -
        Hide
        Zhao Yongming added a comment -

        may or may not be the problem of clustering, need more investing into the RecCore & cluster mode config syncing

        Show
        Zhao Yongming added a comment - may or may not be the problem of clustering, need more investing into the RecCore & cluster mode config syncing
        Zhao Yongming made changes -
        Field Original Value New Value
        Assignee kuotai [ kuotai ]
        Hide
        Zhao Yongming added a comment -

        here is a quick fix for this:

        diff --git a/lib/records/RecUtils.cc b/lib/records/RecUtils.cc
        index b47310f..a337efc 100644
        --- a/lib/records/RecUtils.cc
        +++ b/lib/records/RecUtils.cc
        @@ -86,7 +86,7 @@ RecDataSet(RecDataT data_type, RecData * data_dst, RecData * data_src)
               }
             } else if (((data_dst->rec_string) && (strcmp(data_dst->rec_string, data_src->rec_string) != 0)) ||
                        ((data_dst->rec_string == NULL) && (data_src->rec_string != NULL))) {
        -      ats_free(data_dst->rec_string);
        +      if (data_dst->rec_string) ats_free(data_dst->rec_string);
               data_dst->rec_string = ats_strdup(data_src->rec_string);
               rec_set = true;
             }
        lines 1-13/13 (END)
        
        Show
        Zhao Yongming added a comment - here is a quick fix for this: diff --git a/lib/records/RecUtils.cc b/lib/records/RecUtils.cc index b47310f..a337efc 100644 --- a/lib/records/RecUtils.cc +++ b/lib/records/RecUtils.cc @@ -86,7 +86,7 @@ RecDataSet(RecDataT data_type, RecData * data_dst, RecData * data_src) } } else if (((data_dst->rec_string) && (strcmp(data_dst->rec_string, data_src->rec_string) != 0)) || ((data_dst->rec_string == NULL) && (data_src->rec_string != NULL))) { - ats_free(data_dst->rec_string); + if (data_dst->rec_string) ats_free(data_dst->rec_string); data_dst->rec_string = ats_strdup(data_src->rec_string); rec_set = true ; } lines 1-13/13 (END)
        Hide
        Zhao Yongming added a comment -

        in d1b18044c473dd0c8d1964084d7ca66968fc0551

        Show
        Zhao Yongming added a comment - in d1b18044c473dd0c8d1964084d7ca66968fc0551
        Zhao Yongming made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee kuotai [ kuotai ] Zhao Yongming [ zym ]
        Fix Version/s 3.1.4 [ 12318543 ]
        Fix Version/s 3.3.0 [ 12316495 ]
        Resolution Fixed [ 1 ]
        Leif Hedstrom made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Zhao Yongming
            Reporter:
            Zhao Yongming
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development