public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/17611] New: malloc failure shouldn't be flagged as an internal error
@ 2014-11-17 16:06 xdje42 at gmail dot com
  2014-11-17 19:57 ` [Bug gdb/17611] " jan.kratochvil at redhat dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: xdje42 at gmail dot com @ 2014-11-17 16:06 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 17611
           Summary: malloc failure shouldn't be flagged as an internal
                    error
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: xdje42 at gmail dot com

I suppose this is debatable, but if we assume malloc fails simply because gdb
really needs that much memory, then treating this as an internal error is
confusing to users.

void
malloc_failure (long size)
{
  if (size > 0)
    {
      internal_error (__FILE__, __LINE__,
                      _("virtual memory exhausted: can't allocate %ld bytes."),
                      size);
    }
  else
    {
      internal_error (__FILE__, __LINE__, _("virtual memory exhausted."));
    }
}

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug gdb/17611] malloc failure shouldn't be flagged as an internal error
  2014-11-17 16:06 [Bug gdb/17611] New: malloc failure shouldn't be flagged as an internal error xdje42 at gmail dot com
@ 2014-11-17 19:57 ` jan.kratochvil at redhat dot com
  2014-11-17 22:54 ` dje at google dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jan.kratochvil at redhat dot com @ 2014-11-17 19:57 UTC (permalink / raw)
  To: gdb-prs

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

Jan Kratochvil <jan.kratochvil at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jan.kratochvil at redhat dot com

--- Comment #1 from Jan Kratochvil <jan.kratochvil at redhat dot com> ---
Fedora has s/internal_error/error/:
http://pkgs.fedoraproject.org/cgit/gdb.git/tree/gdb-bz568248-oom-is-error.patch

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug gdb/17611] malloc failure shouldn't be flagged as an internal error
  2014-11-17 16:06 [Bug gdb/17611] New: malloc failure shouldn't be flagged as an internal error xdje42 at gmail dot com
  2014-11-17 19:57 ` [Bug gdb/17611] " jan.kratochvil at redhat dot com
@ 2014-11-17 22:54 ` dje at google dot com
  2014-11-17 23:30 ` sergiodj at redhat dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dje at google dot com @ 2014-11-17 22:54 UTC (permalink / raw)
  To: gdb-prs

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

dje at google dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dje at google dot com

--- Comment #2 from dje at google dot com ---
That's from 2010.

Maybe Red Hat could be a bit more proactive with getting patches upstream?

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug gdb/17611] malloc failure shouldn't be flagged as an internal error
  2014-11-17 16:06 [Bug gdb/17611] New: malloc failure shouldn't be flagged as an internal error xdje42 at gmail dot com
  2014-11-17 19:57 ` [Bug gdb/17611] " jan.kratochvil at redhat dot com
  2014-11-17 22:54 ` dje at google dot com
@ 2014-11-17 23:30 ` sergiodj at redhat dot com
  2014-11-17 23:33 ` dje at google dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: sergiodj at redhat dot com @ 2014-11-17 23:30 UTC (permalink / raw)
  To: gdb-prs

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

Sergio Durigan Junior <sergiodj at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sergiodj at redhat dot com

--- Comment #3 from Sergio Durigan Junior <sergiodj at redhat dot com> ---
FWIW, the patch has been submitted upstream on 2010:

  <https://sourceware.org/ml/gdb-patches/2010-06/msg00005.html>

But it has been rejected.

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug gdb/17611] malloc failure shouldn't be flagged as an internal error
  2014-11-17 16:06 [Bug gdb/17611] New: malloc failure shouldn't be flagged as an internal error xdje42 at gmail dot com
                   ` (2 preceding siblings ...)
  2014-11-17 23:30 ` sergiodj at redhat dot com
@ 2014-11-17 23:33 ` dje at google dot com
  2014-11-18 15:28 ` gbenson at redhat dot com
  2024-04-11  7:57 ` vries at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: dje at google dot com @ 2014-11-17 23:33 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from dje at google dot com ---
Righto.  Point taken.

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug gdb/17611] malloc failure shouldn't be flagged as an internal error
  2014-11-17 16:06 [Bug gdb/17611] New: malloc failure shouldn't be flagged as an internal error xdje42 at gmail dot com
                   ` (3 preceding siblings ...)
  2014-11-17 23:33 ` dje at google dot com
@ 2014-11-18 15:28 ` gbenson at redhat dot com
  2024-04-11  7:57 ` vries at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: gbenson at redhat dot com @ 2014-11-18 15:28 UTC (permalink / raw)
  To: gdb-prs

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

Gary Benson <gbenson at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gbenson at redhat dot com

--- Comment #5 from Gary Benson <gbenson at redhat dot com> ---
I noticed this while I was refactoring the error code, but then forgot to
follow it up.  I wondered if GDB avoided using regular error to avoid trying to
throw nested exceptions if the exception throwing code then itself ran out of
memory.

GDB and gdbserver have different malloc_failure implementations.  Whatever
solution is chosen it would be good to have a single malloc_failure in
common/errors.c.

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug gdb/17611] malloc failure shouldn't be flagged as an internal error
  2014-11-17 16:06 [Bug gdb/17611] New: malloc failure shouldn't be flagged as an internal error xdje42 at gmail dot com
                   ` (4 preceding siblings ...)
  2014-11-18 15:28 ` gbenson at redhat dot com
@ 2024-04-11  7:57 ` vries at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2024-04-11  7:57 UTC (permalink / raw)
  To: gdb-prs

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

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vries at gcc dot gnu.org

--- Comment #6 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Sergio Durigan Junior from comment #3)
> FWIW, the patch has been submitted upstream on 2010:
> 
>   <https://sourceware.org/ml/gdb-patches/2010-06/msg00005.html>
> 
> But it has been rejected.

And to follow up on that, it has been removed in fedora (showing rawhide
commit):
...
commit c79314bd920e4f412d31f647ab8f4bfa79fd112d
Author: Sergio Durigan Junior <sergiodj@redhat.com>
Date:   Tue Jul 2 18:30:05 2019 -0400

    Rebase to FSF GDB 8.3.50.20190702 (8.4pre).
    Remove gdb-bz568248-oom-is-error.patch.
...

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-04-11  7:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-17 16:06 [Bug gdb/17611] New: malloc failure shouldn't be flagged as an internal error xdje42 at gmail dot com
2014-11-17 19:57 ` [Bug gdb/17611] " jan.kratochvil at redhat dot com
2014-11-17 22:54 ` dje at google dot com
2014-11-17 23:30 ` sergiodj at redhat dot com
2014-11-17 23:33 ` dje at google dot com
2014-11-18 15:28 ` gbenson at redhat dot com
2024-04-11  7:57 ` vries at gcc dot gnu.org

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).