<div dir="ltr"><span style="font-size:12.8px">In attempting to randomly access lumps in a BSP file that came from a .pk3 archive, I think we've discovered a bug in PhysicsFS.</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">On OS X, it seems that you can not seek backwards in these files. On Windows, it works fine. We've tried PhysicsFS 2.0.3 as well as hg HEAD.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I do not have a minimal test case right now, but here is some of the code in question:</div><div style="font-size:12.8px"><a href="https://github.com/jdolan/quetoo/blob/e555322eb24465134989e11c2489df81eebc41c8/src/collision/cm_bsp.c#L428" target="_blank">https://github.com/jdolan/<wbr>quetoo/blob/<wbr>e555322eb24465134989e11c2489df<wbr>81eebc41c8/src/collision/cm_<wbr>bsp.c#L428</a><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">This is called in loop to load the lumps of the BSP that the game is interested in. The first time this function is called on such a file, it succeeds (the seek is a no-op). However, subsequent invocations will fail to seek to offset 0, despite advertising that the seek was successful. The subsequent read will then fail or, worse, retrieve garbage data.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><span style="font-size:12.8px">One of our developers on Windows does not have this crash.. seeking back to 0 in the archive-sourced file works fine for him. </span>So I can only conclude that seeking backwards in zip-sourced files does not work correctly on OS X. </div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Is this a known issue?</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Thanks!</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">--</div><div style="font-size:12.8px">Jay Dolan</div><div style="font-size:12.8px">508-415-1866</div></div>