- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: " ttrace related stuff ": Printing syscall arg...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-01-2009 03:32 AM
тАО07-01-2009 03:32 AM
ttstate_t structure will give the arguments list of the syscall which is being called by the process.
I am trying to print the arguments of open syscall, following statement is used to print :
[code]printf("\nOpen args : %s\n", (char *) stp->tts_scarg[0]/* first arg of open syscall */);
[/code]
following is the command to run my tracer :
[command]
./tracer make
[/command]
[output]
Open args :
Open args : /opt/graphics/OpenGL/lib/libogltls.sl
Open args : ding
Open args : /usr/lib/libdld.2
Open args : /usr/lib/libc.2
Open args :
Open args :
Open args : .
Open args : ..
Open args : ..
Open args : ..
Open args : ..
Open args : ERROR: mmap failed for dld
Memory fault(coredump)
[/output]
anybody has idea what is the problem here?
even when I go to debug mode and try to print the argument with the given address, its saying "error accessing memory address : bad address"
any help would be greatly appreciated.
~Shaan
Solved! Go to Solution.
- Tags:
- ttrace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-01-2009 03:39 AM
тАО07-01-2009 03:39 AM
Re: " ttrace related stuff ": Printing syscall arguments using tts_scarg.
is SHLIB_PATH set properly before this run?
Does it include /usr/lib ?
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-01-2009 03:45 AM
тАО07-01-2009 03:45 AM
Re: " ttrace related stuff ": Printing syscall arguments using tts_scarg.
>try to print the argument with the given address
You should also print out the hex address of the string (%p) so you check if you have a bogus address.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-01-2009 03:47 AM
тАО07-01-2009 03:47 AM
Re: " ttrace related stuff ": Printing syscall arguments using tts_scarg.
here is the content of SHLIB_PATH
$ echo $SHLIB_PATH
/usr/lib
and run the tracer program but no luck :(
Hit with same problem ...
Any inputs on the same will help me a lot ..
Waiting for your reply
Shaan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-01-2009 04:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-01-2009 04:22 AM
тАО07-01-2009 04:22 AM
Re: " ttrace related stuff ": Printing syscall arguments using tts_scarg.
Few of those are printing, and I am not able to access the memory for the one which I got core dump.
"Open args : ERROR: mmap failed for dld"
1) In the above statement, I expect the error message should come through "write" syscall not from "open".
2) After the above statement, we are getting core dump(Observe the error message: mmap failed for dld). I am suspecting something happening wrong with mmap, because of this we are trying to access bad address.
I am not sure, just a guess :)
~Shaan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-02-2009 03:44 PM
тАО07-02-2009 03:44 PM
Re: " ttrace related stuff ": Printing syscall arguments using tts_scarg.
These are illusions, I would assume none are printing correctly. Use a real tool, tusc, to compare.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-05-2009 08:12 PM
тАО07-05-2009 08:12 PM
Re: " ttrace related stuff ": Printing syscall arguments using tts_scarg.
>>I would hope it is obvious, the addresses >>you get for syscall arguments are in the >>traced process' address space. You'll need >>to fetch MAXPATHLEN bytes for each to
>>print them out.
You are right, thanks for your reply!!! At the very first time I didn't realize this, and I thought I can access the content with the given address directly (we can't do this, because we cannot access kernel space directly). So we need to use ttrace again to get the content of the given address.
Finally its working fine!!!
Thanks a lot to everyone replied for this thread!!! :-)
~Shaan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-05-2009 09:07 PM
тАО07-05-2009 09:07 PM
Re: " ttrace related stuff ": Printing syscall arguments using tts_scarg.
This isn't in kernel space, it is in the other process' space. You would need to to be in ring 0 to set the space/region register and the PID.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-06-2009 09:31 PM
тАО07-06-2009 09:31 PM
Re: " ttrace related stuff ": Printing syscall arguments using tts_scarg.
Yup, its in other process space.
~Shaan.