Infinite loop when reading corrupt raw banks

When reading raw banks from an MDF file LHCb can enter an infinite loop.

Here is a single event MDF file (from Moore#785) which triggers the problem:

289233_00120016_0000.evt-404335.raw

And here is an annotated hex dump of the file:

https://cburr.web.cern.ch/Moore-697/289233_00120016_0000.evt-404335_event-1.html

I belive the problem is that LHCb doesn't:

  • Ensure a raw bank starts with the magic bytes (0xcbcb)
  • Ensure that the size of a raw bank is at least the size of the raw bank header

This causes the reading to get stuck in a loop where it keeps reading the same zero sized "raw bank" over and over again.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information