Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.0, 2.0.0a
    • Fix Version/s: 2.0.0
    • Component/s: Logging
    • Labels:
      None

      Description

      Both trunk and 2.0.x branch segfaults when trying to run traffic_logcat or traffic_logstats:

      (gdb) bt
      #0 0x00000000006ef566 in ink_hash_table_lookup_entry (ht_ptr=0x0, key=0x709b58 "proxy.config.stack_dump_enabled") at ink_hash_table.cc:249
      #1 0x00000000006ef4aa in ink_hash_table_lookup (ht_ptr=0x0, key=0x709b58 "proxy.config.stack_dump_enabled", value_ptr=0x7fffffffe160) at ink_hash_table.cc:190
      #2 0x00000000006db02a in RecGetRecord_Xmalloc (name=0x709b58 "proxy.config.stack_dump_enabled", data_type=RECD_INT, data=0x7fffffffe1a0, lock=true) at RecCore.cc:915
      #3 0x00000000006da333 in RecGetRecordInt (name=0x709b58 "proxy.config.stack_dump_enabled", rec_int=0x7fffffffe248, lock=true) at RecCore.cc:454
      #4 0x00000000004f95ad in init_signals () at signals.cc:469
      #5 0x00000000004cdb5a in init_system () at ./logging/LogStandalone.cc:125
      #6 0x00000000004ce2d2 in init_log_standalone_basic (pgm_name=0x7034d8 "traffic_logcat") at ./logging/LogStandalone.cc:329
      #7 0x00000000004cebf6 in main (argc=1, argv=0x7fffffffe468) at logcat.cc:271

        Activity

        Hide
        Leif Hedstrom added a comment -

        What I'd suggest we do is to change the prototype for init_signals to

        void
        init_signals(bool do_stackdump=true);

        (and change the logic in there to use do_stackdump).

        Then move these lines to proxy/Main.cc (and anything else that needs to "support" this):

        RecInt stackDump;
        bool found = (RecGetRecordInt("proxy.config.stack_dump_enabled", &stackDump) == REC_ERR_OKAY);

        and then use this result as the flag to init_signals().

        Show
        Leif Hedstrom added a comment - What I'd suggest we do is to change the prototype for init_signals to void init_signals(bool do_stackdump=true); (and change the logic in there to use do_stackdump). Then move these lines to proxy/Main.cc (and anything else that needs to "support" this): RecInt stackDump; bool found = (RecGetRecordInt("proxy.config.stack_dump_enabled", &stackDump) == REC_ERR_OKAY); and then use this result as the flag to init_signals().
        Hide
        Leif Hedstrom added a comment -

        The problem is a "new" requirement on finding Records stuff in signals.cc. Disabling this fixes the problem:

        Index: proxy/signals.cc
        ===================================================================
        — proxy/signals.cc (revision 926615)
        +++ proxy/signals.cc (working copy)
        @@ -465,13 +465,13 @@ check_signal_thread(void *)
        void
        init_signals()
        {

        • RecInt stackDump;
        • bool found = (RecGetRecordInt("proxy.config.stack_dump_enabled", &stackDump) == REC_ERR_OKAY);
          + //RecInt stackDump;
          + // bool found = (RecGetRecordInt("proxy.config.stack_dump_enabled", &stackDump) == REC_ERR_OKAY);
        • if(found == false) { - Warning("Unable to determine stack_dump_enabled , assuming enabled"); - stackDump = 1; - }

          + // if(found == false)

          { + // Warning("Unable to determine stack_dump_enabled , assuming enabled"); + // stackDump = 1; + // }

        sigset_t sigsToBlock;
        sigemptyset(&sigsToBlock);
        @@ -482,10 +482,10 @@ init_signals()
        set_signal(SIGTERM, (SigActionFunc_t) signal_handler);
        set_signal(SIGHUP, (SigActionFunc_t) interrupt_handler);
        set_signal(SIGILL, (SigActionFunc_t) signal_handler);

        • if(stackDump == 1)
          Unknown macro: {+ // if(stackDump == 1) { set_signal(SIGBUS, (SigActionFunc_t) signal_handler); set_signal(SIGSEGV, (SigActionFunc_t) signal_handler); - }+ // }

        //
        // Presviously the following lines were #if 0

        We'll have to check with VJ if this is something that needs to be in there or not.

        Show
        Leif Hedstrom added a comment - The problem is a "new" requirement on finding Records stuff in signals.cc. Disabling this fixes the problem: Index: proxy/signals.cc =================================================================== — proxy/signals.cc (revision 926615) +++ proxy/signals.cc (working copy) @@ -465,13 +465,13 @@ check_signal_thread(void *) void init_signals() { RecInt stackDump; bool found = (RecGetRecordInt("proxy.config.stack_dump_enabled", &stackDump) == REC_ERR_OKAY); + //RecInt stackDump; + // bool found = (RecGetRecordInt("proxy.config.stack_dump_enabled", &stackDump) == REC_ERR_OKAY); if(found == false) { - Warning("Unable to determine stack_dump_enabled , assuming enabled"); - stackDump = 1; - } + // if(found == false) { + // Warning("Unable to determine stack_dump_enabled , assuming enabled"); + // stackDump = 1; + // } sigset_t sigsToBlock; sigemptyset(&sigsToBlock); @@ -482,10 +482,10 @@ init_signals() set_signal(SIGTERM, (SigActionFunc_t) signal_handler); set_signal(SIGHUP, (SigActionFunc_t) interrupt_handler); set_signal(SIGILL, (SigActionFunc_t) signal_handler); if(stackDump == 1) Unknown macro: {+ // if(stackDump == 1) { set_signal(SIGBUS, (SigActionFunc_t) signal_handler); set_signal(SIGSEGV, (SigActionFunc_t) signal_handler); - }+ // } // // Presviously the following lines were #if 0 We'll have to check with VJ if this is something that needs to be in there or not.

          People

          • Assignee:
            Leif Hedstrom
            Reporter:
            Leif Hedstrom
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development