Re: [DynInst_API:] Stack protection error on ubuntu


Date: Sun, 29 Mar 2009 04:21:41 -0400
From: Rishikesh Naik <rishinaik9@xxxxxxxxx>
Subject: Re: [DynInst_API:] Stack protection error on ubuntu
Hi Alok,

Thanks a lot for quick response! 

Yes. I have exported all environment variables in bashrc file as said in README.

export DYNINST_ROOT=/home/dyninst/dyninstAPI/src
export PLATFORM=i386-unknown-linux2.4
export LD_LIBRARY_PATH=/home/dyninst/dyninstAPI/src/i386-unknown-linux2.4/lib:/usr/local/lib/:
export DYNINSTAPI_RT_LIB=${DYNINST_ROOT}/${PLATFORM}/lib/libdyninstAPI_RT.so.1

export DYNINST_CORE=${DYNINST_ROOT}/core
export DYNINST_HEADERS=${DYNINST_ROOT}/include
export DYNINST_LIBS=${DYNINST_ROOT}/${PLATFORM}/lib

I tried LD_PRELOAD as you suggested. But , it gives me errors  like :

rishi@box1:~$ ./exec 30688
Failed to find _dl_open
process.C[2484]:  FIXME:  loadDYNINSTlib failed

rishi@box1:~$ export LD_PRELOAD=/home/dyninst/dyninstAPI/src/i386-unknown-linux2.4/lib/libdyninstAPI_RT.so.1
rishi@box1:~$ ./exec 30688
./exec: symbol lookup error: /home/dyninst/dyninstAPI/src/i386-unknown-linux2.4/lib/libdyninstAPI_RT.so.1: undefined symbol: __stack_chk_fail_local


I am attaching the mutator program with this email.  Program fails in process attachment/ process creation part. 

Thanks again.

Looking forward to your reply..

-Rishikesh
 
On Sun, Mar 29, 2009 at 2:55 AM, alok singh <alok_shishir@xxxxxxxxxxx> wrote:
Have you exported the necessary environment variables for specifying the necessary libraries (like DYNINSTAPI_RT_LIB)? I haven't used Dyninst for a while so I don't remember the exact names of the variables but you can check the documentation/README for that. Since for you second problem it's complaining about the runtime library, you can try preloading the libdyninstAPI_RT.so by exporting LD_PRELOAD=/home/dyninst/dyninstAPI/src/i386-unknown-linux2.4/lib/libdyninstAPI_RT.so.1 and also exporting the path in LD_LIBRARY_PATH. 
Also I think it will be useful for people on mailing list if you could attach the program which is making calls to Dyninst functions. 

Alok


From: Rishikesh Naik <rishinaik9@xxxxxxxxx>
To: dyninst-api@xxxxxxxxxxx
Sent: Sunday, 29 March, 2009 9:57:58 AM
Subject: [DynInst_API:] Stack protection error on ubuntu

Hi All,

I tried to create a simple mutator and mutatee programs. They compile fine. But, I am getting following error when I try to run it:

main: symbol lookup error: /home/dyninst/dyninstAPI/src/i386-unknown-linux2.4/lib/libdyninstAPI_RT.so.1: undefined symbol: __stack_chk_fail_local
--SERIOUS-- #0: The process exited during startup.  This is likely due to one of two reasons:
A). The application is mis-built and unable to load.  Try running the application outside of Dyninst and see if it loads properly.
B). libdyninstAPI_RT is mis-built.  Try loadin
--FATAL-- #68: Dyninst was unable to create the specified process
--FATAL-- #68: create process failed bootstrap
Segmentation fault

I am using ubuntu system. If found out that there was some issue with stack protection. I then recompiled the dyninst API with DISABLE-STACK-PROT=true in make.config.local file in src/core directory. I also disabled stack randomization. 

But I am still having same issue. One more thing , I get this error only when I use createProcess function. When I try to attach to existing process I get following error:

process.C[2525]:  Don't have runtime library handle

I checked out the code at that line. it says to check if runtime library is loaded. But, I don't understand how to do that either.

So, can anybody help me with this?

I am stuck at this really badly. Any help is appreciated.

Thanks,
Rishikesh






Get rid of Add-Ons in your email ID. Get yourname@xxxxxxxxxxxxxx. Sign up now!

Attachment: s.cpp
Description: Binary data

[← Prev in Thread] Current Thread [Next in Thread→]