[Toybox] Toybox bc's transcendental and irrational functions produce incorrect results, memory leaks and exhibit brute force algorithmic complexity.

Sasha Toltec sashatoltec1 at gmail.com
Mon Aug 27 06:28:58 PDT 2018


We ran across these errors while doing "make check" on the hebimath
bignum library on an alpine linux system running against toybox's
`bc'. Hebimath uses POSIX bc as part of its test suite, Perhaps it
could be used to drive the core arithmetic of your POSIX bc
implementation as it is MIT licensed and is fast and accurate.

https://github.com/suiginsoft/hebimath

Sasha Toltec
Toltec Enterprises
sashatoltec1 at gmail.com

On 8/27/18, Sasha Toltec <sashatoltec1 at gmail.com> wrote:
> Upon inspection of the mathematics core of the toybox bc it appears to
> have multiple systemic issues and is potentially unsalvagable.
>
> All transcendental functions produce out of bounds memory accesses.
>
> All builtin functions produce gratuitous and insecure memory errors.
>
> Excessive or incorrect memory consumption for invocations of
> transcendental functions result in total memory exhaustion consuming
> about 1 GB for every few seconds of run time.
>
> The algorithms used are of the most naive possible variety and balk
> under even the smallest inputs taking hundreds of times longer than
> similar implementations.
>
> All builtin transcendental and irrational functions produce incorrect
> results.
>
> Functions that should be complete in a fraction of a second are
> getting bogged down in naive algorithmic complexity.
>
> I had read that a team of mathematicians and systems programmers were
> working on the
> new toybox bc implementation. What exactly happened here?
>
>
> Sasha Toltec
> Toltec Enterprises
> sashatoltec1 at gmail.com
>


More information about the Toybox mailing list