Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rosbag throws rosbag::IOException at 2GB mark #464

Closed
scott-- opened this issue Jul 14, 2014 · 9 comments
Closed

rosbag throws rosbag::IOException at 2GB mark #464

scott-- opened this issue Jul 14, 2014 · 9 comments

Comments

@scott--
Copy link

scott-- commented Jul 14, 2014

After installing ros-indigo-desktop-full on my 32bit Ubuntu system, rosbag crashes when the bag file becomes about 2GB. It prints the following:

terminate called after throwing an instance of 'rosbag::BagIOException'
 what(): Error writing to file: writing 38 bytes, wrote 8 bytes

My machine is 32bit Ubuntu 14.04 and I installed indigo from the standard repositories.

To recreate on my system I can do the following:

roscore &
rosbag record -o garbage /garbage &
rostopic pub -r 100000 /garbage std_msgs/String "rubbish"

The same process worked fine in previous versions of ROS.

@dirk-thomas
Copy link
Member

I have just tried to reproduce your use case and it does throw an exception on indigo as well as on Hydro. So this is clearly not regression but has been that way before.

You can do one of the following options:

  • use the command line option --split to limit the maximum size of each rosbag file
  • patch rosbag to be able to handle file sizes > 2 GB on 32bit systems
  • use 64bit system (just for the completeness of this list)

Since there are straight forward workarounds and this is more an enhancement request then a regression the maintainers will likely not spend any time on this. Please consider providing a pull request if you would like to improve the behavior on 32bit systems.

@dirk-thomas dirk-thomas added this to the untargeted milestone Jul 21, 2014
@hashmuke
Copy link

I am facing the same problem with hydro, things are working fine with fuerte.

@trthanhquang
Copy link

I am using 64 bit system and have that issue when using the --split --size option, I cannot set the size to be larger than 4096MB because max_size(bytes) is in unit32.

Would it fix the issue by simply changing uint32 to uint64?

@dirk-thomas
Copy link
Member

I don't think that the fix will be that easy but please go ahead and give it a try.

@flixr
Copy link
Contributor

flixr commented Jan 21, 2015

The CMakeLists.txt of rosbag has

# Support large bags (>2GB) on 32-bit systems
add_definitions(-D_FILE_OFFSET_BITS=64)

but it is missing in rosbag_storage.

@flixr
Copy link
Contributor

flixr commented Jan 21, 2015

Seems this got lost when splitting out rosbag_storage with #299
That is also why it was working in fuerte...

@dirk-thomas
Copy link
Member

Thank you, @flixr.

@scott-- Can you please try the patch proposed in #554 on your 32bit system and confirm that it makes bagfiles > 2GB work for you?

@scott--
Copy link
Author

scott-- commented Jan 22, 2015

After doing a git pull, and recompiling, rosbag works as expected.

Thanks.

@dirk-thomas
Copy link
Member

Thank you for checking.

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

No branches or pull requests

5 participants