myriadrf / gr-limesdr

gr-limesdr Plugin for GNURadio
Other
142 stars 77 forks source link

Potential integer overflow in sink tag handling code #81

Closed kantooon closed 1 year ago

kantooon commented 1 year ago

I think there's an integer overflow in the gr::limesdr::sink code which handles tags. I discovered this while running a GNU Radio flowgraph which takes time tags for a long time. I've documented the problem here: https://github.com/qradiolink/qradiolink/issues/113

This change: https://github.com/qradiolink/qradiolink/commit/53d0665cd76e32db9bda2157489d0f46deaa0e4d seems to get rid of the issue, but I need to test a little bit more before submitting here. Essentially nitems_read() called in a block returns an uint64_t.

kantooon commented 1 year ago

Steps to reproduce:

  1. Run a flowgraph which generates periodic TX_TIME tags
  2. Wait several(?) hours so that a large number of samples have been passing through the sink
  3. Observe SIGSEGV in gdb with negative nitems_send