libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libunwind] v0.98.4 bugfix


From: David Mosberger
Subject: [libunwind] v0.98.4 bugfix
Date: Thu, 31 Mar 2005 13:22:24 -0800

I found another bug in libunwind-ptrace which could cause crashes due
to extraneous munmap() calls (in my case, the extra munmap() call
freed memory that was in use, which got then remapped as
read-only...).

Since it affects libunwind-ptrace only (not, e.g.,
exception-handling), I plan to wait a bit longer to see if we find
other bugs before releasing v0.98.5.  However, do let me know if you
want/need this bug-fix as part of an official release sooner rather
than later.

        --david

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/03/31 13:18:27-08:00 address@hidden 
#   (libunwind-ptrace): Fix a bug which could cause crashes due to
#       extraneous calls to munmap.
# 
# src/ptrace/_UPT_get_dyn_info_list_addr.c
#   2005/03/31 13:18:27-08:00 address@hidden +3 -1
#   (get_list_addr): Clear ui->ei.image/ui->ei.size after unmapping the
#       image.
# 
diff -Nru a/src/ptrace/_UPT_get_dyn_info_list_addr.c 
b/src/ptrace/_UPT_get_dyn_info_list_addr.c
--- a/src/ptrace/_UPT_get_dyn_info_list_addr.c  2005-03-31 13:19:45 -08:00
+++ b/src/ptrace/_UPT_get_dyn_info_list_addr.c  2005-03-31 13:19:45 -08:00
@@ -1,5 +1,5 @@
 /* libunwind - a platform-independent unwind library
-   Copyright (C) 2003-2004 Hewlett-Packard Co
+   Copyright (C) 2003-2005 Hewlett-Packard Co
        Contributed by David Mosberger-Tang <address@hidden>
 
 This file is part of libunwind.
@@ -50,6 +50,8 @@
       if (ui->ei.image)
        {
          munmap (ui->ei.image, ui->ei.size);
+         ui->ei.image = NULL;
+         ui->ei.size = 0;
          /* invalidate the cache: */
          ui->di_cache.start_ip = ui->di_cache.end_ip = 0;
        }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]