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

Crash when reattaching to C++ API Stats.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 7.0.0
    • Fix Version/s: 7.1.0
    • Component/s: CPP API, Metrics
    • Labels:
      None

      Description

      Program received signal SIGSEGV, Segmentation fault.
      0x00000000007f733c in ink_atomic_swap<long> (mem=0x0, value=1) at ../../lib/ts/ink_atomic.h:76
      76	  return __sync_lock_test_and_set(mem, value);
      (gdb) where
      #0  0x00000000007f733c in ink_atomic_swap<long> (mem=0x0, value=1) at ../../lib/ts/ink_atomic.h:76
      #1  0x00000000007f6e56 in RecSetGlobalRawStatSum (rsb=0x2f16290, id=6, data=1) at RecRawStats.cc:482
      #2  0x00000000005372c9 in TSStatIntSet (the_stat=6, value=1) at InkAPI.cc:6944
      #3  0x00002ae6d3398bb1 in atscppapi::Stat::set (this=0x2ae6d37c2890 <...>, value=1) at Stat.cc:78
      #4  0x00002ae6d35bb826 in TSPluginInit (argc=1, argv=0x7ffd0613bfe0) at /home/jpeach/n/....cc:753
      #5  0x00000000005550e5 in plugin_load (argc=1, argv=0x7ffd0613bfe0, validateOnly=false) at Plugin.cc:137
      

      The change in TS-4793 regressed the C++ API Stat object. What happens is that if you restart traffic_server without traffic_manager, the TSStatFindName call finds the metric in the records hash table, but traffic_server has not set up the RSB entry so actually incrementing it crashes.

      If you call TSStatCreate twice for the same metric, you will end up with multiple RSB slots being consumed which is almost as bad.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jamespeach James Peach
                Reporter:
                jamespeach James Peach
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m