This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc 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]

[Bug ports/15759] tile: C++11 destructors aren't working right


http://sourceware.org/bugzilla/show_bug.cgi?id=15759

Siddhesh Poyarekar <siddhesh at redhat dot com> changed:

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

--- Comment #1 from Siddhesh Poyarekar <siddhesh at redhat dot com> ---
Looks like a bug in _dl_unmap.  It returns without unmapping the object if the
program is not running in a simulator:

/* Support notifying the simulator about removed objects prior to munmap().  */
void internal_function
_dl_unmap (struct link_map *l)
{
  int shift;

  /* Don't bother if not in the simulator.  */
  if (__insn_mfspr (SPR_SIM_CONTROL) == 0)
    return;

...

  __munmap ((void *) l->l_map_start, l->l_map_end - l->l_map_start);
}


Looks like the right code should be:


/* Support notifying the simulator about removed objects prior to munmap().  */
void internal_function
_dl_unmap (struct link_map *l)
{
  int shift;

  /* Don't bother if not in the simulator.  */
  if (__insn_mfspr (SPR_SIM_CONTROL) == 0)
    goto out;

...

out:
  __munmap ((void *) l->l_map_start, l->l_map_end - l->l_map_start);
}

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


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