[DynInst_API:] Issue about linux-vdso.so.1


Date: Mon, 17 Jun 2013 01:05:14 +0800
From: Zifei Tong <soariez@xxxxxxxxx>
Subject: [DynInst_API:] Issue about linux-vdso.so.1
Hi,

I cannot get dyninst working on my Archlinux machine.

The problem is dyninst tries to load linux-vdso.so.1, which will fail.

I copyed a .so file for /usr/lib and rename it to linux-vdso.so.1,
then everything is OK.

Here is related debug log:

[140737353914176]mapped_object.C[157]:  about to parseImage
[140737353914176]mapped_object.C[159]: name linux-vdso.so.1, codeBase
0x7ffff88fa000, dataBase 0x7ffff88fa000
[140737353914176]image.C[1100]:  about to create image
[140737353914176]image.C[1374]:  opening file linux-vdso.so.1
[140737353914176]image.C[1102]:  created image
[140737353914176]image.C[1105]: processing shared object
[140737353914176]image.C[1123]: error in processing, deleting image
and returning
[140737353914176]mapped_object.C[162]:  failed to parseImage
[140737353914176]pcEventHandler.C[857]: failed to create mapped object
for library linux-vdso.so.1
[140737353914176]pcEventHandler.C[194]: continue condition ( 0 0 1 1 1 1 )
[140737353914176]pcEventHandler.C[230]: delaying process continue:
<return failure> <desired stop> <stopped> <no reported event> <not
terminated> <no pending events>
[140737353914176]pcEventHandler.C[242]: finished handling event:
Library (err = true)
[140737353914176]dynProcess.C[418]: bootstrap failed to wait for events
Failed to bootstrap process 26943: terminating...
[140737353914176]dynProcess.C[1147]: Terminating process 26943
[140737353914176]pcEventMuxer.C[219]: Begin callbackMux, process
pointer = 0x6b4e90, event post-ForceTerminate
[140737353914176]pcEventMuxer.C[439]: Added event post-ForceTerminate
to mailbox, size now 1
[140737353914176]pcEventMuxer.C[221]: after muxing event, mailbox size is 1
[140737353914176]pcEventMuxer.C[464]: Returning event
post-ForceTerminate from mailbox
[140737353914176]pcEventHandler.C[65]: attempting to handle event
post-ForceTerminate on thread 26943/26943
[140737353914176]pcEventHandler.C[194]: continue condition ( 1 0 1 1 0 1 )
[140737353914176]pcEventHandler.C[230]: delaying process continue:
<return success> <desired stop> <stopped> <no reported event>
<terminated> <no pending events>
[140737353914176]pcEventHandler.C[236]: pending exit reported to
BPatch-level, marking process exited
[140737353914176]pcEventHandler.C[242]: finished handling event:
post-ForceTerminate (err = false)
[140737353914176]dynProcess.C[1155]: finished terminating process 26943
--FATAL-- #68: Dyninst was unable to create the specified process
--FATAL-- #68: create process failed bootstrap

Here is a workaround patch:

diff --git a/dyninstAPI/src/pcEventHandler.C b/dyninstAPI/src/pcEventHandler.C
index 46a4ff9..64c516d 100644
--- a/dyninstAPI/src/pcEventHandler.C
+++ b/dyninstAPI/src/pcEventHandler.C
@@ -839,6 +839,8 @@ bool
PCEventHandler::handleLibrary(EventLibrary::const_ptr ev, PCProcess
*evProc
     const set<Library::ptr> &added = ev->libsAdded();

     for(set<Library::ptr>::const_iterator i = added.begin(); i !=
added.end(); ++i) {
+        if ((*i)->getAbsoluteName() == "linux-vdso.so.1")
+            continue;
         Address dataAddress = (*i)->getLoadAddress();
         if( evProc->usesDataLoadAddress() ) dataAddress =
(*i)->getDataLoadAddress();

I tried to trace what's going on but got no clue. Would you please help?

I am using Linux 3.9.6 x86_64, with dyninst compiled against master HEAD.

Thanks,
--
仝子飞 (Zifei Tong)
College of Computer Science and Technology, Zhejiang University
[← Prev in Thread] Current Thread [Next in Thread→]