- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- ASTs corrupting stack frames in DECC 6.5 /optimize
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
тАО07-26-2005 07:28 AM
тАО07-26-2005 07:28 AM
The attachment is a test program I assembled to better isolate the problem. When compiled/optim=level=1, the AST frame is 48 bytes higher on the stack than with level=2 optimization. Note that the program uses SYS$SNDJBC() to muck with the accounting file, so I would caution against actually trying to run the program.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-26-2005 11:34 AM
тАО07-26-2005 11:34 AM
Re: ASTs corrupting stack frames in DECC 6.5 /optimize
Unfortunately "it's been working for years" doesn't really mean much. Although there's an outside chance of a compiler bug, this is almost certainly an application error. They're far too easy to make in C, and can lurk benignly for decades.
The value 040001 looks suspiciously like an IOSB for the successful completion of a 4 byte $QIO to me. Running under DEBUG, I find that the corruption goes away with tracing on, which suggests a timing issue.
So, take a very careful look at the iosb's of ALL asynch system services. You're looking for one with context "above" your problem routine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-26-2005 11:39 AM
тАО07-26-2005 11:39 AM
SolutionAha! I think I've found it...
The SYS$SNDJBC in "afi_initialize" is async, the IOSB is allocated on the stack within the routine, and it's the last call in the routine. So, if we return and call another routine, which establishes a stack frame before the $SNDJBC completes, the IOSB could overwrite part of that frame.
Change the code to SYS$SNDJBCW or move to IOSB to static storage.
This is a VERY general principle. You must make sure that IOSBs are allocated in storage with a life time that extends to at least the completion of the service.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-26-2005 12:51 PM
тАО07-26-2005 12:51 PM
Re: ASTs corrupting stack frames in DECC 6.5 /optimize
I'm aware that compiler bugs are extremely rare, but they are not unknown.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-26-2005 03:32 PM
тАО07-26-2005 03:32 PM
Re: ASTs corrupting stack frames in DECC 6.5 /optimize
> Didn't $SNDJBC start life not 'really' asynchronous
No, indeed it's always been one of the "least synchronous" of the asynch services. Some requests require a message to the local JOB_CONTROL process, which in turn has to talk to the QUEUE_MANAGER, possibly on another node, potentially numerous I/Os, then the return path for the result.
This kind of bug can lie dormant for a long time, because the trigger requires both the timing to be right (err... make that "wrong" ;-), and the corrupted stack location has to matter enough to cause trouble.
>R0 always contained the value in the first word of the iosb?
For all the asynch services, R0 really only tells you that the request was syntactically correct. The IOSB tells you the result. In a debugged program R0 should always be "success", but the IOSB can vary as a result of external influences.
>I'm aware that compiler bugs are extremely rare, but they are not unknown.
I'd say "rare" rather than "extremely rare", (but then I get a very selected sample). Long experience has taught me to always start by looking at the application, rather than assuming a compiler bug.
On the other hand, in just the last month or so, an ITRC report has uncovered a day 1 bug in the Basic RTL.