- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Hanging process. C/C++ function to get process...
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
тАО06-26-2005 09:25 PM
тАО06-26-2005 09:25 PM
Hanging process. C/C++ function to get process information.
We start several instances of the program (>20). The program is connected to a message bus to get requests and control commands like "exit".
Some times, when we send an "exit" command some of the instances hang.
I have added additional logs to the program to get a clue where the process is hanging.
The logs show that the main() function runs until the last line in code ("return").
What could be the cause for that.
I would like to log the process information just before "return" in main() hopping to get an idea on what the process is doing.
How can I get the process information?
Thanks,
Miguel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-26-2005 10:14 PM
тАО06-26-2005 10:14 PM
Re: Hanging process. C/C++ function to get process information.
welcome to vms forum!
You posted too little informazions for helping you. I hint you checking for return code status.
I guess you have one or both troubles:
a) Your software writes using bad pointer but inside its allocation space; in this case your application doesn't get Invalid Allocation Error when which's using pointer but when exits;
b) On exit your application executes some function that's use a bad pointer.
About return, AFAIK on main function it's better use exit() but application can work with return too.
Antonio Vigliotti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2005 12:51 AM
тАО06-27-2005 12:51 AM
Re: Hanging process. C/C++ function to get process information.
Purely Personal Opinion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-05-2005 12:26 AM
тАО07-05-2005 12:26 AM
Re: Hanging process. C/C++ function to get process information.
I should say that I am not an VMS expert. I do the development on UNIX and than port the program to VMS.
Please, let me know what kind of information you need to help me.
Is there a possibility to get more proccess information before exiting the main function?
For example, I think it could be useful to write a proccess dump (stack dump) like after a crash. How can I do that?.
Do I have a chance to know if the application ist using bad pointers?
Ian:
How can I get the proccess state you are asking for?
Below is the process information provided by "show proccess/all/id=xxxx":
24-JUN-2005 09:13:06.37 User: AA_XX Process ID: 49C32B1C
Node: AAA Process name: "WSM_BGH0LW_P_1"
Terminal:
User Identifier: [BBBUSR,AA_XX]
Base priority: 4
Default file spec: Not available
Number of Kthreads: 2
Devices allocated: BG411:
Process Quotas:
Account name:
CPU limit: Infinite Direct I/O limit: 960
Buffered I/O byte count quota: 97440 Buffered I/O limit: 2688
Timer queue entry quota: 199 Open file quota: 294
Paging file quota: 966096 Subprocess quota: 50
Default page fault cluster: 64 AST quota: 499
Enqueue quota: 2999 Shared file limit: 0
Max detached processes: 0 Max active jobs: 0
Accounting information:
Buffered I/O count: 3756229 Peak working set size: 31792
Direct I/O count: 889650 Peak virtual size: 202976
Page faults: 2711 Mounted volumes: 0
Images activated: 17
Elapsed CPU time: 0 00:53:46.39
Connect time: 3 23:51:21.52
Authorized privileges:
GROUP NETMBX OPER SYSLCK TMPMBX
Process privileges:
GROUP may affect other processes in same group
NETMBX may create network device
SYSLCK may lock system wide resources
TMPMBX may create temporary mailbox
Process rights:
AA_XX resource
System rights:
SYS$NODE_AAA
Auto-unshelve: on
Image Dump: off
Soft CPU Affinity: off
Parse Style: Traditional
Home RAD: 0
There is 1 process in this job:
WSM_BGH0LW_P_1 (*)
Thanks,
Miguel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-05-2005 01:16 AM
тАО07-05-2005 01:16 AM
Re: Hanging process. C/C++ function to get process information.
you can simply obtain the state of your process with SHOW SYSTEM/PROC=
As you are running an old version of OpenVMS, you cannot use the SET PROC/DUMP=NOW command to force a process dump, when your process is hung.
But you can look at the hung process with SDA
$ ANAL/SYS
SDA> SET PROC/IND=
SDA> SHOW PROC
SDA> SHOW PROC/LOCK
SDA> SHOW PROC/CHAN
SDA> CLUE CALL
SDA> SHOW STACK
The information obtained by SDA needs to be reviewed by someone experienced with OpenVMS internals.
Volker.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-05-2005 03:00 AM
тАО07-05-2005 03:00 AM
Re: Hanging process. C/C++ function to get process information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-08-2005 12:04 AM
тАО07-08-2005 12:04 AM
Re: Hanging process. C/C++ function to get process information.
Attached is the information provided by SDA for two hanging processes.
Thanks,
Miguel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-08-2005 05:29 PM
тАО07-08-2005 05:29 PM
Re: Hanging process. C/C++ function to get process information.
o.k. - so the program 'hangs' in PTRHEADs (indicated by the process state of HIBernate and PTRHEAD$RTL as the caller of SYS$HIBER_C). You now need to use the SDA PTHREAD extension to look at the PTHREAD status of the process:
SDA> SET PROC/IND=
SDA> pthread help ! gives some help about options
SDA> pthread t -1a ! show thread state
You are running OpenVMS Alpha V7.2-2. Make sure you have all available patches installed. There is a VMS722_PTRHEAD-V0100 patch (among many others).
But before installing patches, start with looking at the thread states of your application first, maybe you can find the problem in the application...
Volker.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-08-2005 03:18 AM
тАО08-08-2005 03:18 AM
Re: Hanging process. C/C++ function to get process information.
Attached is the threads information provided by SDA.
Thanks,
Miguel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-08-2005 05:04 AM
тАО08-08-2005 05:04 AM
Re: Hanging process. C/C++ function to get process information.
thanks for the info. The situation is the same in both hanging processes:
The exit-handling thread is blocked on a mutex
SDA> pthread mutexes
will show the mutexes. To see which code is running in the exit-handling thread, one could try:
SDA> pthread stack
and then examine the current stack of thread -4
SDA> SHOW STACK
If you can locate a frame pointer, try SDA> SHOW CALL
Please be aware, that this might become a lengthy troubleshooting effort. Did you check, whether you have the most recent PTHREAD patches installed ?
Volker.