- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: gethostbyname fails with core dump
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
Forums
Discussions
Discussions
Discussions
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
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
09-21-2005 01:15 AM
09-21-2005 01:15 AM
gethostbyname fails with core dump
#include
int main( int argc, char *argv[] )
{
struct hostent * toto ;
printf( "Call gethostbyname\n" );
toto = gethostbyname( "tam2012" );
printf("gethostbyname return 0x%08x\n", toto );
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2005 02:14 AM
09-21-2005 02:14 AM
Re: gethostbyname fails with core dump
Of course, the thing to do is get a stack trace.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2005 02:39 AM
09-21-2005 02:39 AM
Re: gethostbyname fails with core dump
I installed the patchs you were talking about and the result is the same.
Here is a stack trace
#0 0xc0137b30 in $$dyncall_external+0 () from /usr/lib/libc.2
(gdb) bt
#0 0xc0137b30 in $$dyncall_external+0 () from /usr/lib/libc.2
#1 0xc021f590 in __thread_once+0x78 () from /usr/lib/libc.2
#2 0xc00add08 in ent2result+0x3c () from /usr/lib/libnss_dns.1
#3 0xb9980 in nss_search+0x258 () from /opt/a1338/bin/./udpCGS
#4 0x71b50 in __gethostbyname_r+0x12c () from /opt/a1338/bin/./udpCGS
#5 0x71cac in gethostbyname+0x7c () from /opt/a1338/bin/./udpCGS
#6 0x20d44 in main (argc=1, argv=0x7b040454) at /a1338_mnt_dev/dubost/5.00/dev/udpCGS/src/udpCGS.c:354
Best regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2005 07:30 PM
09-22-2005 07:30 PM
Re: gethostbyname fails with core dump
perhaps there is no memory allocated for the struct. Try this:
#include
#include
int main( int argc, char *argv[] )
{
struct hostent hhh;
struct hostent *toto = &hhh;
printf( "Call gethostbyname\n" );
toto = gethostbyname(argv[1]);
printf("gethostbyname return %s\n", toto->h_name);
}
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2005 08:05 PM
09-22-2005 08:05 PM
Re: gethostbyname fails with core dump
toto = gethostbyname( "tam2012" );
if (toto == (struct hostent *) NULL)
{
printf("couldn't find host!\n");
}
else
{
printf("gethostbyname return 0x%08x\n", toto );
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2005 08:11 PM
09-22-2005 08:11 PM
Re: gethostbyname fails with core dump
In fact, gethostbyname does not return.
It core dumps.
I suspect a problem with shared libraries.
The program is linked with shared libraries.
If I don't link with the libraries, everything goes fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2005 08:14 PM
09-22-2005 08:14 PM
Re: gethostbyname fails with core dump
In which case, what does
# ldd your_exe
give you ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2005 08:14 PM
09-22-2005 08:14 PM
Re: gethostbyname fails with core dump
#include
#include
int main( int argc, char *argv[] )
{
struct hostent * toto ;
printf( "Call gethostbyname\n" );
toto = gethostbyname( "tam2012" );
printf("gethostbyname return 0x%08x\n", toto );
return 0;
}
If you get core still, paste informations for,
# file core
# what core
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2005 08:24 PM
09-22-2005 08:24 PM
Re: gethostbyname fails with core dump
Look at the following link:
http://groups.google.com/group/comp.databases.sybase/browse_thread/thread/9801f5e01bb48ea4/c1f42f7cfbb617bf?lnk=st&q=gethostbyname+HP-UX+core&rnum=9&hl=en#c1f42f7cfbb617bf
It may be problem with shared libraries.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2005 08:42 PM
09-22-2005 08:42 PM
Re: gethostbyname fails with core dump
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libdld.2 => /usr/lib/libdld.2
/a1338_mnt_dev/dubost/5.00/dev/api_cxx/src/Msg_Daily/build/HPUX11-00-debug/libMsg_Daily.sl => /a1338_mnt_dev/dubost/5.00/dev/api_cxx/src/Msg_Daily/build/HPUX11-00-debug/libMsg_Daily.sl
/a1338_mnt_dev/dubost/5.00/dev/adm-conf/CS_src/adminComm/build/HPUX11-00-debug/libadminComm.sl => /a1338_mnt_dev/dubost/5.00/dev/adm-conf/CS_src/adminComm/build/HPUX11-00-debug/libadminComm.sl
r
Here is the result of "file core" :
core: core file from 'udpCGS' - received SIGBUS
Here is the result of "what core" :
core:
$Header: /cgw_cvs/dev/udpCGS/src/udpCGS.c,v 5.000 2005/09/12 09:47:23 dupety Exp $
$Header: /cgw_cvs/dev/common/include/common.h,v 5.000 2005/09/12 08:34:17 dupety Exp $ $Name: $
$Header: /cgw_cvs/dev/common/src/com_conf.c,v 5.000 2005/09/12 08:34:26 dupety Exp $ $Name: $
HPUX11_00 $Header: /cgw_cvs/dev/common/include/CDRC-portability.h,v 5.000 2005/09/12 08:34:04 dupety Exp $ $Name: $
$Header: /cgw_cvs/dev/common/include/common.h,v 5.000 2005/09/12 08:34:17 dupety Exp $ $Name: $
$Header: /cgw_cvs/dev/common/src/com_log.c,v 4.500.2.1.4.2 2005/09/07 07:26:09 dupety Exp $ $Name: $
HPUX11_00 $Header: /cgw_cvs/dev/common/include/CDRC-portability.h,v 5.000 2005/09/12 08:34:04 dupety Exp $ $Name: $
$ PATCH/11.00:PHCO_28425 Mar 4 2003 07:15:43 $
$Revision: libxti.2: STREAMS: PATCH_11.11 (PHNE_27703) Fri Sep 27 13:18:08 PDT 2002 $
$Header: /cgw_cvs/dev/common/include/common.h,v 5.000 2005/09/12 08:34:17 dupety Exp $ $Name: $
$Header: /cgw_cvs/dev/adm-conf/CS_src/comm_functions.c,v 4.500.2.2 2005/07/11 14:12:58 dupety Exp $
$Header: /cgw_cvs/dev/adm-conf/CS_src/comm_functions.h,v 4.500.2.2 2005/07/11 14:14:31 dupety Exp $
$Header: /cgw_cvs/dev/adm-conf/common_src/adm_nmc.h,v 4.500 2005/03/29 13:34:06 dupety Exp $
HPUX11_00 $Header: /cgw_cvs/dev/common/include/CDRC-portability.h,v 5.000 2005/09/12 08:34:04 dupety Exp $ $Name: $
$Header: /cgw_cvs/dev/common/include/common.h,v 5.000 2005/09/12 08:34:17 dupety Exp $ $Name: $
$Header: /cgw_cvs/dev/api_cxx/src/Msg_Daily/Msg_Daily.cc,v 5.000 2005/09/12 08:33:15 dupety Exp $
HPUX11_00 $Header: /cgw_cvs/dev/common/include/CDRC-portability.h,v 5.000 2005/09/12 08:34:04 dupety Exp $ $Name: $
$Header: /cgw_cvs/dev/common/include/common.h,v 5.000 2005/09/12 08:34:17 dupety Exp $ $Name: $
$Header: /cgw_cvs/dev/api_cxx/src/Msg_Daily/api_Msg_Daily.cc,v 5.000 2005/09/12 08:33:20 dupety Exp $
HPUX11_00 $Header: /cgw_cvs/dev/common/include/CDRC-portability.h,v 5.000 2005/09/12 08:34:04 dupety Exp $ $Name: $
$Header: /cgw_cvs/dev/api_cxx/src/ErrHandler/ErrHandler.cc,v 5.000 2005/09/12 08:33:23 dupety Exp $
HPUX11_00 $Header: /cgw_cvs/dev/common/include/CDRC-portability.h,v 5.000 2005/09/12 08:34:04 dupety Exp $ $Name: $
$ PATCH_11.11/PHCO_33533 Jul 27 2005 02:12:39 $
SMART_BIND
92453-07 dld dld dld.sl B.11.43 050125
Thanks for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2005 08:50 PM
09-22-2005 08:50 PM
Re: gethostbyname fails with core dump
Check the following link for the Patch:
http://groups.google.com/group/comp.sys.hp.hpux/browse_thread/thread/2b5fa111c402dd1f/0101817d7e3b7b1c?lnk=st&q=gethostbyname+HP-UX+core&rnum=28&hl=en#0101817d7e3b7b1c
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2005 08:53 PM
09-22-2005 08:53 PM
Re: gethostbyname fails with core dump
Before that, enable debug option -g with compiler and get gdb stack trace for core?
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2005 10:01 PM
09-22-2005 10:01 PM
Re: gethostbyname fails with core dump
Compilation flags are :
-c -g
Compilation defines are :
-DHPUX11_00 -D_DEBUG_ -DHPUX -D_REENTRANT
Link flags are:
-z -Z -Wl,+s,-a,shared_archive -AA -L/usr/lib -Wl,-a,archive -lpthread
Stack trace is already given in the thread.
Thanks for your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2005 10:48 PM
09-22-2005 10:48 PM
Re: gethostbyname fails with core dump
WARNINGS
Programs that use the interfaces described in this manpage cannot be linked statically because the implementations of these functions employ dynamic loading and inking of shared objects at run time.
In the man page?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2005 08:55 PM
09-26-2005 08:55 PM
Re: gethostbyname fails with core dump
#0 0xc020e5d8 in kill+0x10 () from /usr/lib/libc.2
#1 0xc01a71c4 in raise+0x24 () from /usr/lib/libc.2
#2 0xc01e9170 in abort_C+0x160 () from /usr/lib/libc.2
#3 0xc01e91cc in abort+0x1c () from /usr/lib/libc.2
#4 0xc0e3383c in std::terminate+0x38 () from /usr/lib/libCsup_v2.2
#5 0xc0e33cf4 in ThrowException+0x70 () from /usr/lib/libCsup_v2.2
#6 0xc0e34254 in __throw__FPvT1+0x14c () from /usr/lib/libCsup_v2.2
#7 0xc356e6cc in std::ios_base::setf+0x78 () from /usr/lib/libstd_v2.2
#8 0xc356e194 in std::ios_base::Init::Init+0x1df0 () from /usr/lib/libstd_v2.2
#9 0xc3224814 in std::__sinit_Msg_Daily_cc+0x24 () from /opt/a1338/lib/libMsg_Daily.sl
#10 0xc0e35ce0 in __shlInit+0x88 () from /usr/lib/libCsup_v2.2
#11 0xc32148b8 in _shlInit+0x20 () from /opt/a1338/lib/libMsg_Daily.sl
#12 0xc0e35618 in __shlinit+0xac () from /usr/lib/libCsup_v2.2
#13 0xc0e37b30 in _main+0xd8 () from /usr/lib/libCsup_v2.2
What can I do with this. Thank for your help