- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Shared library memory corruption and apache
Operating System - Linux
1822034
Members
3384
Online
109639
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
тАО10-19-2006 03:28 AM
тАО10-19-2006 03:28 AM
Shared library memory corruption and apache
In an apache module that I build as a shared library I have a static structure and a static pointer pointing to it.
Immediately after apache executes shl_load, the memory address for the pointer holds 0 on some compiles of the shared library, and the memory address of the structure on other compiles. The difference between my compilations is the presence of the -g flag when creating the object files. When I compile using -g, the pointer holds the correct value, when I compile without it, the pointer holds 0. The behavior of whether the pointer has the correct value seems to be related to the size of the shared library as changing the length of strings or adding new functions to try and debug causes the problem to dissapear (I assume it is just moving to another location that I haven't noticed yet).
Has anyone experienced this behavior before or have any ideas about what is causing the pointer value to change.
I am running on HP-UX B.11.00 64bit but the library is compiled for 32bit.
Object files are compiled using cc using the following flags:
-O2 -Ae -z +z +Ofastaccess +ESlit +Oprocelim +DS2.0 +DA2.0
And linked using ld with these flags
+s -b -ashared -L/usr/lib -ldld -lnsl -lm -lc -L/opt/openldap/lib -lldap -L/opt/MDW/lib -lclntsh-9.0 -lfileman -lMagick -L/opt/apache.RISC_2/lib -lexpat -lapr-0 -laprutil-0 -lcurl
Note that I've trimmed defines and include search directories that I don't believe are relevant, they can be found at the end of this message.
Thanks for any advice as to what could be the cause of this behavior.
Chris Johnson
-DHPUX -DSLXMX_ENABLE -DSLTS_ENABLE -D_REENTRANT -DMDW_SCHEMAS -DSPORTS -DBRG -DCALENDAR -DDYNAPUB -DTASKTRACK -DCLASSIFIEDS -DDATA_ENTRY -DTRANSIT -DDEMOGRAPHICS -DORG -DELECTIONS -DECOMMERCE -DTEMPLATE -DATL -DFMS -DMM -DREPORTING -DCARTRIDGE -DAPACHE -DAUTH_LDAP -I/var/spool/software/src/fileman -I/u01/app/oracle/product/9.2.0/rdbms/demo -I/u01/app/oracle/product/9.2.0/rdbms/public -I/u01/app/oracle/product/9.2.0/precomp/public -I/opt/MDW/include -I/opt/openldap/include -I/opt/apache.RISC_2/include -I/opt/openldap/include -I/opt/magick/include
Immediately after apache executes shl_load, the memory address for the pointer holds 0 on some compiles of the shared library, and the memory address of the structure on other compiles. The difference between my compilations is the presence of the -g flag when creating the object files. When I compile using -g, the pointer holds the correct value, when I compile without it, the pointer holds 0. The behavior of whether the pointer has the correct value seems to be related to the size of the shared library as changing the length of strings or adding new functions to try and debug causes the problem to dissapear (I assume it is just moving to another location that I haven't noticed yet).
Has anyone experienced this behavior before or have any ideas about what is causing the pointer value to change.
I am running on HP-UX B.11.00 64bit but the library is compiled for 32bit.
Object files are compiled using cc using the following flags:
-O2 -Ae -z +z +Ofastaccess +ESlit +Oprocelim +DS2.0 +DA2.0
And linked using ld with these flags
+s -b -ashared -L/usr/lib -ldld -lnsl -lm -lc -L/opt/openldap/lib -lldap -L/opt/MDW/lib -lclntsh-9.0 -lfileman -lMagick -L/opt/apache.RISC_2/lib -lexpat -lapr-0 -laprutil-0 -lcurl
Note that I've trimmed defines and include search directories that I don't believe are relevant, they can be found at the end of this message.
Thanks for any advice as to what could be the cause of this behavior.
Chris Johnson
-DHPUX -DSLXMX_ENABLE -DSLTS_ENABLE -D_REENTRANT -DMDW_SCHEMAS -DSPORTS -DBRG -DCALENDAR -DDYNAPUB -DTASKTRACK -DCLASSIFIEDS -DDATA_ENTRY -DTRANSIT -DDEMOGRAPHICS -DORG -DELECTIONS -DECOMMERCE -DTEMPLATE -DATL -DFMS -DMM -DREPORTING -DCARTRIDGE -DAPACHE -DAUTH_LDAP -I/var/spool/software/src/fileman -I/u01/app/oracle/product/9.2.0/rdbms/demo -I/u01/app/oracle/product/9.2.0/rdbms/public -I/u01/app/oracle/product/9.2.0/precomp/public -I/opt/MDW/include -I/opt/openldap/include -I/opt/apache.RISC_2/include -I/opt/openldap/include -I/opt/magick/include
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-19-2006 10:24 AM
тАО10-19-2006 10:24 AM
Re: Shared library memory corruption and apache
Can you shl_load your lib from a smaller driver program and debug that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-23-2006 02:06 AM
тАО10-23-2006 02:06 AM
Re: Shared library memory corruption and apache
Dennis,
Thanks for the advice, I'll try doing that to see if I can narrow down what the actual problem is. It may take me a while to get the stub done as I'm not well versed in writing programs that use shl_load and my first few attempts so far have run into unsatisfied symbol problems. I'm sure it will just be a matter of getting all of the correct things loaded (or preloaded) in the right order.
Chris
Thanks for the advice, I'll try doing that to see if I can narrow down what the actual problem is. It may take me a while to get the stub done as I'm not well versed in writing programs that use shl_load and my first few attempts so far have run into unsatisfied symbol problems. I'm sure it will just be a matter of getting all of the correct things loaded (or preloaded) in the right order.
Chris
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP