bm_empty_buffers() calls the bm_skip_event(int buffer_handle) function using the wrong index

Issue #227 resolved
Ran Hong created an issue

In the bm_empty_buffers(), the function bm_skip_event(int buffer_handle) is called, but the incorrect index is passed. buffer_handle should be larger than idx by 1. buffer_handle=0 is an invalid handle.

I suggest change the line

bm_skip_event(idx); -> bm_skip_event(idx+1);

Also, the return code from bm_skip_event is not returned to the caller of bm_empty_buffers.

Comments (4)

  1. Stefan Ritt

    Dear Ran, you should receive an award for finding that bug. It’s in midas since Oct. 1998, so congratulations for finding a 22 year old bug

    I changed that and committed it to the develop branch.

  2. Ran Hong reporter

    Hi Stefan,

    I am working for the Muon g-2 collaboration on the DAQ system. I am upgrading Midas from the previous version and found this bug. However, I don’t think bm_empty_buffers() calls the bm_skip_event(int) function in my previous version of Midas which was checked out in summer 2018. Did this bug show up in a different way before?

    Thanks!

    Ran Hong

  3. Log in to comment