public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug cli/28290] New: pathstuff.cc:132: internal-error: gdb::unique_xmalloc_ptr<char> gdb_abspath(const char*): Assertion `path != NULL && path[0] != '\0'' failed
@ 2021-08-30  9:57 vries at gcc dot gnu.org
  2021-08-30 10:25 ` [Bug cli/28290] " vries at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: vries at gcc dot gnu.org @ 2021-08-30  9:57 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 28290
           Summary: pathstuff.cc:132: internal-error:
                    gdb::unique_xmalloc_ptr<char> gdb_abspath(const
                    char*): Assertion `path != NULL && path[0] != '\0''
                    failed
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: cli
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

[ Similar to PR27393 ]

I run into this internal-error:
...
$ gdb -batch ''
: No such file or directory.
$ gdb -batch '' ''
: No such file or directory.
/home/vries/gdb_versions/devel/src/gdbsupport/pathstuff.cc:132: internal-error:
gdb::unique_xmalloc_ptr<char> gdb_abspath(const char*): Assertion `path != NULL
&& path[0] != '\0'' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) [answered Y; input not from terminal]

This is a bug, please report it.  For instructions, see:
<https://www.gnu.org/software/gdb/bugs/>.
...

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

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

* [Bug cli/28290] pathstuff.cc:132: internal-error: gdb::unique_xmalloc_ptr<char> gdb_abspath(const char*): Assertion `path != NULL && path[0] != '\0'' failed
  2021-08-30  9:57 [Bug cli/28290] New: pathstuff.cc:132: internal-error: gdb::unique_xmalloc_ptr<char> gdb_abspath(const char*): Assertion `path != NULL && path[0] != '\0'' failed vries at gcc dot gnu.org
@ 2021-08-30 10:25 ` vries at gcc dot gnu.org
  2021-08-30 10:33 ` vries at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: vries at gcc dot gnu.org @ 2021-08-30 10:25 UTC (permalink / raw)
  To: gdb-prs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|HEAD                        |11.1

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Reproduced with gdb-11-branch.

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

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

* [Bug cli/28290] pathstuff.cc:132: internal-error: gdb::unique_xmalloc_ptr<char> gdb_abspath(const char*): Assertion `path != NULL && path[0] != '\0'' failed
  2021-08-30  9:57 [Bug cli/28290] New: pathstuff.cc:132: internal-error: gdb::unique_xmalloc_ptr<char> gdb_abspath(const char*): Assertion `path != NULL && path[0] != '\0'' failed vries at gcc dot gnu.org
  2021-08-30 10:25 ` [Bug cli/28290] " vries at gcc dot gnu.org
@ 2021-08-30 10:33 ` vries at gcc dot gnu.org
  2021-08-30 12:34 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: vries at gcc dot gnu.org @ 2021-08-30 10:33 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
https://sourceware.org/pipermail/gdb-patches/2021-August/181738.html

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

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

* [Bug cli/28290] pathstuff.cc:132: internal-error: gdb::unique_xmalloc_ptr<char> gdb_abspath(const char*): Assertion `path != NULL && path[0] != '\0'' failed
  2021-08-30  9:57 [Bug cli/28290] New: pathstuff.cc:132: internal-error: gdb::unique_xmalloc_ptr<char> gdb_abspath(const char*): Assertion `path != NULL && path[0] != '\0'' failed vries at gcc dot gnu.org
  2021-08-30 10:25 ` [Bug cli/28290] " vries at gcc dot gnu.org
  2021-08-30 10:33 ` vries at gcc dot gnu.org
@ 2021-08-30 12:34 ` cvs-commit at gcc dot gnu.org
  2021-08-30 14:03 ` cvs-commit at gcc dot gnu.org
  2021-08-30 14:04 ` vries at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-08-30 12:34 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from cvs-commit at gcc dot gnu.org <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=f947f96797f8ec33aabf9cd7234c850778068445

commit f947f96797f8ec33aabf9cd7234c850778068445
Author: Tom de Vries <tdevries@suse.de>
Date:   Mon Aug 30 14:34:03 2021 +0200

    [gdb/cli] Don't assert on empty string for core-file

    With current gdb we run into:
    ...
    $ gdb -batch '' ''
    : No such file or directory.
    pathstuff.cc:132: internal-error: \
      gdb::unique_xmalloc_ptr<char> gdb_abspath(const char*): \
      Assertion `path != NULL && path[0] != '\0'' failed.
    ...

    Fix this by skipping the call to gdb_abspath in core_target_open in the
    empty-string case, such that we have instead:
    ...
    $ gdb -batch '' ''
    : No such file or directory.
    : No such file or directory.
    $
    ...

    Tested on x86_64-linux.

    gdb/ChangeLog:

    2021-08-30  Tom de Vries  <tdevries@suse.de>

            PR cli/28290
            * gdb/corelow.c (core_target_open): Skip call to gdb_abspath in the
            empty-string case.

    gdb/testsuite/ChangeLog:

    2021-08-30  Tom de Vries  <tdevries@suse.de>

            PR cli/28290
            * gdb.base/batch-exit-status.exp: Add gdb '' and gdb '' '' tests.

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

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

* [Bug cli/28290] pathstuff.cc:132: internal-error: gdb::unique_xmalloc_ptr<char> gdb_abspath(const char*): Assertion `path != NULL && path[0] != '\0'' failed
  2021-08-30  9:57 [Bug cli/28290] New: pathstuff.cc:132: internal-error: gdb::unique_xmalloc_ptr<char> gdb_abspath(const char*): Assertion `path != NULL && path[0] != '\0'' failed vries at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-08-30 12:34 ` cvs-commit at gcc dot gnu.org
@ 2021-08-30 14:03 ` cvs-commit at gcc dot gnu.org
  2021-08-30 14:04 ` vries at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-08-30 14:03 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The gdb-11-branch branch has been updated by Tom de Vries
<vries@sourceware.org>:

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

commit e1652de24afa57d8a66d5f37642d1922dbf9c984
Author: Tom de Vries <tdevries@suse.de>
Date:   Mon Aug 30 16:03:15 2021 +0200

    [gdb/cli] Don't assert on empty string for core-file

    With current gdb we run into:
    ...
    $ gdb -batch '' ''
    : No such file or directory.
    pathstuff.cc:132: internal-error: \
      gdb::unique_xmalloc_ptr<char> gdb_abspath(const char*): \
      Assertion `path != NULL && path[0] != '\0'' failed.
    ...

    Fix this by skipping the call to gdb_abspath in core_target_open in the
    empty-string case, such that we have instead:
    ...
    $ gdb -batch '' ''
    : No such file or directory.
    : No such file or directory.
    $
    ...

    Tested on x86_64-linux.

    gdb/ChangeLog:

    2021-08-30  Tom de Vries  <tdevries@suse.de>

            PR cli/28290
            * gdb/corelow.c (core_target_open): Skip call to gdb_abspath in the
            empty-string case.

    gdb/testsuite/ChangeLog:

    2021-08-30  Tom de Vries  <tdevries@suse.de>

            PR cli/28290
            * gdb.base/batch-exit-status.exp: Add gdb '' and gdb '' '' tests.

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

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

* [Bug cli/28290] pathstuff.cc:132: internal-error: gdb::unique_xmalloc_ptr<char> gdb_abspath(const char*): Assertion `path != NULL && path[0] != '\0'' failed
  2021-08-30  9:57 [Bug cli/28290] New: pathstuff.cc:132: internal-error: gdb::unique_xmalloc_ptr<char> gdb_abspath(const char*): Assertion `path != NULL && path[0] != '\0'' failed vries at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-08-30 14:03 ` cvs-commit at gcc dot gnu.org
@ 2021-08-30 14:04 ` vries at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: vries at gcc dot gnu.org @ 2021-08-30 14:04 UTC (permalink / raw)
  To: gdb-prs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |11.1
         Resolution|---                         |FIXED

--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
Patch committed to trunk and gdb-11-branch, marking resolved-fixed.

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

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

end of thread, other threads:[~2021-08-30 14:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-30  9:57 [Bug cli/28290] New: pathstuff.cc:132: internal-error: gdb::unique_xmalloc_ptr<char> gdb_abspath(const char*): Assertion `path != NULL && path[0] != '\0'' failed vries at gcc dot gnu.org
2021-08-30 10:25 ` [Bug cli/28290] " vries at gcc dot gnu.org
2021-08-30 10:33 ` vries at gcc dot gnu.org
2021-08-30 12:34 ` cvs-commit at gcc dot gnu.org
2021-08-30 14:03 ` cvs-commit at gcc dot gnu.org
2021-08-30 14:04 ` 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).