mardi 6 août 2019

How to fix SIGSEGV Segmentation fault error?

I am running open source code from a research paper and encountered a segmentation fault error.

I used gdb to view the core file that was generated and used bt full to learn more about what went wrong, but I am very very new to c++, so I don't know how to use the information given to further debug this error.

Program terminated with signal SIGSEGV, Segmentation fault.
#0  __GI_____strtof_l_internal (nptr=0x0, endptr=0x7ffecd484cd8, group=<optimized out>, loc=0x7f32914c5560 <_nl_global_locale>)
    at strtod_l.c:609
609 strtod_l.c: No such file or directory.
(gdb) bt full
#0  __GI_____strtof_l_internal (nptr=0x0, endptr=0x7ffecd484cd8, group=<optimized out>, loc=0x7f32914c5560 <_nl_global_locale>)
    at strtod_l.c:609
        negative = 0
        num = {0, 0, 0, 511101108348, 390842024046, 0, 0, 4, 18446744073709551504, 140732342488280}
        numsize = 0
        exponent = 0
        base = 10
        den = {140732342488280, 0, 4, 139855159296252, 139855168706208, 0, 14395410707824902144, 4, 140732342488288, 139855165608536}
        densize = <optimized out>
        retval = {206158430210}
        bits = 0
        cp = 0xffffffffffffffff <error: Cannot access memory at address 0xffffffffffffffff>
        tp = <optimized out>
        startp = <optimized out>
        start_of_digits = <optimized out>
        expp = <optimized out>
        dig_no = <optimized out>
        int_no = <optimized out>
        lead_zero = <optimized out>
        c = <optimized out>
        decimal = 0x7f329128e7d8 <dot> "."
        decimal_len = 1
        thousands = 0x0
        grouping = 0x0
        cnt = <optimized out>
        current = <optimized out>
        __PRETTY_FUNCTION__ = "____strtof_l_internal"
        lowc = <optimized out>
#1  0x0000562b2bf93133 in get_all_cooked_time_bw(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) ()
No symbol table info available.
#2  0x0000562b2bf8f2ab in main ()
No symbol table info available.
(gdb) quit

I'm guessing that this is where things went wrong: cp = 0xffffffffffffffff <error: Cannot access memory at address 0xffffffffffffffff>, but I have no idea what cp stands for or where and how to fix this.

Aucun commentaire:

Enregistrer un commentaire