Vikas89 commented on issue #12800: getting segfault while running 
train_cifar10.py program in example directory
URL: 
https://github.com/apache/incubator-mxnet/issues/12800#issuecomment-431079877
 
 
    I encountered the issue again, sorry for the confusion.
   
   If I revert the changes made in this commit in dmlc_core submodule, the 
issue is gone
   
https://github.com/dmlc/dmlc-core/commit/e3377de933d3e069635150fb330ce6cc33b57950#diff-855ba648d1f4003608aa37ba3d060043
   
   My changes in dmlc-core/src/io/input_split_base.cc which fixes the problem
   
   ```
   +  if (nread != max_size) {
   +    *size = nread;
   +    return true;
   +  } else {
   +    const char *bptr = reinterpret_cast<const char*>(buf);
   +    // return the last position where a record starts
   +    const char *bend = this->FindLastRecordBegin(bptr, bptr + max_size);
   +    *size = bend - bptr;
   +    overflow_.resize(max_size - *size);
   +    if (overflow_.length() != 0) {
   +      std::memcpy(BeginPtr(overflow_), bend, overflow_.length());
   +    }
   +  
   +    return true;
   +  }
   +    /* COMMENTOUT
      if (nread == olen) {  // add extra newline to handle files with NOEOL
        char *bufptr = reinterpret_cast<char*>(buf);
        bufptr[nread] = '\n';
        nread++;
   +    LOG(INFO) << " Added extra line to the file";
      }
    
      const char *bptr = reinterpret_cast<const char*>(buf);
   @@ -241,6 +258,7 @@ bool InputSplitBase::ReadChunk(void *buf, size_t *size) {
        std::memcpy(BeginPtr(overflow_), bend, overflow_.length());
      }
      return true;
   +  */
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to