public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug python/31631] [gdb/python] inferior.read_memory: internal-error: virtual memory exhausted
Date: Tue, 16 Apr 2024 13:53:35 +0000	[thread overview]
Message-ID: <bug-31631-4717-DHT9cV9wvp@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-31631-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=31631

--- Comment #15 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=06e967dbc9b75a4a3c1b15b54360cf1abbf9c2bd

commit 06e967dbc9b75a4a3c1b15b54360cf1abbf9c2bd
Author: Tom de Vries <tdevries@suse.de>
Date:   Tue Apr 16 15:53:47 2024 +0200

    [gdb/python] Throw MemoryError in inferior.read_memory if malloc fails

    PR python/31631 reports a gdb internal error when doing:
    ...
    (gdb) python gdb.selected_inferior().read_memory (0, 0xffffffffffffffff)
    utils.c:709: internal-error: virtual memory exhausted.
    A problem internal to GDB has been detected,
    further debugging may prove unreliable.
    ...

    Fix this by throwing a python MemoryError, such that we have instead:
    ...
    (gdb) python gdb.selected_inferior().read_memory (0, 0xffffffffffffffff)
    Python Exception <class 'MemoryError'>:
    Error occurred in Python.
    (gdb)
    ...

    Likewise for DAP.

    Tested on x86_64-linux.

    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31631

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2024-04-16 13:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-10 18:33 [Bug gdb/31631] New: just run gdb and source the poc can make the memory corrupt/exhausted N1nEmAn at proton dot me
2024-04-10 18:35 ` [Bug gdb/31631] " N1nEmAn at proton dot me
2024-04-10 20:04 ` vries at gcc dot gnu.org
2024-04-10 20:04 ` [Bug python/31631] " vries at gcc dot gnu.org
2024-04-11  0:05 ` N1nEmAn at proton dot me
2024-04-11  1:48 ` N1nEmAn at proton dot me
2024-04-11  2:51 ` N1nEmAn at proton dot me
2024-04-11 10:53 ` vries at gcc dot gnu.org
2024-04-11 11:33 ` [Bug python/31631] [gdb/python] inferior.read_memory: internal-error: virtual memory exhausted vries at gcc dot gnu.org
2024-04-11 12:04 ` N1nEmAn at proton dot me
2024-04-11 12:05 ` vries at gcc dot gnu.org
2024-04-11 12:16 ` N1nEmAn at proton dot me
2024-04-11 12:21 ` vries at gcc dot gnu.org
2024-04-11 12:26 ` N1nEmAn at proton dot me
2024-04-11 13:38 ` vries at gcc dot gnu.org
2024-04-11 13:58 ` ssbssa at sourceware dot org
2024-04-11 16:00 ` tromey at sourceware dot org
2024-04-12  2:02 ` N1nEmAn at proton dot me
2024-04-16 13:53 ` cvs-commit at gcc dot gnu.org [this message]
2024-04-16 13:56 ` vries at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-31631-4717-DHT9cV9wvp@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).