Uploaded image for project: 'ORC'
  1. ORC
  2. ORC-1159

[C++] Crash when the last stripe is skipped

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 1.8.0
    • 1.8.0
    • C++
    • None

    Description

      I encountered a crash when using orc-scan to read the attached orc file with sargs "id < 10".

      Program received signal SIGSEGV, Segmentation fault.
      0x0000000000764039 in orc::RowReaderImpl::next (data=..., this=0xf67610) at /home/quanlong/workspace/orc/c++/src/Reader.cc:1153
      1153	    if (enableEncodedBlock) {
      (gdb) bt
      #0  0x0000000000764039 in orc::RowReaderImpl::next (data=..., this=0xf67610) at /home/quanlong/workspace/orc/c++/src/Reader.cc:1153
      #1  orc::RowReaderImpl::next (this=0xf67610, data=...) at /home/quanlong/workspace/orc/c++/src/Reader.cc:1122
      #2  0x0000000000745646 in scanFile(std::ostream&, char const*, unsigned long, orc::RowReaderOptions const&) () at /home/quanlong/workspace/orc/tools/src/FileScan.cc:34
      #3  0x0000000000741883 in main () at /home/quanlong/workspace/orc/tools/src/FileScan.cc:58
      #4  0x00007ffff68ab840 in __libc_start_main (main=0x7416c0 <main>, argc=2, argv=0x7fffffffdd48, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdd38) at ../csu/libc-start.c:291
      #5  0x0000000000745479 in _start () at /home/quanlong/workspace/orc/tools/src/FileScan.cc:49
      (gdb) p reader
      $1 = std::unique_ptr<orc::ColumnReader> = {get() = 0x0}
      

      Codes:

          if (enableEncodedBlock) {
            reader->nextEncoded(data, rowsToRead, nullptr);
          }
          else {
            reader->next(data, rowsToRead, nullptr);
          }
      

      reader is a nullptr thus the process crashes.

      The bug is introduced by a recent improvement (ORC-969). When startNextStripe() skippes all the remaining stripes, we should set rowsToRead to 0.

      Attachments

        1. alltypes_non_acid.orc
          33 kB
          Quanlong Huang

        Issue Links

          Activity

            People

              stigahuang Quanlong Huang
              stigahuang Quanlong Huang
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: