HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Invalid arguments with sys$mgblsc on VMS 7.3-2...
Operating System - OpenVMS
1832181
Members
2908
Online
110038
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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-15-2006 08:37 AM
06-15-2006 08:37 AM
I am trying to map a section of my program memory to a global section created by another process. I can map it to my process memory and then read and modify it, but if I try to map to a specific common section I have set up I get a 4042 error.
What can I do to fix this?
What can I do to fix this?
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2006 11:15 AM
06-15-2006 11:15 AM
Solution
John,
On Alpha global sections are always whole numbers of physical pages. The INADDR argument must be precise - first address is on a page boundary (which you've done correctly by aligning your data), end address must be the last byte on the last page of the section. Note these are Alpha system pages, so 8KB. Although I haven't done the calculation, I'm fairly certain your endcommon address doesn't satisfy this requirement.
Try changing your code to something like:
in_addr(2) = (((%loc(endcommon)+SYI$_PAGE_SIZE).AND..NOT.(SYI$_PAGE_SIZE-1))-1
So, first we add the size of a page to the end address, then mask off the low bits, this gives the start address of the next page beyond endcommon, then we subtract 1 to give the address of the last byte of the page containing endcommon. The calculation is correct even if endcommon is already the last byte on a page.
That said, it probably makes sense to pad your common block out to a whole number of pages. You don't know what variables may be mapped to the extra locations beyond your common block. Consider, what if you have two processes map to this global section, each of which has their own private variables just beyond the common block. Suddenly they're global, overmapping variables in other processes. Modifications in one process will automagically show up as completely unrelated variables in the other process. Impossible to reproduce exactly, and very difficult to debug.
The call "works" with EXPREG because that causes the INADDR argument to be ignored. The section is mapped to the next available virtual page(s) in P0 space. In your case, the section is mapped, but not where you wanted it.
When using $CRMPSC or $MGBLSC, always check the RETADR argument as well as the return status to make sure it really did exactly what you wanted (at least while debugging).
On Alpha global sections are always whole numbers of physical pages. The INADDR argument must be precise - first address is on a page boundary (which you've done correctly by aligning your data), end address must be the last byte on the last page of the section. Note these are Alpha system pages, so 8KB. Although I haven't done the calculation, I'm fairly certain your endcommon address doesn't satisfy this requirement.
Try changing your code to something like:
in_addr(2) = (((%loc(endcommon)+SYI$_PAGE_SIZE).AND..NOT.(SYI$_PAGE_SIZE-1))-1
So, first we add the size of a page to the end address, then mask off the low bits, this gives the start address of the next page beyond endcommon, then we subtract 1 to give the address of the last byte of the page containing endcommon. The calculation is correct even if endcommon is already the last byte on a page.
That said, it probably makes sense to pad your common block out to a whole number of pages. You don't know what variables may be mapped to the extra locations beyond your common block. Consider, what if you have two processes map to this global section, each of which has their own private variables just beyond the common block. Suddenly they're global, overmapping variables in other processes. Modifications in one process will automagically show up as completely unrelated variables in the other process. Impossible to reproduce exactly, and very difficult to debug.
The call "works" with EXPREG because that causes the INADDR argument to be ignored. The section is mapped to the next available virtual page(s) in P0 space. In your case, the section is mapped, but not where you wanted it.
When using $CRMPSC or $MGBLSC, always check the RETADR argument as well as the return status to make sure it really did exactly what you wanted (at least while debugging).
A crucible of informative mistakes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2006 10:36 PM
06-15-2006 10:36 PM
Re: Invalid arguments with sys$mgblsc on VMS 7.3-2 Alpha
See also the fine documentation
http://h71000.www7.hp.com/doc/82FINAL/5841/5841pro_075.html#sec_glob_section
Generally using EXPREG is better but how you would refer to this in the programming language you are using I know not.
http://h71000.www7.hp.com/doc/82FINAL/5841/5841pro_075.html#sec_glob_section
Generally using EXPREG is better but how you would refer to this in the programming language you are using I know not.
____________________
Purely Personal Opinion
Purely Personal Opinion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2006 01:33 AM
06-16-2006 01:33 AM
Re: Invalid arguments with sys$mgblsc on VMS 7.3-2 Alpha
Adjusting the in_addr(2) to the correct page boundary fixed the problem. Thanks very much.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP