Page MenuHomePhabricator

Changes for Bug 17384
ClosedPublic

Authored by ravitheja on Oct 27 2015, 7:18 AM.

Details

Summary

Virtual dynamic shared objects, or vdso files were
not loaded for Linux OS.In Bug 17384 the call
stack could not be unwinded from functions
residing in the vdso object.

This commit adds support for loading such files by
reading the Aux vectors since a vdso is invisibily
mapped to the inferiors address space and the
actual file is not present in the filesystem. The
presence of the vdso is detected by inspecting
the Aux vector for AT_SYSINFO_EHDR tag.

Diff Detail

Event Timeline

ravitheja updated this revision to Diff 38542.Oct 27 2015, 7:18 AM
ravitheja retitled this revision from to Changes for Bug 17384.
ravitheja updated this object.
tberghammer accepted this revision.Oct 27 2015, 9:04 AM
tberghammer edited edge metadata.

Looks good with a few minor suggestions inline

source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
576–577

(nit): It isn't needed

source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h
91–95

I would suggest to merge these 2 with setting m_vdso_base to LLDB_INVALID_ADDRESS if we don't have a vdso

This revision is now accepted and ready to land.Oct 27 2015, 9:04 AM
clayborg resigned from this revision.Oct 27 2015, 10:08 AM
clayborg removed a reviewer: clayborg.

I don't know anything about shared library loading on Linux.

ovyalov accepted this revision.Oct 27 2015, 10:25 AM
ovyalov edited edge metadata.

Looks good - minor comments.

source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
512

Please combine these 2 lines - FileSpec file_spec("[vdso]", false);

test/functionalities/inferior-assert/TestInferiorAssert.py
165

Could you store result of "i386" in self.getArchitecture() as temp variable outside of frames's loop?

ravitheja updated this revision to Diff 38637.Oct 28 2015, 2:48 AM
ravitheja edited edge metadata.

Updates for previous comments.

ravitheja closed this revision.Oct 28 2015, 2:49 AM

Hi,

looks like TestHelloWorld and TestInferiorAssert began to fail after this change - http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/7880
Could you mark these tests as XFAILs for now?

Hi,
I actually checked these two testcases, they are passing at my end, could u send me the logs and the lldb executables , so that I can check at my end ? I think I can try to resolve it, in other case I will mark them as XFAILS.

You can get test logs from this link - https://pantheon.corp.google.com/storage/browser/lldb_test_traces/lldb-x86_64-ubuntu-14.04-cmake/?project=android-devtools-lldb-build

I suspect that there are a few problems here:

  1. TestHelloWorld - there is a race within the test since inferior takes time to initialize llvm.org/pr24600
  2. TestInferiorAssert - I think it's failing because of the way how GCE works with vdso
looking at: Stack traces for SBProcess: pid = 12637, state = stopped, threads = 1, executable = test_with_attach_to_process_with_id_api_dwarf
Stack trace for thread id=0x315d name=test_with_attac queue=None stop reason=signal
  frame #0: 0x000000f7788d80 None`None + -18446744069557678719



Expecting sub string: main.c:30
Not matched

FAIL

I propose to mark these tests back as XFAIL for i386 - create a new bug for GCE-related failures and mark TestHelloWorld as failing due llvm.org/pr24600 as well.

Hi,
This link for the traces needs a password, could u maybe provide me the login details or upload these somewhere else ? Also could u provide me the value of the AuxVectors during this test ?

BR,
A Ravi Theja

Hi,
This link for the traces needs a password, could u maybe provide me the login details or upload these somewhere else ? Also could u provide me the value of the AuxVectors during this test ?

BR,
A Ravi Theja

Hi Ravi,

I shared logs archive with you in Google Drive - please try to download it.
Unfortunately, I don't have AUXV values for test - potentially, you can get GCE instance for yourself (https://cloud.google.com/compute/docs/linux-quickstart) and try to reproduce this problem on it.

Hello,
I tried making an instance on GCE but it asks for a credit card information which I unfortunately don’t have. Can you provide me maybe access through some other way ? btw I checked the logs u sent me and the vdso is being loaded but the unwinding till main is diferent from what I see on the Ubuntu machine I have.

BR,
A Ravi Theja