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

TSDebug will cause ats to crash with a long string

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • sometime
    • TS API
    • None

    Description

      All we need to do is to call TSDebug like this with a long string of 1200+ characters

      TSDebug(tag, "123123123123...", NULL);

      Here is a sample stack trace.

      Core was generated by `/home/y/bin/traffic_server -M --httpport 80:fd=8,443:fd=9:ssl'.
      Program terminated with signal 11, Segmentation fault.
      #0  0x00002abfb339ac7f in Diags::print_va(const char *, DiagsLevel, const SrcLoc *, const char *, typedef __va_list_tag __va_list_tag *) const (this=0x22359b0, debu
      g_tag=0x2abfef4f1424 "ts_lua", diags_level=DL_Diag, loc=0x0, format_string=0x413c24a8 "asdasd", '1' <repeats 13 times>, "2222222111111111122222211111111112222221111
      111111222222111111111122222211111111112222221111111111222222111111111122222211111111112222221111111111222222111111111122222211111111112222"..., ap=0x2abfb90134b0) a
      t Diags.cc:254
      254	Diags.cc: No such file or directory.
      	in Diags.cc
      Starting GDB Here
      =================
      #0  0x00002abfb339ac7f in Diags::print_va(const char *, DiagsLevel, const SrcLoc *, const char *, typedef __va_list_tag __va_list_tag *) const (this=0x22359b0, debu
      g_tag=0x2abfef4f1424 "ts_lua", diags_level=DL_Diag, loc=0x0, format_string=0x413c24a8 "asdasd", '1' <repeats 13 times>, "2222222111111111122222211111111112222221111
      111111222222111111111122222211111111112222221111111111222222111111111122222211111111112222221111111111222222111111111122222211111111112222"..., ap=0x2abfb90134b0) a
      t Diags.cc:254
              buffer = 0x2abfef4f1424 "ts_lua"
              d = 0x22359b0 "pW#\002"
              format_buf_w_ts = "\000\000\000\000\000\000\000\000@,\001\271\277*", '\000' <repeats 114 times>, "[Jan  4 07:09:26.996] Server {0x2abfb901c700} DIAG: (ts_1\
      254\306\061\347\305\352A] req_id*\024O\357\277*\000\000*\024O\357\277*\000\000\360\061\001\271\277*\000\000\035^#\002", '\000' <repeats 12 times>, "\002\000\000\000
      \000\000\000\000Bq\001 1", '\000' <repeats 19 times>, "\002", '\000' <repeats 39 times>, "1\254\306\061\347\305\352A$\024O\357\277*", '\000' <repeats 18 times>, "p2
      \001\271\002\000\000\000\035^#\002", '\000' <repeats 12 times>, "\002\000\000\000\377\377\377\177\000\000\000\000\000\000\000\000"...
              cur_clock = 3544668469065757234
              timestamp_buf = "111122222211111111112222221111111111222222111111"
              format_buf = "{0x2abfb901c700} DIAG: (ts_lua) asdasd", '1' <repeats 13 times>, "2222222111111111122222211111111112222221111111111222222111111111122222211111
      1111122222211111111112222221111111111222222111111111122222211111111112222221111111111"...
              id = 47002931021568
              tp = {tv_sec = 3617008641886990641, tv_usec = 3544668469065757234}
              s = 0x64d83136 <Address 0x64d83136 out of bounds>
              end_of_format = 0x2abfb901343c ""
      #1  0x000000000051a53e in TSDebug (tag=0x2abfef4f1424 "ts_lua", format_str=0x413c24a8 "asdasd", '1' <repeats 13 times>, "2222222111111111122222211111111112222221111
      111111222222111111111122222211111111112222221111111111222222111111111122222211111111112222221111111111222222111111111122222211111111112222"...) at InkAPI.cc:6831
              ap = {{gp_offset = 16, fp_offset = 48, overflow_arg_area = 0x2abfb90135a0, reg_save_area = 0x2abfb90134d0}}
      #2  0x00002abfef4edf73 in ts_lua_debug (L=<value optimized out>) at trafficserver/plugins/experimental/ts_lua/ts_lua_misc.c:82
              msg = <value optimized out>
      #3  0x00000000005b7c38 in lj_BC_FUNCC ()
              g_rec_config_contents_ht = 0x2234070
              g_rec_config_fpath = 0x0
              g_rec_config_contents_llq = 0x2233ff0
              g_rec_config_lock = {__data = {__lock = 0, __count = 0, __owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, __size =
       '\000' <repeats 39 times>, __align = 0}
      #4  0x0000000000576dd0 in lua_pcall (L=<value optimized out>, nargs=<value optimized out>, nresults=<value optimized out>, errfunc=<value optimized out>) at lj_api.
      c:1052
              g = 0x413b13b8
              oldh = 0 '\000'
              ef = <value optimized out>
              status = <value optimized out>
      #5  0x00002abfef4e7621 in globalHookHandler (contp=<value optimized out>, event=TS_EVENT_HTTP_READ_REQUEST_HDR, edata=0x2aaab62f5990) at trafficserver/plugins/exper
      imental/ts_lua/ts_lua.c:332
              txnp = 0x2aaab62f5990
              bufp = 0x2aaab62f5c98
              hdr_loc = 0x806cd48
              url_loc = 0x806cfc8
              ret = <value optimized out>
              req_id = <value optimized out>
              txn_contp = 0x7dff980
              l = 0x407f9460
              main_ctx = 0x2576478
              http_ctx = 0x2abff803ce60
              conf = <value optimized out>
              __FUNCTION__ = "globalHookHandler"
      #6  0x000000000050b6b8 in INKContInternal::handle_event (this=0x240b060, event=60002, edata=0x2aaab62f5990) at InkAPI.cc:1000
      No locals.
      #7  0x00000000004f6cc8 in Continuation::handleEvent (this=0x240b060, event=60002, data=0x2aaab62f5990) at ../iocore/eventsystem/I_Continuation.h:146
      No locals.
      #8  0x000000000050beff in APIHook::invoke (this=0x2406620, event=60002, edata=0x2aaab62f5990) at InkAPI.cc:1219
      No locals.
      #9  0x00000000005ce6cd in HttpSM::state_api_callout (this=0x2aaab62f5990, event=60000, data=0x0) at HttpSM.cc:1383
              plugin_lock = false
              plugin_mutex = {m_ptr = 0x0}
              hook = 0x2406620
              api_next = HttpSM::API_RETURN_UNKNOWN
              __func__ = "state_api_callout"
      #10 0x00000000005ce0fa in HttpSM::state_api_callback (this=0x2aaab62f5990, event=60000, data=0x0) at HttpSM.cc:1276
              __func__ = "state_api_callback"
      
      

      Attachments

        Activity

          People

            kichan Shu Kit Francis Chan
            kichan Shu Kit Francis Chan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: