Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Error loading trace data Error: Data version 2573 not supported #598

Closed
romuald-villetet opened this issue May 11, 2017 · 3 comments · Fixed by #615
Closed

Error loading trace data Error: Data version 2573 not supported #598

romuald-villetet opened this issue May 11, 2017 · 3 comments · Fixed by #615

Comments

@romuald-villetet
Copy link

Whenever i use the chrome extension(version 2015.7.15.1 on windows 10) to load .wtf-trace generated by the current master cpp bindings code. (Compiler is msvs2017) The chrome extension outputs :

Error loading trace data
Error: Data version 2573 not supported

I'm currently using web tracing framework for visualizing my multithreaded applications.

@romuald-villetet
Copy link
Author

romuald-villetet commented May 11, 2017

When i inspect the binary data. There seems to be a 1 bit offset when writing uint32_t values. I'm running a 64 bit version of windows 10. see the attached screenshots.
bit-number-9-should-have-32-bit-value-10
bit-number-10-has-32-bit-value-10

@robindegen
Copy link

robindegen commented Jul 23, 2018

I'm honestly surprised there has been no response to this. I also have this bug when running the threaded_torture_test.cc on windows 7 with Visual Studio 2017 64-bit builds.

Update: building a 32-bit version yields the same result.

@stevenhoving
Copy link

stevenhoving commented Jul 24, 2018

This is a platform specific bug, it seems to me that on windows doing a open append on a std::fstream does not automatically set the file pointer to the end of the file. So if we force this behavior, then this bug is fixed.

bool Runtime::SaveToFile(const std::string& file_name,
                         const SaveOptions& save_options) {
  std::fstream out;
  auto mode = save_options.open_mode | std::ios_base::out | std::ios_base::binary;
  out.open(file_name, mode);
  if (out.fail()) {
    return false;
  }

  bool append = (mode & std::ios_base::app) ? true : false;
  if (append) { // <-- the fix
      out.seekg(0, SEEK_END); // <-- the fix
  } // <-- the fix

  // If the file was deleted out from under us, reset the checkpoint.
  if (append && save_options.checkpoint && out.tellp() == std::streampos(0)) {
    *save_options.checkpoint = SaveCheckpoint{};
  }

  bool success = wtf::Runtime::GetInstance()->Save(&out, save_options);
  out.close();
  return success && !out.fail();
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants