haskell-chart icon indicating copy to clipboard operation
haskell-chart copied to clipboard

Protect agains infinite loop when plotting tiny ranges

Open ghorn opened this issue 9 years ago • 2 comments

simple fix for #128

ghorn avatar Jun 19 '16 00:06 ghorn

I've pushed a fix to avoid the freeze in this commit: https://github.com/timbod7/haskell-chart/commit/f27955b11fbdb68c8b56984a67c1eee933f0edc9

The issue is that this expression:

10 ^^ ((floor $ log10 $ delta / nsteps)::Integer

will eat all RAM in bigint calculations when delta = 0

timbod7 avatar Jun 30 '16 22:06 timbod7

This doesn't guarantee you'll get sensible charts with tiny values - your patch may still be necessary for this. Test it and if it is necessary, I will merge.

timbod7 avatar Jun 30 '16 22:06 timbod7