[Ecls-list] Segfault while parsing floats

Stas Boukarev stassats at gmail.com
Fri Oct 1 19:40:00 UTC 2010


Stas Boukarev <stassats at gmail.com> writes:

> After the commit
> "ecl_parse_number and ecl_parse_integer are splitted into separate files and do not rely on the C library (atoi, strtod, ...) because these functions are affected by the locale."
> when entering in ecl_min 0.5 i get the following:
>
> #0  0xb7f92b0f in __gmpn_tdiv_qr () from /usr/lib/libgmp.so.10
> #1  0xb7f80fe0 in __gmpz_tdiv_qr () from /usr/lib/libgmp.so.10
> #2  0xb7f77263 in __gmpz_fdiv_qr () from /usr/lib/libgmp.so.10
> #3  0x080adacd in _ecl_big_floor (a=0x883f4c8, b=0xbf800198, pr=0xbf8001d8) at src/c/big.d:270
> #4  0x0808fd85 in ecl_floor2 (x=0x883f4c8, y=0x7) at src/c/num_co.d:248
> #5  0x08090dff in ecl_truncate2 (x=0x883f4c8, y=0x7) at src/c/num_co.d:608
> #6  0x080894cd in prepare_ratio_to_float (num=0x883f4c8, den=0x7, digits=53, scaleout=0xbf800320) at src/c/number.d:714
> #7  0x08089634 in ratio_to_double (num=0x883f4f8, den=0x7) at src/c/number.d:758
> #8  0x080896c6 in ecl_to_double (x=0x883f4f8) at src/c/number.d:790
> #9  0x08089645 in ratio_to_double (num=0x883f558, den=0x7) at src/c/number.d:759
> #10 0x080896c6 in ecl_to_double (x=0x883f558) at src/c/number.d:790
> #11 0x08089645 in ratio_to_double (num=0x883f5d0, den=0x7) at src/c/number.d:759
> ... and thousands of frames of mutual recursion between ratio_to_double
> and ecl_to_double.

And the bottom of the backtrace:
#149569 0x080896e1 in ecl_to_double (x=0x83f0f70) at src/c/number.d:792
#149570 0x08085206 in make_float (num=0x83f0f70, exp=0xffffffff, exp_char=70, sign=1)
    at src/c/reader/parse_number.d:99
#149571 0x0808560b in ecl_parse_number (str=0x814ba20, start=0, end=3, ep=0xbfffd0d4, radix=10)
    at src/c/reader/parse_number.d:209
#149572 0x080721c3 in ecl_read_object_with_delimiter (in=0x83f7c80, delimiter=-1, flags=0, a=cat_whitespace)
    at src/c/read.d:364
#149573 0x08072315 in ecl_read_object (in=0x83f7c80) at src/c/read.d:410
#149574 0x08071954 in ecl_read_object_non_recursive (in=0x83f7c80) at src/c/read.d:119
#149575 0x08074e16 in cl_read (narg=3) at src/c/read.d:1381

-- 
With Best Regards, Stas.




More information about the ecl-devel mailing list