LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-04-2023, 06:18 PM   #1
jyoravirisi
LQ Newbie
 
Registered: Dec 2023
Posts: 14

Rep: Reputation: 1
Porting c programming project from HP-UX to Linix.


Hi Guys,

I am currently working on a project, where I need to move the c-source code from HP-UX to Linux. I came across two wired issues, one is on the oracle side, and we were able to resolve by applying a patch (Unique Patch ID: 24128901) for that. Next one is on the socket side where I am getting and issue on socket (SockWrite: error on socket write, errno=104, Connection reset by peer). This code compile and runs good in HP-UX but compiles fine in Linux but fails at runtime in Linux. Please let me know if this is due to porting from HP-UX to Linux and how I can fix this issue in Linux.

Thanks
Ravi K
 
Old 12-04-2023, 07:25 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931
Quote:
Originally Posted by jyoravirisi View Post
Hi Guys,

I am currently working on a project, where I need to move the c-source code from HP-UX to Linux. I came across two wired issues, one is on the oracle side, and we were able to resolve by applying a patch (Unique Patch ID: 24128901) for that. Next one is on the socket side where I am getting and issue on socket (SockWrite: error on socket write, errno=104, Connection reset by peer). This code compile and runs good in HP-UX but compiles fine in Linux but fails at runtime in Linux. Please let me know if this is due to porting from HP-UX to Linux and how I can fix this issue in Linux.

Thanks
Ravi K
Welcome to LQ,

Debug the program you ported. Focus on the trouble spots you've identified up to this point.

Do you need help understanding how to do that? Debugging with a debugger are some blogs cited in my signature. Debugging with printf() is another way, check function returns against what the current manual pages show, and also verify functions being called, along with their arguments, perhaps there are differences between what HP-UX used and the libraries being used in your newly compiled code. Also look up errno 104 and get familiar with the library call giving that error.

Also moving this thread to Programming to give it better visibility.

Last edited by rtmistler; 12-04-2023 at 07:27 PM.
 
1 members found this post helpful.
Old 12-04-2023, 09:56 PM   #3
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,880
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
Most likely endianness-problem: the old platform was big endian, the new platform is little endian.
 
5 members found this post helpful.
Old 12-05-2023, 02:28 PM   #4
jyoravirisi
LQ Newbie
 
Registered: Dec 2023
Posts: 14

Original Poster
Rep: Reputation: 1
Hi NevemTeve,

Could you please help me on how to convert this from big ediness to the little ths ediness in the new environment. I am new to socket programming and i now very little on this topic. If you have any sample code please let me know.

Thanks
Ravi K
 
Old 12-05-2023, 04:37 PM   #5
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,151
Blog Entries: 6

Rep: Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835
You haven't shown any code so that anyone can tell what you are trying to do. Show the part of the code that is failing.

Quote:
If you have any sample code please let me know.
For what? socket?

Example:

getip.c
Code:
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <netinet/in.h>

int main(int argc, char *argv[])
{
    struct addrinfo hints, *res, *p;
    int status;
    char ipstr[INET6_ADDRSTRLEN];

    if (argc != 2) {
        fprintf(stderr,"usage: getip <hostname>\n");
        return 1;
    }

    memset(&hints, 0, sizeof hints);
    hints.ai_family = AF_UNSPEC; 
    hints.ai_socktype = SOCK_STREAM;

    if ((status = getaddrinfo(argv[1], NULL, &hints, &res)) != 0) {
        fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(status));
        return 2;
    }

    printf("\nIP addresses for %s:\n\n", argv[1]);

    for(p = res; p != NULL; p = p->ai_next) {
        void *addr;
        char *ipver;

        if (p->ai_family == AF_INET) { 
            // IPv4
            struct sockaddr_in *ipv4 = (struct sockaddr_in *)p->ai_addr;
            addr = &(ipv4->sin_addr);
            ipver = "IPv4";
        } else { 
            // IPv6
            struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)p->ai_addr;
            addr = &(ipv6->sin6_addr);
            ipver = "IPv6";
        }

        inet_ntop(p->ai_family, addr, ipstr, sizeof ipstr);
        printf("%s:  %s\n", ipver, ipstr);
        }
    printf("\n");

    freeaddrinfo(res); 
    return 0;
}

//gcc getip.c -o getip
Code:
./getip wikipedia.org

IP addresses for wikipedia.org:

IPv4:  208.80.154.224
IPv6:  2620:0:861:ed1a::1
You want more answer, give more info.
 
1 members found this post helpful.
Old 12-05-2023, 05:04 PM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,747

Rep: Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982
Quote:
Originally Posted by jyoravirisi View Post
Hi NevemTeve,
Could you please help me on how to convert this from big ediness to the little ths ediness in the new environment. I am new to socket programming and i now very little on this topic. If you have any sample code please let me know.
A bit confused as to how someone who is "new to socket programming" got a job porting code from HP/UX to Linux which specifically involves socket programming. As teckk said, you've shown us nothing about your code, told us version/distro of Linux or version of HP/UX.

As rtmistler said, have you run this through your debugger?? Also, this error could be generic in nature...which could indicate a network problem. Have you checked selinux, your Linux firewall, or any/all routers/firewalls between your Linux system and whatever you're connecting to?? You hint at Oracle, so there could be a whitelist of addresses that are allowed to connect...is your Linux box among them???
 
1 members found this post helpful.
Old 12-05-2023, 05:23 PM   #7
jyoravirisi
LQ Newbie
 
Registered: Dec 2023
Posts: 14

Original Poster
Rep: Reputation: 1
Hi TB0ne,

I am a c/c++ developer and we are currently moving our code base from HP-UX "HP-UX spare009 B.11.11 U 9000/800 3656892423 unlimited-user license" to Linux "Linux ccpvlnwht302 5.4.17-2136.321.4.1.el7uek.x86_64 #2 SMP Wed Jul 19 14:51:35 PDT 2023 x86_64 x86_64 x86_64 GNU/Linux". I was able to complie the code base without any issue, but once we move the binaries to the Linux and start running , it is giving me an segmentation error and generating a core file. When i debug the core file i am getting the below error....
ccpvlnwht302 ESTRNT6 [779]: gdb bubg core.6540
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-120.0.3.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /u02/apps/kodiak/estrnt6/bg_deliv022317/bin/bubg...done.
[New LWP 6540]
[New LWP 6543]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/u02/apps/kodiak/home/bin/bubg'.
Program terminated with signal 11, Segmentation fault.
#0 0xf7f77569 in __kernel_vsyscall ()
Missing separate debuginfos, use: debuginfo-install glibc-2.17-326.0.9.ksplice1.el7_9.i686 libaio-0.3.109-13.el7.i686
(gdb) bt
#0 0xf7f77569 in __kernel_vsyscall ()
#1 0xf4a1af56 in raise () from /lib/libpthread.so.0
#2 0xf6828593 in skgesigOSCrash () from /u01/home/dba/oracle/product/19.0.0/db_2/lib/libclntsh.so.19.1
#3 0x0000000b in ?? ()
#4 0xf71571d0 in kpeDbgSignalHandlerDeregister () from /u01/home/dba/oracle/product/19.0.0/db_2/lib/libclntsh.so.19.1
#5 0x00000000 in ?? ()

and somebody mentioned that this might be due to endiness. Please advise.....

Thanks
R K
 
Old 12-05-2023, 05:43 PM   #8
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931
People wouldn't you think hton() functions would already be in the code? Unless it's ancient, which HP-UX actually is, but it is still maintained. Anyways it may not be so simple as a one concept answer. Understanding the source and fixing it properly would be an important task to undertake, regardless. And if the OP is a coder, then why should they not be able to manage that?
 
Old 12-05-2023, 05:50 PM   #9
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931
Errno 104 can mean a few things, mainly "connection reset by peer", best to get the version and the library call involved, but also first find out if that's the first error or just a higher level error, post fault. Checking the open() and any other sock calls' returns is first what I'd do, along with verifying what it thinks it received for arguments.
 
Old 12-05-2023, 06:04 PM   #10
jyoravirisi
LQ Newbie
 
Registered: Dec 2023
Posts: 14

Original Poster
Rep: Reputation: 1
Hi,

Here is the server side code snippet.
---------------------Socket Initialization Function-----------------------

void SockInit(char *progNamePtr,
int family,
int socketType,
int type,
int *sockFdPtr,
struct sockaddr_in *sockAddrPtr,
int portNum,
int ioMode,
char *hostNamePtr)
{

int rc; /* local return code */
struct hostent *StructHp; /* host name */
int reuseaddr_on=1; /* SO_REUSEADDR flag */

(void*) memset((char*) progPtr, NULLBYTE, IPC_PROG_NAME_LEN);
(void*) memcpy(progPtr, progNamePtr,strlen(progPtr));

*sockFdPtr = socket(family, socketType, 0);

if (*sockFdPtr > 0)
{
(void*) memset((char*) sockAddrPtr, NULLBYTE, sizeof (sockAddrPtr));
sockAddrPtr->sin_family = (short)family;
sockAddrPtr->sin_port = htons(portNum);

/***********************************************************************
For the Client end, we want to use the address of the server
hostname for the subsequent connect operations.

For the SERVER end, we want to allow any valid addresses to
connect but we do want to perform the bind to allow clients
a name association.
***********************************************************************/

if (type == SOCK_CLIENT)
{
StructHp = gethostbyname(hostNamePtr);

if (StructHp == NULL) /* Error getting host name, Premort */
{
(void) sprintf(errBuf,
"SockInit: Error calling gethostbyname sfd=%d, errno=%d, %s",
*sockFdPtr, errno, strerror(errno));
(void) LogWrite(LOG_CNTL_NONE, errBuf, SLERROR, TRUE, SLERROR);
}
(void*) memcpy(&sockAddrPtr->sin_addr, StructHp->h_addr,
StructHp->h_length);
}
else
{
sockAddrPtr->sin_addr.s_addr = htonl(INADDR_ANY);

reuseaddr_on = 1;
if (rc=setsockopt(*sockFdPtr, SOL_SOCKET, SO_REUSEADDR, &reuseaddr_on,
sizeof(int)) < 0)
{
(void) sprintf(errBuf,
"SockInit: Error returned from setsockopt sockFdPtr=%d, rc=%d",
*sockFdPtr, rc);
(void) LogWrite(LOG_CNTL_NONE, errBuf, SLERROR, TRUE, SLERROR);
}

rc = bind((int)*sockFdPtr, (struct sockaddr *)sockAddrPtr,
sizeof(struct sockaddr_in));

if (rc < 0) /* Error performing bind, premort */
{
(void) sprintf(errBuf,
"SockInit: Error performing bind, sfd=%d, errno=%d, %s",
*sockFdPtr,errno, strerror(errno));
(void) LogWrite(LOG_CNTL_NONE, errBuf, SLERROR, TRUE, SLERROR);
}
}

if (ioMode == SOCK_NOBLOCK)
{
rc = SockSetNonblock(*sockFdPtr);

if (rc != TRUE) /* Error setting mode to nonblock, Premort */
{
(void) sprintf(errBuf,
"SockInit: Error returned from SockSetNonblock sockFdPtr=%d, rc=%d",
*sockFdPtr, rc);
(void) LogWrite(LOG_CNTL_NONE, errBuf, SLERROR, TRUE, SLERROR);
}
}
}
else /* Error on socket call, Premort */
{
(void) sprintf(errBuf, "SockInit: Error opening socket errno=%d, %s",
errno, strerror(errno));
(void) LogWrite(LOG_CNTL_NONE, errBuf, SLERROR, TRUE, SLERROR);
}
}

--------------------------

Connection error is happening in the below code segment.
---------------------------------------------------

/*************************************************************************
Initialize client connection to bubg process. Open in Non-block mode.
*************************************************************************/
rc = gethostname(buomHost,sizeof(buomHost));
if (rc < 0)
{
(void) sprintf(errBuf,
"ProcInit: gethostname returns errno=%d, %s",errno,strerror(errno));
(void) LogWrite(LOG_CNTL_NONE,errBuf,SLERROR,TRUE,SYSERR);
}

SockInit
(
progPtr,
AF_INET,
SOCK_STREAM,
SOCK_CLIENT,
&(buupProc.sockFd),
&buomBuupServer,
(profile.basePortNumber + IPC_UP_TOFROM_BG_PORT),
SOCK_BLOCK,
buomHost
);

rc = connect
(
buupProc.sockFd,
(struct sockaddr *) &buomBuupServer,
sizeof(struct sockaddr_in)
);

if (rc < 0)
{
(void) sprintf(errBuf,
"ProcInit: connect returns errno=%d, %s",errno,strerror(errno));
(void) LogWrite(LOG_CNTL_NONE,errBuf,SLERROR,TRUE,SYSERR);
}
else
{
(void) sprintf(errBuf,"ProcInit: connected, sockFd=%d, portNum=%d",
buupProc.sockFd,profile.basePortNumber+IPC_UP_TOFROM_BG_PORT);
(void) LogWrite(LOG_CNTL_NONE,errBuf,DEBUGMESSAGE,FALSE,0);
}

rc = SockSetNonblock(buupProc.sockFd);
if (rc != TRUE)
{
(void) sprintf(errBuf,
"SockInit: Error returned from SockSetNonblock sockFdPtr=%d, rc=%d",
buupProc.sockFd,rc);
(void) LogWrite(LOG_CNTL_NONE,errBuf,SLERROR,TRUE,SLERROR);
}
return;

-----------------------------
If you find any issues on the above code, please advice.



RK

Last edited by jyoravirisi; 12-05-2023 at 07:26 PM.
 
Old 12-05-2023, 06:26 PM   #11
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206
Please wrap your code and data snippets inside [CODE]...[/CODE] tags. Doing so will preserve indentation and provide other visual clues which make it easier for others to comprehend. You may write those yourself as shown, or use the # button available with Advanced edit options. (A complete list of BBCode tags is always available via a link near the bottom of every thread view).
 
Old 12-05-2023, 07:11 PM   #12
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,747

Rep: Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982
Quote:
Originally Posted by jyoravirisi View Post
Hi TB0ne,

I am a c/c++ developer and we are currently moving our code base from HP-UX "HP-UX spare009 B.11.11 U 9000/800 3656892423 unlimited-user license" to Linux "Linux ccpvlnwht302 5.4.17-2136.321.4.1.el7uek.x86_64 #2 SMP Wed Jul 19 14:51:35 PDT 2023 x86_64 x86_64 x86_64 GNU/Linux". I was able to complie the code base without any issue, but once we move the binaries to the Linux and start running , it is giving me an segmentation error and generating a core file. When i debug the core file i am getting the below error....
Code:
ccpvlnwht302 ESTRNT6 [779]: gdb bubg core.6540
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-120.0.3.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /u02/apps/kodiak/estrnt6/bg_deliv022317/bin/bubg...done.
[New LWP 6540]
[New LWP 6543]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/u02/apps/kodiak/home/bin/bubg'.
Program terminated with signal 11, Segmentation fault.
#0  0xf7f77569 in __kernel_vsyscall ()
Missing separate debuginfos, use: debuginfo-install glibc-2.17-326.0.9.ksplice1.el7_9.i686 libaio-0.3.109-13.el7.i686
(gdb) bt
#0  0xf7f77569 in __kernel_vsyscall ()
#1  0xf4a1af56 in raise () from /lib/libpthread.so.0
#2  0xf6828593 in skgesigOSCrash () from /u01/home/dba/oracle/product/19.0.0/db_2/lib/libclntsh.so.19.1
#3  0x0000000b in ?? ()
#4  0xf71571d0 in kpeDbgSignalHandlerDeregister () from /u01/home/dba/oracle/product/19.0.0/db_2/lib/libclntsh.so.19.1
#5  0x00000000 in ?? ()
and somebody mentioned that this might be due to endiness. Please advise....
Ok, so you're using old RHEL 7, which is what you were asked. You say you're 'moving' the binaries to Linux...are you not COMPILING on Linux to start with?? Not very clear on this, and if you're a C developer already, and are experienced with HP/UX, again confused as to how you don't know big vs. little-endian terminology. You now say it's giving you a core dump, and when you started you said it was a 104 error. You were also advised to check the firewalls/selinux, since 104 could ALSO be a problem with basic network connectivity. You again hint at Oracle being involved, but aren't giving us the entire picture.
 
Old 12-05-2023, 07:45 PM   #13
jyoravirisi
LQ Newbie
 
Registered: Dec 2023
Posts: 14

Original Poster
Rep: Reputation: 1
Hi TB0ne,

I moved the source code from HP-UX to Linux, compiled the code in Linux without any errors and when I run it, it core dumps on segmentation fault. When i debug using gdb as below i am getting the below messages....
-------------------
ccpvlnwht302 ESTRNT6 [779]: gdb bubg core.6540
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-120.0.3.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /u02/apps/kodiak/estrnt6/bg_deliv022317/bin/bubg...done.
[New LWP 6540]
[New LWP 6543]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/u02/apps/kodiak/home/bin/bubg'.
Program terminated with signal 11, Segmentation fault.
#0 0xf7f77569 in __kernel_vsyscall ()
Missing separate debuginfos, use: debuginfo-install glibc-2.17-326.0.9.ksplice1.el7_9.i686 libaio-0.3.109-13.el7.i686
(gdb) bt
#0 0xf7f77569 in __kernel_vsyscall ()
#1 0xf4a1af56 in raise () from /lib/libpthread.so.0
#2 0xf6828593 in skgesigOSCrash () from /u01/home/dba/oracle/product/19.0.0/db_2/lib/libclntsh.so.19.1
#3 0x0000000b in ?? ()
#4 0xf71571d0 in kpeDbgSignalHandlerDeregister () from /u01/home/dba/oracle/product/19.0.0/db_2/lib/libclntsh.so.19.1
#5 0x00000000 in ?? ()
(gdb)
----------------------------------------------------------------

When i looked at the log message, i do see some ERROR messages on the log file as below
-----------------Log Message---------
****ERROR: buup 15036 899757 Tue Dec 5 16:04:38 2023
ProcInit: connect returns errno=111, Connection refused

xxxxJOBABORT: buup 15036 Tue Dec 5 16:04:38 2023


**MESSAGE: buup 15036 905110 Tue Dec 5 16:04:38 2023
LogPremort: exitStatus [66]

****ERROR: buin 15038 869944 Tue Dec 5 16:04:39 2023
ProcInit: Rishabh - connect returns errno=111, Connection refused, ccpvlnwht302

xxxxJOBABORT: buin 15038 Tue Dec 5 16:04:39 2023


**MESSAGE: buin 15038 874366 Tue Dec 5 16:04:39 2023
LogPremort: exitStatus [66]


****ERROR: buup 6539 12491 Tue Dec 5 17:16:45 2023
SockRead: error on socket read, errno=104, Connection reset by peer



--------------------Log Message----------------

When i test regarding the endiness, i found that HP-UX is a Big endian and Linux is a little edinan(afer running the test script). Before that there was one ORA-01036 error was there and after we applied the patch it was taken care of and now i can see only sockets errors in the log messages.

Any more information, please let me know.

Thanks
RK
 
Old 12-05-2023, 08:48 PM   #14
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,017

Rep: Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630
Just a note.
From 2005 HP site.
"Which C compiler are you using on HP-UX, you will probably be using the gnu compiler on linux so you will probably have a few compiler issues from library names and differences in function call formats and names.

The perl and tcl should convert quite nicely unless you have calls to OS programs then you may have the same issues as with the ksh scripts

The korn shell stuff will mostly port with no problem. The exceptions will be any reference to hardware. Linux (or any other unix) doesn't use the same names for all the hardware. The lvol names or tape drive name or in some cases even the tty names could be different so they will have to be updated."
 
Old 12-05-2023, 10:02 PM   #15
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,880
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
So Oracle is involved as well (Is it OCI or Pro*C? If the latter, make sure to perform the preprocessing on the new platform.)
I'm afraid you have to actually debug the program. Other than gdb, valgrind might be useful (though Oracle Client itself contains lot of valgrind-positive problems (at least version 12.x)).
Also make sure to compile with flags `-W -Wall -Werror -pedantic'

PS: On archaic Unix-versions (such as Aix), address 0 is readable, so you NULL-pointer problem might not manifest in same cases. On Linux, reading from address 0 causes instant segfault.

Last edited by NevemTeve; 12-05-2023 at 10:06 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Porting and tuning applications for Linux on Power, Part 2: 15 Porting and tuning tools for Linux on Power LXer Syndicated Linux News 0 05-18-2018 01:05 PM
new to linix I have windows 10 and want a open source linix on seperate partician Evander Linux - Newbie 3 09-07-2016 05:24 PM
Linix WIFI YourForum Linux - Wireless Networking 2 11-27-2003 09:30 AM
Upgrading Linix help joe_dejesus Linux - Hardware 0 02-26-2003 01:51 PM
Linix and p2p mikeshn Linux - General 1 04-06-2002 09:45 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration