min-cscope sort fails on very large dbs
Brought to you by:
elad_lahav
min-cscope -v -b -q -u
on windows. It works great for smaller repos (350-750Mb cscope.out), but one repo generates a cscope.out that is ~1.4Gb in size. For this instance I get the following error:SetEndOfFile: The requested operation cannot be performed on a file with a user-mapped section open.
cscope: failed to sort file
cscope: cannot create inverted index; ignoring -q option
cscope: removed files ncscope.in.out and ncscope.po.out
==================================================================
Looking at the call in sort/os_win.c and the msdn page for SetEndOfFile, it looks like UnmapViewOfFile should be called for every mapped page? I'm not sure why this only appears on large files though.
You may be hitting a 2GB Windows limit on the file size, as the code attempts to double the size of the file every time it becomes full. Thus, when it hits 1 GB, it will try to grow the file to 2 GB, which I remember as being some limit imposed on file sizes.
I'll try to fix this by limiting the size to which the file can grow (or you can try this yourself and let me know if it works, as I don't have any codebase that generates a cscope.out file greater than 700 MB).