I've ran into a crash on the supersonic code base when Sorting with disk spill failed to write to disk.
F0227 21:14:42.261183 16499 file_io.cc:203] Check failed: output_file_ == NULL
*** Check failure stack trace: ***
@ 0x80c6da google::LogMessage::Fail()
@ 0x80e3fe google::LogMessage::SendToLog()
@ 0x80c310 google::LogMessage::Flush()
@ 0x80ec2e google::LogMessageFatal::~LogMessageFatal()
@ 0x8e8452 supersonic::FileSink::~FileSink()
@ 0x8d3dbd supersonic::(anonymous namespace)::BasicMerger::AddSorted()
@ 0x8d6189 supersonic::(anonymous namespace)::UnbufferedSorter::Write()
@ 0x8d69a6 supersonic::(anonymous namespace)::BufferingSorter::Write()
@ 0x8d91fe supersonic::SorterSink::Write()
@ 0x8fa52b supersonic::Writer::Write()
@ 0x8fada0 supersonic::Writer::WriteAll()
@ 0x8d469e supersonic::(anonymous namespace)::SortCursor::Next()
@ 0x844f17 supersonic::AggregateClustersCursor::ProcessInput()
@ 0x8456a4 supersonic::AggregateClustersCursor::Next()
...
This is caused by the fact that in BasicMerger::AddSorted() when the call to Sink::WriteAll fails, the failure branch never calls Sink::Finalize and thus when sink goes out of scope and gets destroyed the FileSink destructor does a CHECK(output_file_ == NULL).
I'm not sure what the correct fix in spirt of the supersonic codebase is. Is it that if WriteAll fails then we it should with the cleanup before returning? Or is it Finalize should still be called inside the failure branch in BasicMerger::AddSorted. If you can provide guidance I can fix it and submit the patch upstream back to you guys.
- Milosz