{"issue":{"milestone":null,"title":"[FNL-50] BTreeBuilder::truncate will result in an assert if it is called before an actual tree has been built","created_at":"2011-12-30T03:27:42Z","user":{"login":"dynamobi-build","id":1123017,"url":"https://api.github.com/users/dynamobi-build","avatar_url":"https://secure.gravatar.com/avatar/cb215b3d786be20761071a562a56af64?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"cb215b3d786be20761071a562a56af64"},"labels":[{"name":"BTree","url":"https://api.github.com/repos/dynamobi/dynamobi/labels/BTree","color":"573f5d"},{"name":"FNL","url":"https://api.github.com/repos/dynamobi/dynamobi/labels/FNL","color":"6124ad"}],"updated_at":"2011-12-30T03:27:43Z","state":"closed","id":2685918,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"closed_at":"2011-12-30T03:27:43Z","html_url":"https://github.com/dynamobi/dynamobi/issues/458","body":"<b><i>[reporter=\"zfong\", created=\"Fri, 11 Aug 2006 11:28:38 -0500 (GMT-05:00)\"]</i></b>\nWhile testing the new resource governor, I hit a case where the governor couldn't allocate the total min requirements for a stream graph (because I hadn't yet changed sorter to not ask for a lower min than opt), so the governor threw an exception, as I'd expect.  But during exception handling, I hit an assert when BTreeBuilder::truncate got called through BTreeSortExecStream::closeImpl.  Here's the excerpt of the stack trace:<br/>\n<br/>\n#7  0xb0d66a5b in fennel::RandomAllocationSegment::translatePageId (<br/>\n    this=0x8381b30, pageId={val = 18446744073709551615})<br/>\n    at RandomAllocationSegment.cpp:393<br/>\n#8  0xb11ea7aa in fennel::SegPageLock::lockPage (this=0xbfce65e4, pageId=<br/>\n      {val = 18446744073709551615}, lockModeInit=LOCKMODE_X,<br/>\n    readIfUnmapped=true) at SegPageLock.h:155<br/>\n#9  0xb100a66b in fennel::SegPageLock::lockExclusive (this=0xbfce65e4, pageId=<br/>\n      {val = 18446744073709551615}) at SegPageLock.h:186<br/>\n#10 0xb0fbfe9b in fennel::BTreeBuilder::truncate (this=0xbfce6654,<br/>\n    rootless=true, pLeafPageIdProj=0x0) at BTreeBuilder.cpp:359<br/>\n#11 0xb1051b94 in fennel::BTreeSortExecStream::truncateTree (this=0x8657f80,<br/>\n    rootless=true) at BTreeSortExecStream.cpp:115<br/>\n#12 0xb1051c2a in fennel::BTreeSortExecStream::closeImpl (this=0x8657f80)<br/>\n    at BTreeSortExecStream.cpp:124<br/>\n#13 0xb0c7f593 in fennel::ClosableObject::close (this=0x86580a0)<br/>\n    at ClosableObject.cpp:45<br/>\n<br/>\nThe assert occurs, I assume, because BTreeBuilder::truncate() tries to lock NULL_PAGE_ID since the exception occurs before any real work has been done on the stream, and therefore, there is no btree yet.<br/>\n<br/>\nI don't have a \"real\" testcase since it depends on code that's still in development, but hopefully this description provides enough context on the problem.<br/>\n","number":458,"url":"https://api.github.com/repos/dynamobi/dynamobi/issues/458","comments":0,"assignee":null},"action":"closed"}