Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-3821

Segmentation fault possibly due leaks in atscppapi



    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • None
    • None
    • CPP API
    • None



      I'm getting segmentation faults with ATS 5.3.1, possibly when I enabled plugins in atscppapi, in which are used other Plugins than GlobalPlugin (TransformationPlugin, InterceptionPlugin,...)

      i'm building traffic server only with parameters:
      ./configure --prefix=/install --exec-prefix=/exec --with-user=trafficserver --enable-cppapi

      I'm getting segfault:

      traffic_server: Segmentation fault (Address not mapped to object [(nil)])
      traffic_server - STACK TRACE: 

      I tried to find an Issue and found possible leak in dectructor ~Transaction() of Transaction.cc file.
      The leak is, there is added plugin by addPlugin(TransactionPlugin *);
      and according to documentation https://docs.trafficserver.apache.org/en/latest/api/classatscppapi_1_1Transaction.html#a9835e610553275d197cabfbd6d1cab7b, Transaction should be responsible for cleaning.
      But nothing removes items of list state_.plugins_, where should be pointers to memory allocated with new, which won't be deleted by delete state_;

      I tried to correct it with

      for (TransactionPlugin* tmp : state_->plugins_) {
            delete tmp;

      But it didn't work. I'm getting similar segfault with another

      traffic_server: Segmentation fault (Invalid permissions for mapped object [0x2b86141ea898])
      traffic_server - STACK TRACE: 

      I tried to find more deep and find the plugins should be freed by delete in another class in file utils_internal.cc.
      But if this is true, I should see in debug mode message, which is printed before delete:

      LOG_DEBUG("Locked Mutex...Deleting transaction plugin at %p", *iter);

      But I don't see such messages in log.
      I can see in error.log lot of these messages. I'm getting them at least every second.

      20150805.16h37m04s [atscppapi] [Transaction.cc:343, operator()()] server request already initialized

      Can you help me find the issue? Thanks for help in advance.


        1. AlwaysCache.cc
          0.8 kB
          Jiri Podhorsky
        2. BlockIP.cc
          3 kB
          Jiri Podhorsky
        3. EditHeader.cc
          2 kB
          Jiri Podhorsky



            briang Brian Geffon
            ksj Jiri Podhorsky
            0 Vote for this issue
            4 Start watching this issue