public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/17854] New: Nothing sets pspace_data->sym_cache?
@ 2015-01-18  4:45 xdje42 at gmail dot com
  2015-01-18  4:47 ` [Bug ada/17854] " xdje42 at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: xdje42 at gmail dot com @ 2015-01-18  4:45 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 17854
           Summary: Nothing sets pspace_data->sym_cache?
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ada
          Assignee: unassigned at sourceware dot org
          Reporter: xdje42 at gmail dot com

I think there's a bug in cache invalidation, but my testcase isn't exposing it.
That got me digging into the implementation of ada-lang.c's symbol lookup
cache.

It looks like nothing sets pspace_data->sym_cache.

Presumably, it should be set here.

static struct ada_symbol_cache *
ada_get_symbol_cache (struct program_space *pspace)
{
  struct ada_pspace_data *pspace_data = get_ada_pspace_data (pspace);
  struct ada_symbol_cache *sym_cache = pspace_data->sym_cache;

  if (sym_cache == NULL)
    {
      sym_cache = XCNEW (struct ada_symbol_cache);
      ada_init_symbol_cache (sym_cache);
    }

  return sym_cache;
}

Could be missing something though.

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


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

* [Bug ada/17854] Nothing sets pspace_data->sym_cache?
  2015-01-18  4:45 [Bug ada/17854] New: Nothing sets pspace_data->sym_cache? xdje42 at gmail dot com
@ 2015-01-18  4:47 ` xdje42 at gmail dot com
  2015-01-18  4:54 ` xdje42 at gmail dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: xdje42 at gmail dot com @ 2015-01-18  4:47 UTC (permalink / raw)
  To: gdb-prs

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

Doug Evans <xdje42 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |brobecker at adacore dot com

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


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

* [Bug ada/17854] Nothing sets pspace_data->sym_cache?
  2015-01-18  4:45 [Bug ada/17854] New: Nothing sets pspace_data->sym_cache? xdje42 at gmail dot com
  2015-01-18  4:47 ` [Bug ada/17854] " xdje42 at gmail dot com
@ 2015-01-18  4:54 ` xdje42 at gmail dot com
  2015-01-18  5:04 ` xdje42 at gmail dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: xdje42 at gmail dot com @ 2015-01-18  4:54 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Doug Evans <xdje42 at gmail dot com> ---
PR 17855 describes the cache invalidation bug.

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


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

* [Bug ada/17854] Nothing sets pspace_data->sym_cache?
  2015-01-18  4:45 [Bug ada/17854] New: Nothing sets pspace_data->sym_cache? xdje42 at gmail dot com
  2015-01-18  4:47 ` [Bug ada/17854] " xdje42 at gmail dot com
  2015-01-18  4:54 ` xdje42 at gmail dot com
@ 2015-01-18  5:04 ` xdje42 at gmail dot com
  2015-01-18  7:25 ` xdje42 at gmail dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: xdje42 at gmail dot com @ 2015-01-18  5:04 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Doug Evans <xdje42 at gmail dot com> ---
While we're fixing this,
ada_clear_symbol_cache could first check whether there is a cache.
This would save creating one when debugging non-ada programs.
Plus, after fixing this bug I see ada_clear_symbol_cache create
the cache only to free it and recreate it.

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


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

* [Bug ada/17854] Nothing sets pspace_data->sym_cache?
  2015-01-18  4:45 [Bug ada/17854] New: Nothing sets pspace_data->sym_cache? xdje42 at gmail dot com
                   ` (2 preceding siblings ...)
  2015-01-18  5:04 ` xdje42 at gmail dot com
@ 2015-01-18  7:25 ` xdje42 at gmail dot com
  2015-02-02  3:32 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: xdje42 at gmail dot com @ 2015-01-18  7:25 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Doug Evans <xdje42 at gmail dot com> ---
*** Bug 17853 has been marked as a duplicate of this bug. ***

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


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

* [Bug ada/17854] Nothing sets pspace_data->sym_cache?
  2015-01-18  4:45 [Bug ada/17854] New: Nothing sets pspace_data->sym_cache? xdje42 at gmail dot com
                   ` (3 preceding siblings ...)
  2015-01-18  7:25 ` xdje42 at gmail dot com
@ 2015-02-02  3:32 ` cvs-commit at gcc dot gnu.org
  2015-02-02  3:40 ` cvs-commit at gcc dot gnu.org
  2015-02-02 17:36 ` brobecker at gnat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-02-02  3:32 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Joel Brobecker <brobecke@sourceware.org>:

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

commit 66c168ae56fa2d67f821ccae774fd25c695fd9ce
Author: Joel Brobecker <brobecker@adacore.com>
Date:   Mon Feb 2 07:20:58 2015 +0400

    [Ada] pspace_data->sym_cache is always NULL

    The Ada symbol cache has been designed to have one instance of that
    of that cache per program space, and for each instance to be created
    on-demand. ada_get_symbol_cache is the function responsible for both
    lookup and creation on demand.

    Unfortunately, ada_get_symbol_cache forgot to store the reference
    to newly created caches, thus causing it to:
      - Leak old caches;
      - Allocate a new cache each time the cache is being searched or
        a new entry is to be inserted.

    This patch fixes the issue by avoiding the use of the local variable,
    which indirectly allowed the bug to happen. We manipulate the reference
    in the program-space data instead.

    gdb/ChangeLog:

            PR gdb/17854:
            * ada-lang.c (ada_get_symbol_cache): Set pspace_data->sym_cache
            when allocating a new one.

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


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

* [Bug ada/17854] Nothing sets pspace_data->sym_cache?
  2015-01-18  4:45 [Bug ada/17854] New: Nothing sets pspace_data->sym_cache? xdje42 at gmail dot com
                   ` (4 preceding siblings ...)
  2015-02-02  3:32 ` cvs-commit at gcc dot gnu.org
@ 2015-02-02  3:40 ` cvs-commit at gcc dot gnu.org
  2015-02-02 17:36 ` brobecker at gnat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-02-02  3:40 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The gdb-7.9-branch branch has been updated by Joel Brobecker
<brobecke@sourceware.org>:

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

commit 19a5737950b966d0ff3e50c01bb43742a870bb9e
Author: Joel Brobecker <brobecker@adacore.com>
Date:   Mon Feb 2 07:20:58 2015 +0400

    [Ada] pspace_data->sym_cache is always NULL

    The Ada symbol cache has been designed to have one instance of that
    of that cache per program space, and for each instance to be created
    on-demand. ada_get_symbol_cache is the function responsible for both
    lookup and creation on demand.

    Unfortunately, ada_get_symbol_cache forgot to store the reference
    to newly created caches, thus causing it to:
      - Leak old caches;
      - Allocate a new cache each time the cache is being searched or
        a new entry is to be inserted.

    This patch fixes the issue by avoiding the use of the local variable,
    which indirectly allowed the bug to happen. We manipulate the reference
    in the program-space data instead.

    gdb/ChangeLog:

            PR gdb/17854:
            * ada-lang.c (ada_get_symbol_cache): Set pspace_data->sym_cache
            when allocating a new one.

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


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

* [Bug ada/17854] Nothing sets pspace_data->sym_cache?
  2015-01-18  4:45 [Bug ada/17854] New: Nothing sets pspace_data->sym_cache? xdje42 at gmail dot com
                   ` (5 preceding siblings ...)
  2015-02-02  3:40 ` cvs-commit at gcc dot gnu.org
@ 2015-02-02 17:36 ` brobecker at gnat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: brobecker at gnat dot com @ 2015-02-02 17:36 UTC (permalink / raw)
  To: gdb-prs

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

Joel Brobecker <brobecker at gnat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |brobecker at gnat dot com
         Resolution|---                         |FIXED

--- Comment #6 from Joel Brobecker <brobecker at gnat dot com> ---
Fixed.

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


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

end of thread, other threads:[~2015-02-02  4:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-18  4:45 [Bug ada/17854] New: Nothing sets pspace_data->sym_cache? xdje42 at gmail dot com
2015-01-18  4:47 ` [Bug ada/17854] " xdje42 at gmail dot com
2015-01-18  4:54 ` xdje42 at gmail dot com
2015-01-18  5:04 ` xdje42 at gmail dot com
2015-01-18  7:25 ` xdje42 at gmail dot com
2015-02-02  3:32 ` cvs-commit at gcc dot gnu.org
2015-02-02  3:40 ` cvs-commit at gcc dot gnu.org
2015-02-02 17:36 ` brobecker at gnat dot com

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