[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Libunwind-devel] mincore(2) problems on Linux
From: |
Jason Evans |
Subject: |
Re: [Libunwind-devel] mincore(2) problems on Linux |
Date: |
Tue, 08 Jun 2010 14:10:35 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4 |
On 06/07/2010 11:52 AM, Arun Sharma wrote:
On Mon, Jun 7, 2010 at 11:20 AM, Jason Evans<address@hidden> wrote:
I don't particularly care whether libunwind uses msync or mincore, but right
now most of libunwind's regression tests fail for me, and if I use libunwind
for backtracing, I get segfaults. The attached patch fixes the regression
for me. If you prefer not to fix the problem in this fashion, hopefully the
patch will at least prove useful in characterizing the problem.
You should see less than 6 failures (4 known + 2 intermittent) on
x86_64. Anything more suggests other potential problems on your setup.
Is there a particular test regression that is fixed by the patch?
Here is a summary of the regression test results for the current git
master branch, versus a branch with my patch applied:
| Test | master | mincore |
+---------------------+--------------+--------------+
| test-proc-info | pass | pass |
| test-static-link | *** FAIL *** | pass |
| test-strerror | pass | pass |
| Gtest-bt | *** FAIL *** | pass |
| Ltest-bt | *** FAIL *** | pass |
| Gtest-exc | *** FAIL *** | pass |
| Ltest-exc | *** FAIL *** | pass |
| Gtest-init | *** FAIL *** | pass |
| Ltest-init | *** FAIL *** | pass |
| Gtest-concurrent | *** FAIL *** | pass |
| Ltest-concurrent | *** FAIL *** | pass |
| Gtest-resume-sig | *** FAIL *** | *** FAIL *** |
| Ltest-resume-sig | *** FAIL *** | *** FAIL *** |
| Gtest-dyn1 | *** FAIL *** | *** FAIL *** |
| Ltest-dyn1 | *** FAIL *** | *** FAIL *** |
| test-async-sig | *** FAIL *** | *** FAIL *** |
| test-flush-cache | pass | pass |
| test-init-remote | *** FAIL *** | pass |
| test-mem | *** FAIL *** | pass |
| test-setjmp | *** FAIL *** | *** FAIL *** |
| test-ptrace | pass | pass |
| Ltest-nomalloc | *** FAIL *** | pass |
| rs-race | *** FAIL *** | pass |
| run-check-namespace | pass | pass |
| run-ptrace-mapper | pass | pass |
| run-ptrace-misc | *** FAIL *** | *** FAIL *** |
+---------------------+--------------+--------------+
I did some more digging, and the following strace excerpt from running
Gtest-init is interesting:
------------------------------------------------------------------------
mincore(0x400000, 8, [10000000]) = 0
[...]
mincore(0x7fff658c9000, 8, 0x7fff658c8730) = -1 ENOMEM (Cannot allocate
memory)
write(2, "FAILURE: unw_step() returned -1\n", 32) = 32
------------------------------------------------------------------------
The page being passed to mincore in the second call is on the stack. I
am running a kernel that is derived from 2.6.20, and as near as I can
tell from the rpm changelog, this change was never backported:
------------------------------------------------------------------------
commit 42da9cbd3eedde33a42acc2cb06f454814cf5de0
Author: Nick Piggin <address@hidden>
Date: Mon Feb 12 00:51:39 2007
[PATCH] mm: mincore anon
Make mincore work for anon mappings, nonlinear, and migration entries.
[...]
------------------------------------------------------------------------
I just re-ran the master branch's libunwind tests on a similar machine
that has a 2.6.27-derived kernel, and only 7/26 tests failed.
So, my problems are almost certainly due to running an old kernel.
Maybe 2.6.20 is sufficiently ancient that it doesn't make sense to
support it in libunwind. Thoughts?
Thanks,
Jason