This is the mail archive of the gdb-patches@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: [RFA] dangling cleanup in find_frame_funname


On Thu, May 16, 2013 at 12:25 PM, Keith Seitz <keiths@redhat.com> wrote:
> [I'm cc'ing Joel on this, since I believe this is the same assertion failure
> that he is seeing.]
>
> While testing insight, I ran across the following assertion:
>
> ../../gdb/gdb/cleanups.c:264: internal-error: restore_my_cleanups: Assertion
> `*pmy_chain == SENTINEL_CLEANUP' failed.
>
> This is caused by a dangling cleanup in find_frame_funname, which uses a
> (dangling) cleanup to free memory for the returned function name in some
> instances.
>
> I've corrected this by simply requiring the caller to free any memory.
>
> Unfortunately, I don't have a test case to trigger the failure. Perhaps Joel
> can describe an ada test case?
>
> This patch definitely needs a few fresh eyeballs...
>
> Keith
>
> ChangeLog
> 2013-05-16  Keith Seitz  <keiths@redhat.com>
>
>         * ada-lang.c (is_known_support_routine): Add explicit free of
>         'func_name' from find_frame_funname.
>         (ada_unhandled_exception_name_addr_from_raise): Likewise.
>         * python/py-frame.c (frapy_name): Likewise for 'name'.
>         * stack.c (find_frame_funname): Add comment explaining that
>         funcp must be freed by the caller.
>         Return copy of symbol names instead of pointers.
>         (print_frame): Add a cleanup for 'funname' from
>         find_frame_funname.
>         * stack.h (find_frame_funname): Remove "const" from
>         'funname' parameter.

Looks ok to me.


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