Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-16046

valgrind reports data access error in kafka plugin

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.0.6
    • Component/s: Plugins
    • Labels:
      None

      Description

      valgrind reports the following error running the regression suite. I wonder if it is because payload in the following line:

      DBGLOG("Kafka: Error publishing message: %d (%s); message: '%s'", message.err(), message.errstr().c_str(), static_cast<char*>(message.payload()));

      is not guaranteed to be 0 terminated.

      ==11938== Invalid read of size 1
      ==11938==    at 0x5941319: vfprintf (vfprintf.c:2047)
      ==11938==    by 0x5967498: vsnprintf (vsnprintf.c:119)
      ==11938==    by 0x5EB963A: StringBuffer::limited_valist_appendf(unsigned int, char const*, __va_list_tag*) (jstring.cpp:415)
      ==11938==    by 0x51678AE: StringBuffer::valist_appendf(char const*, __va_list_tag*) (jstring.hpp:74)
      ==11938==    by 0x5E2E314: LogMsg::LogMsg(LogMsgCategory const&, unsigned int, LogMsgJobInfo const&, int, char const*, __va_list_tag*, unsigned int, unsigned int, unsigned long long) (in /opt/HPCCSystems/lib/libjlib.so)
      ==11938==    by 0x5E28682: CLogMsgManager::report_va(LogMsgCategory const&, LogMsgJobInfo const&, char const*, __va_list_tag*) (jlog.cpp:1535)
      ==11938==    by 0x514153A: DBGLOG(char const*, ...) (jlog.hpp:812)
      ==11938==    by 0x1D036FD9: KafkaPlugin::Publisher::dr_cb(RdKafka::Message&) (kafka.cpp:478)
      ==11938==    by 0x1D47EAC5: dr_msg_cb_trampoline(rd_kafka_s*, rd_kafka_message_s const*, void*) (ProducerImpl.cpp:47)
      ==11938==    by 0x1D24E92D: rd_kafka_poll_cb (rdkafka.c:1717)
      ==11938==    by 0x1D24F82B: rd_kafka_q_serve (rdkafka.c:482)
      ==11938==    by 0x1D035D77: KafkaPlugin::Poller::run() (kafka.cpp:280)
      ==11938==  Address 0x37a4ac9f is 0 bytes after a block of size 95 alloc'd
      ==11938==    at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==11938==    by 0x1D25E00D: rd_kafka_msg_new0.isra.0 (rdkafka_msg.c:87)
      ==11938==    by 0x1D25E580: rd_kafka_msg_new (rdkafka_msg.c:141)
      ==11938==    by 0x1D47E95B: RdKafka::ProducerImpl::produce(RdKafka::Topic*, int, int, void*, unsigned long, std::string const*, void*) (ProducerImpl.cpp:106)
      ==11938==    by 0x1D036C07: KafkaPlugin::Publisher::sendMessage(std::string const&, std::string const&) (kafka.cpp:428)
      

        Attachments

          Activity

            People

            • Assignee:
              dcamper Dan S. Camper
              Reporter:
              ghalliday Gavin Halliday
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: