- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: gethostbyname dumps with SIGSEGV
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
тАО12-06-2007 01:16 AM
тАО12-06-2007 01:16 AM
Re: gethostbyname dumps with SIGSEGV
Someone mentioned that h_length in memcpy wasn't valid:
memcpy(&sin->sin_addr, hostp->h_addr_list[0], hostp->h_length);
From the man page, I have no idea whether h_length is the size of h_addr_list[0] or of all of them.
Best to use sizeof(sin->sin_addr).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2007 09:49 AM
тАО12-08-2007 09:49 AM
Re: gethostbyname dumps with SIGSEGV
This frament is a small part of a huge program.
WDB doesn't complain about any memory issues, but I just installed the latest SunStudio 12 and ran the Solaris version under it where memory issues are reported elsewhere.
The strange thing is WDB says it's OK and it dumps in the middle of a libc call that has a valid string as a parameter.
At this point the only conclusion I can come to is that the HP implementation of gethostbyname has some area that is reused between calls which is getting hosed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2007 02:55 PM
тАО12-08-2007 02:55 PM
Re: gethostbyname dumps with SIGSEGV
That's why several people and I can't duplicate the abort. Have you linked with -z to catch NULL pointer dereferences?
>WDB doesn't complain about any memory issues
You're using "set heap-check on"?
>The strange thing is WDB says it's OK and it dumps in the middle of a libc call that has a valid string as a parameter.
WDB is only checking the heap usage, not everything. (It relies on the hardware to check the rest. :-)
>At this point the only conclusion I can come to is that the HP implementation of gethostbyname has some area that is reused between calls which is getting hosed.
Possibly.
Are you up to date on patches?
>the second time the function containing it is called.
Are you passing the same string the second time?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-10-2007 12:51 PM
тАО12-10-2007 12:51 PM
Re: gethostbyname dumps with SIGSEGV
malloc
malloc_padded
malloc
localtime_r
ctime_r
syslog
I ran a patch assessment and installed the latest patches last week
WDB 5.7 has all memory checks enabled.
CFLAGS = -Ae +w1 +ESnolit -z -g
LIBS = -lxnet -lrtc
This works flawlessly on Solaris.
I'm back to guessing it is a library compatibility issue as it has always dumped in libc.2.
I guess I could put the whole thing up on an anonymous CVS server if noone has any other hints without full sources.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-10-2007 03:07 PM
тАО12-10-2007 03:07 PM
Re: gethostbyname dumps with SIGSEGV
malloc
malloc_padded
malloc
>WDB 5.7 has all memory checks enabled.
This shows the heap has been corrupted. I'm surprised gdb didn't catch it.
>CFLAGS = -Ae +w1 +ESnolit -z -g
Why are you using +ESnolit? You should use the default or +ESlit.
>I guess I could put the whole thing up on an anonymous CVS server if no one has any other hints without full sources.
I could just try the binary, if you make that available.
- Tags:
- heap corruption
- « Previous
-
- 1
- 2
- Next »