[SOLVED] Porting c programming project from HP-UX to Linix.
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Yes, I can't see any socket related error, but a null pointer in that gdb stack trace.
How did you compile your code on linux? What flags do you use at all?
When I compile my code using the flag '-W -Wall -Werror -pedantic' along with the flag '-g' in linux, it is giving me more errors and i am in the process of resolving these issues. Once i resolve these issues, i will re-run my code and let you know if face more challenges. When i pre-compile the Pro*C files, earlier in linux, i didn't face any kind issues and below is my ProC version.
ccpvlnwht302 ESTRNT6 [918]: proc --v
Pro*C/C++: Release 19.0.0.0.0 - Production on Wed Dec 6 09:05:52 2023
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
System default option values taken from: /u01/home/dba/oracle/product/19.0.0/db_2/precomp/admin/pcscfg.cfg
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 23277]
[New LWP 23280]
[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 0xf7f7b569 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 0xf7f7b569 in __kernel_vsyscall ()
#1 0xf4a1ef56 in raise () from /lib/libpthread.so.0
#2 0xf682c593 in skgesigOSCrash () from /u01/home/dba/oracle/product/19.0.0/db_2/lib/libclntsh.so.19.1
#3 0x0000000b in ?? ()
#4 0xf715b1d0 in kpeDbgSignalHandlerDeregister () from /u01/home/dba/oracle/product/19.0.0/db_2/lib/libclntsh.so.19.1
#5 0x00000000 in ?? ()
(gdb)
-------------------------------------------------------------
You said that you can see a null pointer exception in my above gdb messages, can you elaborate that please or pin point that....?
Thanks
RK
Last edited by jyoravirisi; 12-07-2023 at 12:22 AM.
your stack is destroyed, therefore the gdb output is useless. Most probably because of a null pointer issue. You need to fix all the errors reported by the compiler first (see post #17)
This is not a null pointer exception, but stack tries to do something at 0x0 (#3 and #5), which is just illegal. That causes the segfault.
Hi p
Sure, I will resolve all the errors after compiling using the flag '-W -Wall -Werror -pedantic' and then re-compile my code.
Thanks for the suggestion.
@jyoravirisi: As you have been asked before, 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).
What is that SockRead function? How does that work (or implemented)?
I have no idea what do you mean by "work differently", would be nice to explain exactly what went wrong (what is the expected behavior and and what's happened instead).
@OP What do yo mean failing? read(2) and recv(2) return -1 on error (examine errno), 0 on end-of-file, positive if daza has been received.
Quote:
Originally Posted by pan64
What is that SockRead function? How does that work (or implemented)?
I have no idea what do you mean by "work differently", would be nice to explain exactly what went wrong (what is the expected behavior and and what's happened instead).
Ibid. And is sockFd even any good? What is it's value?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.