This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GDB loops forever until it crashes when it runs out of memory


On 08/19/2014 04:12 PM, Pedro Alves wrote:
On 08/13/2014 06:11 AM, Raphael Zulliger wrote:

I don't know about the philosophy of GDB, whether it is supposed to
handle such situation. However, for me, the following additional code
helped to avoid the GDB crash which gave me a chance to inspect the rest
of the system with a Eclipse/CDT:

        new_val = get_frame_register_value (frame, regnum);
        if( (regnum == VALUE_REGNUM(new_val))
                && (frame == frame_find_by_id (VALUE_FRAME_ID (new_val)) )) {
            set_value_lazy (val, 0);
            mark_value_bytes_unavailable (val,
                                value_embedded_offset (val),
                                TYPE_LENGTH (type));
            return 0;
        }

As I'm unfamiliar with GDB internals, I don't know whether I compared
the right properties of and new_val and whether the implementation is
"ok" like this - but at least this code helped to make GDB properly
abort trying to unwind the stack after it received the same information
twice.
This sounds like the issue addressed by 33f8fe58 (and follow ups).
What version of GDB are you using?

Thanks for looking into this! I'm using GNU gdb (GDB) 7.6.50.20130604-cvs. Sorry to not have mentioned that in the initial post.

I reply that late because I tried to get access to the hardware on which I encountered the endless loop, to verify whether the mentioned commit fixes the issue. Unfortunately, I can't get access to that hardware anymore. I'm very sorry about that. Nevertheless, the commit you mentioned looks promising.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]