HP OpenVMS Systemsask the wizard |
The Question is: I'm having a strange-to-me problem with installed common blocks. I have a pair of applications that share data through installed common blocks. We've been using this configuration for several years and probably have 50-70 installations of the applicatio ns. One nice feature that VMS provides is the storage of the data in the common blocks on disk. The feature is very helpful to us on system reboots. When the applications restart, they have the same data in the common blocks that they had before the re boot. Until recently, we've always seen it work that way. On an installation we've had running for 6 months or so, we've seen different behavior. When the applications restart after a reboot, the data they find in the installed common blocks is data fr om sometime long ago rather than the data just prior to the reboot. We very much prefer to have the data just prior to the reboot. I've not been able to find anything in manuals or on the internet to give me a clue as to why this installation is behavin g differently than all my other installations. Can you tell me anything about what is going on? Do you need more information? Thanks very much for any help you can provide. Solving this problem would be a big help to us. The Answer is :
This is unusual and rather unexpected behaviour, and would point to an
application or an OpenVMS problem -- please contact the folks at the
Compaq Customer Support Center directly for assistance tracking this
down as far more information -- or (better) a reproducer -- will be
required to resolve this, including OpenVMS version and platform
information, and information on anything that changed recently.
The OpenVMS Wizard would look for something that is substituting or
otherwise redirecting or resetting or copying the contents of the
COMMON file at or near application or system startup, and for any
file access or protection problems, and other similar oddities.
Also consider writing up a diagnostic tool that can connect to and
monitor the data contents of the COMMON. Shut down the application
images and processes in a controlled fashion -- no node crashes and
no sys$delprc calls against images linked with the COMMON -- and use
this tool to access the COMMON, then restart the application and see
if the data (unexpectedly) reverts.
For information on maintaining processor caches and properly
interlocking access to shared memory, please see topics including
(2681), (6984) and (7383). General programming information is
available in (1661), and the top level of the Ask The Wizards area
relevent information in the top-level sections entitled:
global sections (how to create and use.)
shareable images (cookbook approach to creating one)
An example of working with COMMONs -- one that might serve as the
basis for the creation of a reproducer for this problem -- follows:
--
$! 'f$verify(0)'
$!
$!
$! COPYRIGHT (c) 1999 BY
$! DIGITAL EQUIPMENT CORPORATION, NASHUA, NEW HAMPSHIRE.
$! ALL RIGHTS RESERVED.
$!
$! THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
$! ONLY IN ACCORDANCE OF THE TERMS OF SUCH LICENSE AND WITH THE
$! INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER
$! COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
$! OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY
$! TRANSFERRED.
$!
$! THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE
$! AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
$! CORPORATION.
$!
$! DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
$! SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
$!
$!
$! CCMN.COM
$!
$! The files created and deleted by this procedure all have names:
$!
$! SYS$SCRATCH:CCMN_*.*
$!
$! This procedure demonstrates creating and using a shareable image
$! and a writeable shareable image (common) on OpenVMS Alpha, and
$! demonstrates both static (link-time) and dynamic (run-time) linking
$! operations.
$!
$! This procedure creates three images:
$!
$! ccmn_main.exe this is the main executable image
$! ccmn_shr.exe this is a shareable image
$! ccmn_common.exe this is a writeable shareable image (common)
$!
$! This then installs ccmn_common.exe (/write/share) and then invokes
$! the executable image ccmn_main.exe several times.
$!
$! The executable image ccmn_main.exe activates ccmn_common.exe and
$! dynamically activates (using lib$find_image_symbol) ccmn_shr.exe,
$! making various updates to the contents of the writeable shareable
$! during each run, both directly from ccmn_main.exe and from a routine
$! within ccmn_shr.exe.
$!
$! Each run of the executable image should see the contents of the
$! counter variable left from the previous run, and both the executable
$! (main) image and the (dynamically activated) shareable image should
$! also see and share access to the counter.
$!
$!
$! Author:
$! Stephen Hoffman
$! OpenVMS Engineering
$! Compaq Computer Corporation
$! 26-Mar-1999
$!
$!
$ set noon
$ write sys$output "**"
$ write sys$output "** CCMN running..."
$ write sys$output "**"
$ privlist = "CMKRNL"
$ if .not. f$privilege(privlist)
$ then
$ write sys$output "** Insufficient privileges. Requires:"
$ write sys$output "** " + privlist
$ endif
$ write sys$output "**"
$ write sys$output "** Commencing the compilation operations..."
$ write sys$output "**"
$ create sys$scratch:ccmn.h
/*
** COPYRIGHT (c) 1999 BY
** DIGITAL EQUIPMENT CORPORATION, NASHUA, NEW HAMPSHIRE.
** ALL RIGHTS RESERVED.
**
** THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
** ONLY IN ACCORDANCE OF THE TERMS OF SUCH LICENSE AND WITH THE
** INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER
** COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
** OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY
** TRANSFERRED.
**
** THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE
** AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
** CORPORATION.
**
** DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
** SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
*/
/*
// Author: Stephen Hoffman, Compaq Computer Corporation, 26-Mar-1999
*/
#pragma environment save
#pragma nomember_alignment
/* #pragma extern_model common_block nopic,ovr,noexe,wrt,shr,novec */
#pragma extern_model common_block nopic,shr
struct foo
{
int Counter;
};
extern struct foo CCMN_STRUCT;
#pragma environment save
$ cc/decc/nodebug/optim/objec=sys$scratch:ccmn_main.obj sys$input:
#pragma module CCMN_MAIN "V1.0-000"
/*
** COPYRIGHT (c) 1999 BY
** DIGITAL EQUIPMENT CORPORATION, NASHUA, NEW HAMPSHIRE.
** ALL RIGHTS RESERVED.
**
** THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
** ONLY IN ACCORDANCE OF THE TERMS OF SUCH LICENSE AND WITH THE
** INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER
** COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
** OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY
** TRANSFERRED.
**
** THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE
** AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
** CORPORATION.
**
** DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
** SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
*/
/*
// Author: Stephen Hoffman, Compaq Computer Corporation, 26-Mar-1999
*/
#include "sys$scratch:ccmn.h"
#include <descrip.h>
#include <lib$routines.h>
#include <ssdef.h>
#include <starlet.h>
#include <stdio.h>
#include <stsdef.h>
#include <unistd.h>
main()
{
int RetStat;
$DESCRIPTOR( ShareableFileName, "CCMN_SHR" );
$DESCRIPTOR( ShareableDefaultName, "SYS$SHARE:.EXE" );
$DESCRIPTOR( ShareableRoutineName, "CCMN_ROUTINE" );
int (*ShareableFunctionAddr)();
printf("CCMN_MAIN running...\n");
printf("The starting value of the counter is..... 0x0%x\n", CCMN_STRUCT.Counter );
/* increment, but also prevent a counter overflow... */
if ( ++CCMN_STRUCT.Counter > 0x0ffffff )
{
CCMN_STRUCT.Counter = 0;
printf("The reinitialized counter value is ...... 0x0%x\n", CCMN_STRUCT.Counter );
}
else
printf("The incremented counter value is ........ 0x0%x\n", CCMN_STRUCT.Counter );
printf("Dynamically activating the shareable image...\n");
RetStat = lib$find_image_symbol( &ShareableFileName, &ShareableRoutineName,
&ShareableFunctionAddr, &ShareableDefaultName );
if (!$VMS_STATUS_SUCCESS( RetStat ))
return RetStat;
printf("Now calling the shareable image...\n");
RetStat = ShareableFunctionAddr();
if (!$VMS_STATUS_SUCCESS( RetStat ))
return RetStat;
printf("Successful call to the shareable image...\n");
printf("The counter is now set to ............... 0x0%x\n", CCMN_STRUCT.Counter );
printf("Now calling the shareable image...\n");
RetStat = ShareableFunctionAddr();
if (!$VMS_STATUS_SUCCESS( RetStat ))
return RetStat;
printf("Successful call to the shareable image...\n");
printf("The counter is now set to ............... 0x0%x\n", CCMN_STRUCT.Counter );
printf("CCMN_MAIN exiting...\n");
return SS$_NORMAL;
}
$ cc/decc/nodebug/optim/objec=sys$scratch:ccmn_shr.obj sys$input:
#pragma module CCMN_SHR "V1.0-000"
/*
** COPYRIGHT (c) 1999 BY
** DIGITAL EQUIPMENT CORPORATION, NASHUA, NEW HAMPSHIRE.
** ALL RIGHTS RESERVED.
**
** THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
** ONLY IN ACCORDANCE OF THE TERMS OF SUCH LICENSE AND WITH THE
** INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER
** COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
** OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY
** TRANSFERRED.
**
** THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE
** AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
** CORPORATION.
**
** DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
** SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
*/
/*
// Author: Stephen Hoffman, Compaq Computer Corporation, 26-Mar-1999
*/
#include "sys$scratch:ccmn.h"
#include <stdio.h>
#include <ssdef.h>
CCMN_ROUTINE()
{
int RetStat;
printf("CCMN_SHR routine CCMN_ROUTINE running...\n" );
printf("The starting value of the counter is..... 0x0%x\n", CCMN_STRUCT.Counter++ );
printf("The incremented counter value is ........ 0x0%x\n", CCMN_STRUCT.Counter );
printf("CCMN_SHR routine CCMN_ROUTINE exiting...\n" );
return SS$_NORMAL;
}
$ cc/decc/nodebug/optim/objec=sys$scratch:ccmn_common.obj sys$input:
#pragma module CCMN_COMMON "V1.0-000"
/*
** COPYRIGHT (c) 1999 BY
** DIGITAL EQUIPMENT CORPORATION, NASHUA, NEW HAMPSHIRE.
** ALL RIGHTS RESERVED.
**
** THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
** ONLY IN ACCORDANCE OF THE TERMS OF SUCH LICENSE AND WITH THE
** INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER
** COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
** OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY
** TRANSFERRED.
**
** THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE
** AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
** CORPORATION.
**
** DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
** SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
*/
/*
// Author: Stephen Hoffman, Compaq Computer Corporation, 26-Mar-1999
*/
#include "sys$scratch:ccmn.h"
$! link the common first, then the shareable, then the executable...
$ write sys$output "** Commencing the link operations..."
$ link/share=sys$scratch:ccmn_common.exe -
ccmn_common.obj,sys$input/option
IDENTIFICATION="CCMN V1.0"
GSMATCH=lequal,1,0
SYMBOL_VECTOR=(CCMN_STRUCT=PSECT)
$ link/share=sys$scratch:ccmn_shr.exe -
ccmn_shr.obj,sys$input/option
IDENTIFICATION="CCMN V1.0"
GSMATCH=lequal,1,0
SYMBOL_VECTOR=(CCMN_ROUTINE=PROCEDURE)
SYS$SCRATCH:CCMN_COMMON.EXE/SHARE
$ link/exec=sys$scratch:ccmn_main.exe -
ccmn_main.obj,sys$input/option
IDENTIFICATION="CCMN V1.0"
SYS$SCRATCH:CCMN_COMMON.EXE/SHARE
$! get ready to run the executable image, and run it...
$ if f$file("sys$scratch:ccmn_common.exe","KNOWN")
$ then
$ install replace /write/share sys$scratch:ccmn_common.exe
$ else
$ install create /write/share sys$scratch:ccmn_common.exe
$ endif
$! we need/use logical names, as these shareables are not in sys$share:
$ define ccmn_shr sys$scratch:ccmn_shr.exe
$ define ccmn_common sys$scratch:ccmn_common.exe
$ write sys$output "**"
$ write sys$output "** Running the executable image..."
$ write sys$output "**"
$ run sys$scratch:ccmn_main
$ write sys$output "**"
$ write sys$output "** Running the executable image..."
$ write sys$output "**"
$ run sys$scratch:ccmn_main
$ write sys$output "**"
$ write sys$output "** Running the executable image..."
$ write sys$output "**"
$ run sys$scratch:ccmn_main
$ write sys$output " "
$ deassign ccmn_shr
$ deassign ccmn_common
$! clean up
$ write sys$output "**"
$ write sys$output "** Cleaning up..."
$ write sys$output "**"
$ install delete sys$scratch:ccmn_common.exe
$ delete sys$scratch:ccmn.h;*
$ delete sys$scratch:ccmn_main.exe;*,sys$scratch:ccmn_main.obj;*
$ delete sys$scratch:ccmn_shr.exe;*,sys$scratch:ccmn_shr.obj;*
$ delete sys$scratch:ccmn_common.exe;*,sys$scratch:ccmn_common.obj;*
$ write sys$output "**"
$ write sys$output "** Done..."
$ write sys$output "**"
$ exit
|