Project

General

Profile

Actions

Bug #3407

closed

libosmocore utils_test isqrt_test() may trigger sanitizer

Added by neels almost 6 years ago. Updated over 5 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
07/19/2018
Due date:
% Done:

90%

Spec Reference:

Description

Testing integer square-root
../../../src/libosmocore/tests/utils/utils_test.c:445:18: runtime error: signed integer overflow: 60369 * 60369 cannot be represented in type 'int'

I think it's a really bad idea to use random data in a regression test.
It thwarts the reproducibility and causes sporadic failure, like this one.
Rather pick constants from all corners of the desired value range.

Added by:

commit 15a5f8de00c9c11a985ab16279ffae02b1e4667f
Author: Harald Welte <laforge@gnumonks.org>
Date:   Wed Jun 6 16:58:17 2018 +0200

    Add osmo_isqrt32() to compute 32bit integer square root

    Change-Id: I2b96db6e037e72e92317fec874877e473a1cf909

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)