- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Debugging shared libraries (Apache DSOs) with WDB
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
тАО04-19-2001 08:34 AM
тАО04-19-2001 08:34 AM
Debugging shared libraries (Apache DSOs) with WDB
I have built a custom Apache module as a Dynamic Shared Object (DSO) and I am have having problems being able to debug this module.
My Environment is the following:
HP-UX 11.00 on a C3600 machine,
HP ANSIC compiler ( HP92453-01 A.11.01.00)
WDB 2.1 (gdb 5.0)
Apache 1.3.14 (DSO support enabled)
I have naturally built my module with full symbolic debugging information.
Both Apache and my module compile, link and run fine, but I cannot seem to be able to source debug the module.
I have tried a couple of methods:
1. Attaching to a running Apache process, loading the source for my module into wdb, and setting a breakpoint. At this point I am told that a deferred breakpoint is set and will be enabled when the shared library gets loaded. It never gets enabled. I have tried trapping the load of my library with a 'catch load' statement and then re-enabling the breakpoint manually, but this doesn't work either. Although it claims to be re-enabled, it never actually stops (althought it is plain that my code *has* executed)
After trawling the web a little, I found that there might be some issues with setting breakpoints in shared libraries (since other programs need them too). So I tried...
2. Starting Apache directly from within wdb, (so that the shared libraries were privately mapped), and starting Apache with a '-X' parameter i.e. single process mode, to simplify the issue further. I then tried again, both with deferred breakpoints and also using 'catch load' + setting breakpoints, but it seems that these breakpoints are never honoured.
Does any body have any suggestions as to what I am doing wrong or know of any steps that will allow me to debug my module?
Thanks,
Morgan Pyne
SAS EMEA Webmaster
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-20-2001 07:49 AM
тАО04-20-2001 07:49 AM
Re: Debugging shared libraries (Apache DSOs) with WDB
/opt/langtools/bin/pxdb -s on binary
This is necessary whenever you want to attach to a binary and set a break point in a shared library. This is a technique I use when I suspect a program is encountering some condition and just calling exit. I'll set a breakpoint on exit and then do a stack trace.
Other tips:
- debug binary not necessary,
but helpful
- symbols necessary
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-20-2001 08:43 AM
тАО04-20-2001 08:43 AM
Re: Debugging shared libraries (Apache DSOs) with WDB
Thanks for the tip, I hadn't run psdb on the Apache binary. I thought this might do the trick, but unfortunately it has caused another problem.
pxdb seems to kill my binary. When the Apache binary has been processed by it, it seems to hang. It does not reply to any requests on port 80 anymore (indeed I don't think it even binds to the port - I get a 'connection refused' attempting to connect) The behaviour is exhibited both inside and outside wdb. My next step will be to build a debug version of Apache and try to find out where/why it is hanging.
However, since you have experience using pxdb I was wondering if you have seen this behaviour before and if you had any suggested causes/solutions?
Thanks,
Morgan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-20-2001 01:07 PM
тАО04-20-2001 01:07 PM
Re: Debugging shared libraries (Apache DSOs) with WDB
Does Apache pay attention to SIGHUP or some other signal to know if someone is 'poking' at it? That might be where things are going wrong.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2001 01:49 AM
тАО04-25-2001 01:49 AM
Re: Debugging shared libraries (Apache DSOs) with WDB
It's working. I did a lot of tests regarding signals as you suggested above and got very varied results, but I'll spare these details here and instead explain the steps I took to get it working (in case it helps somebody else)
Firstly, I checked to see if there were any patches available which I didn't have installed and which may be relevant. I found PHS_22514, which is an update to the dynamic load library (dld.so) and applied this. Interestingly enough, this patch also seems to provide the dl_open et al. functions to 32bit applications - (whereas I think previously 32bit apps used the shl_xxxx function set, and the dl_xxxx functions were only available for 64bit apps??)
I also decided to use the latest apache sources
(1.3.19) - don't know how relevant this was to solving my problem but I thought I'd mention it anyway. I rebuilt Apache from scratch, and also all of my modules. The only module I built with debugging info was the module I wanted to test.
Next, I ran 'pxdb -s on httpd' on my apache binary to enable private shared library loading, as you had suggested.
I was then able to start apache in single-process mode from within WDB, set a deferred breakpoint in my module, and the debugger stopped as expected when my code was encountered.
So - problem solved, and thanks a lot for your help.
Now, all I have to do is figure out where the stray pointer is in my module, but I think I can manage that by myself :-)
Cheers,
Morgan