inet icon indicating copy to clipboard operation
inet copied to clipboard

BitErrorRate filter sending very small value to cHistogram result recorder causing crash

Open edlongman opened this issue 4 years ago • 2 comments

The error thrown by the cHistogram is recorded here: https://github.com/omnetpp/omnetpp/issues/863

However, a workaround is to limit the minimum value of the result filter in ResultFilters.cc with the following:

void BitErrorRateFromErrorRateIndFilter::receiveSignal(cResultFilter *prev, simtime_t_cref t, cObject *object, cObject *details)
{
    if (auto pk = dynamic_cast<Packet *>(object)) {
        auto tag = pk->findTag<ErrorRateInd>();
        if (tag){
            const double ber = tag->getBitErrorRate();
            fire(this, t, (ber<2e-320)?0.0:ber, details);  //TODO isNaN?
        }
    }
}

The value was being generated by a Ieee802154Radio with modulation QPSK, calling BpskModulation::calculateSER(snir = 2.6374, bandwidth = 2.8e6, bitrate=10e3) = 2e-323

edlongman avatar Jan 26 '21 14:01 edlongman

I think this should be fixed in omnet, otherwise we end up with this condition all over the place. I leave this open until it gets fixed there.

levy avatar Jan 28 '21 08:01 levy

I agree, this is very much a workaround of the actual bug, which is only triggered in very speific circumstances!

edlongman avatar Jan 28 '21 09:01 edlongman

The related omnet bug has been closed, so I close this issue now.

levy avatar Feb 22 '23 08:02 levy