logcompactor endless loop in kfsclean process

han howard
2009-08-13
2013-04-25
  • han howard

    han howard - 2009-08-13

    I found the logcompactor would endless loop,

    code in src/cc/meta/replay.cc, line 469~475
    like follows:
        while (is_ok && !file.eof()) {
            ++lineno;
            file.getline(line, MAXLINE);
            is_ok = entrymap.parse(line);
            if (!is_ok)
                std::cerr << "Error at line " << lineno << ": "
                        << line << '\n';
        }

      After my unit test the logfile   bin/kfslog/log.3 is the root cause,     looks like file.eof() can't got eofbit,  then it will be endless loop.  I'm not sure th real reason,  can someone point out?  is that a bug?
     

     
    • han howard

      han howard - 2009-08-14

      The problem is fixed,    there is a line is too long, 
      As     const int MAXLINE = 400;   So if more than 400,  then the file.getline(line, MAXLINE) will be endless loop,  So I think the MAXLINE should be changed to larger,  600 or 1024,
      src/cc/meta/replay.cc,  playlog function

       

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks