- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- /sbin/sh versus command ! in vi
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
12-08-2004 07:51 AM
12-08-2004 07:51 AM
I have a program in c++ calling a function in OCI oracle (olog). When I run the program from command shell it ends by Memory Fault (coredump) error:
root # ./cprog
declaring my connection
Just Before olog
Memory fault(coredump)
root #
But I when I callt his program from editor vi with command !, the program ends without memory fault:
from editor vi
~
~
:!./cprog
declaring my connection
Just Before olog
Not Connected ,returning from olog
[Hit return to continue]
So, anycase my olog function is not connecting, but when I run the program from vi, it returns and ends without problem.
Somebody can explainme whta is the difference between the process ran from /sbin/sh and from command ! in vi.
Thanks in advance for you information.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2004 08:18 AM
12-08-2004 08:18 AM
SolutionYou are really attacking the problem all wrong. You need to fix the fundamental problem -- your code. Use gdb to do a stack trace. If you will recompile/relink with -g you can zero in on the offending line.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2004 08:33 AM
12-08-2004 08:33 AM
Re: /sbin/sh versus command ! in vi
It's clearr your explanation. I am trying to solve this problem:
If I call olog routine from the main() function in my program, it works fine and connects with oracle. But if I call olog from a function member of a class, it doesn't connects with oracle and outputs the memory fault (coredump) from /sbin/sh.
For problem isolation, I simplify the class to only one member function calling olog in the same way that in function main() but does works. Do you have any suggestion about that?
Thanks again for your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2004 08:40 AM
12-08-2004 08:40 AM
Re: /sbin/sh versus command ! in vi
For problem isolation, I simplify the class to only one member function calling olog in the same way that in function main() but doesn't works. Do you have any suggestion about that?
Thanks again for your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2004 08:41 AM
12-08-2004 08:41 AM
Re: /sbin/sh versus command ! in vi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2004 02:29 AM
12-09-2004 02:29 AM
Re: /sbin/sh versus command ! in vi
I am attaching my programs and the results of gdb, as you can see there I am doing the same code in the class as in the main function, but when I call the function member in the class the programs ends with Memory fault(coredump), but from main() function it execute successfully.
Do you have any idea why that is happening?
Thanks IN ADVANCE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2004 10:28 AM
12-09-2004 10:28 AM
Re: /sbin/sh versus command ! in vi
ub4 hda[HDA_SIZE/sizeof(ub4)];
change to:
ub4 hda[HDA_SIZE];
--------------------------------------
memset(hda,'\0',HDA_SIZE/sizeof(ub4));
change to:
memset((void *) hda,(int) '\0',sizeof(hda));
After doing this I saw your "Yes Connected from main()" and your "Yes Connected from class" probes. And what is this printf stuff doing in C++; it ought to be cout.
This was a little difficult to do in a stack trace because the actual segmentation violation was occurring in a shared library which was not compiled with debugger info but the problem appeared to be that your hda array was too small. The call in main() was really working by accident.