T.R | Title | User | Personal Name | Date | Lines |
---|
1360.1 | testprogram.c | STKHLM::BERGGREN | Nils Berggren EIS/Project dpmt, Sweden DTN 876-8287 | Tue Aug 20 1991 10:09 | 213 |
|
/**********************************************/
/***** sample program to show the ACC-VIO *****/
/**********************************************/
#include <mcc_interface_def.h> /* MCC Interface Defintions File */
#include <mcc_descrip.h> /* MCC Interface Defintions File */
#include <mcc_vea_def.h> /* MCC verb, entity, attrib constants */
#include <mcc_msg.h> /* MCC message definitions file */
#include "mcc_MYMM_am_srvc_if.H" /* MYMM service */
main()
{
unsigned long status = MCC_S_NORMAL;
unsigned long int dns_status;
unsigned long mode = MCC_K_ILV_NATIVE_VALUE ;
unsigned long int *alloc_mem_list = MCC_K_NULL_PTR;
unsigned short int length;
unsigned short int eventlength = 128;
unsigned short int glob_name_len;
unsigned short int appl_name_len;
unsigned short int opaque_string_len;
MCC_T_UNSLONG event_partition = MCC_K_PRT_CONFIGURATION_EVENTS;
MCC_T_UNSLONG event_code = MCC_K_APPL_EVENT1; /* 7785 */
MCC_T_UNSLONG report_id = 4711;
char event_data[] = "JUST AN EVENT-REPORT" ;
char glob_name[] = "SEB075";
char appl_name[128];
MCC_T_Descriptor *time_stamp = MCC_K_NULL_PTR;
MCC_T_Descriptor *arg_desc = MCC_K_NULL_PTR;
MCC_T_Descriptor *instance = MCC_K_NULL_PTR;
MCC_T_Descriptor *appl_instance = MCC_K_NULL_PTR;
MCC_T_Descriptor *event_report = MCC_K_NULL_PTR;
MCC_A_AES entity = MCC_K_NULL_PTR;
MCC_T_SimpleName opaque_string;
struct MCC_R_ILV_CONTEXT ctx;
/*
** init mem mgmt service
*/
status = mcc_desframe_init_alloc_list( &alloc_mem_list );
memset(appl_name, 0, sizeof(appl_name) );
printf("Entityname [TEST-1] :");
gets( appl_name );
if (appl_name[0] == 0)
strcpy(appl_name, "TEST-1");
/*
** create AES for gloabel entity
*/
glob_name_len = strlen( glob_name );
status = mcc_dns_opaque_simplename( glob_name,
&glob_name_len,
&opaque_string,
&opaque_string_len,
&dns_status);
if(status == MCC_S_NORMAL)
status = mcc_desframe_create_descriptor( &alloc_mem_list,
&instance,
&opaque_string_len,
&MCC_K_DT_SIMPLE_NAME,
&opaque_string,
&MCC_K_ATTR_USERNAME, /* 1 */
MCC_K_NULL_PTR);
if(status == MCC_S_NORMAL)
status = mcc_aes_create( &entity,
&MCC_K_CLASS_MYMM, /* 700 */
instance,
&MCC_K_AES_NOT_WILD);
/*
** append application entity to mymm-AES
*/
appl_name_len = strlen(appl_name);
status = mcc_dns_opaque_simplename( appl_name,
&appl_name_len,
&opaque_string,
&opaque_string_len,
&dns_status);
if(status == MCC_S_NORMAL)
status = mcc_desframe_create_descriptor( &alloc_mem_list,
&appl_instance,
&opaque_string_len,
&MCC_K_DT_SIMPLE_NAME,
&opaque_string,
&MCC_K_MYMM_SYM_APPLICATION_NAME, /* 7101 */
MCC_K_NULL_PTR);
if(status == MCC_S_NORMAL)
status = mcc_aes_create(&entity,
&MCC_K_CLASS_APPLICATION, /* 7000 */
appl_instance,
&MCC_K_AES_NOT_WILD);
printf("AES-dump of entity:\n");
mcc_aes_dump(entity);
/*
** create event report
*/
if(status == MCC_S_NORMAL)
status = mcc_desframe_create_descriptor( &alloc_mem_list,
&event_report,
&eventlength,
&MCC_K_DT_ILV,
0,
&MCC_K_MYMM_APPL_EVENT_RECEIVED, /* 7781 */
0);
if(status == MCC_S_NORMAL)
status = mcc_ilv_put_param_begin( &ctx,
event_report);
if(status == MCC_S_NORMAL)
status = mcc_ilv_put_cons_begin( &ctx,
&MCC_K_MYMM_APPL_EVENT_REPORT, /* 7782*/
MCC_K_NULL_PTR,
MCC_K_NULL_PTR,
&mode);
if(status == MCC_S_NORMAL)
status = mcc_ilv_put_cons_begin( &ctx,
&event_code,
MCC_K_NULL_PTR,
MCC_K_NULL_PTR,
&mode);
/*
** create descriptor for event_data
** and insert it into event_report
*/
length = strlen(event_data);
if(status == MCC_S_NORMAL)
status = mcc_desframe_create_descriptor(
&alloc_mem_list, /* Memory Allocation List */
&arg_desc, /* Descriptor Pointer */
&length, /* Length */
&MCC_K_DT_LATIN1STRING, /* Datatype */
&event_data, /* Initial Value */
&report_id, /* Id */
&DSC_K_DTYPE_T); /* VMS datatype */
if(status == MCC_S_NORMAL)
status = mcc_ilv_put( &ctx,
arg_desc,
MCC_K_NULL_PTR );
if(status == MCC_S_NORMAL)
status = mcc_ilv_put_cons_end( &ctx );
/* End Constructor */
if(status == MCC_S_NORMAL)
status = mcc_ilv_put_cons_end( &ctx );
/* End building attr Output */
if(status == MCC_S_NORMAL)
status = mcc_ilv_put_param_end( &ctx,
event_report );
/*
** create timestamp with current time
*/
if(status == MCC_S_NORMAL)
status = mcc_time_create(&time_stamp,
&MCC_K_DT_LATIN1STRING,
0, 0);
if(status == MCC_S_NORMAL)
status = mcc_time_get_current(time_stamp);
/*
** dump event-data
*/
printf("ILV-dump on event-report\n");
if(status == MCC_S_NORMAL)
mcc_ilv_dump( event_report );
/*
** deliver event...
*/
if(status == MCC_S_NORMAL)
status = mcc_event_put( entity,
&event_partition,
&event_code,
event_report,
time_stamp);
if (status == MCC_S_NORMAL)
printf (" ===> PUTEVENT; Successful completion!\n");
else if (status == MCC_S_NOEVENTREQ)
printf (" ===> PUTEVENT; no event request outstanding!\n");
else
printf (" ===> PUTEVENT; error! status = %d\n", status);
return( status );
} /* send_report_to_mcc */
|
1360.2 | Only thing I could find - was incorrect datatype for the Event Timestamp | NANOVX::ROBERTS | Keith Roberts - DECmcc Toolkit Team | Tue Aug 20 1991 15:57 | 29 |
| Only thing I could find - was incorrect datatype for the Event Timestamp...
You put in MCC_K_DT_LATIN1STRING .. but it should be MCC_K_DT_BIN_ABS_TIM.
Now - I don't know if that is the problem, but I can't see why it would be.
Also, the SRM says (for the 'mcc_time_get_current' routine:
"A condition value of MCC_S_UNSUPP_OP is returned if the caller passed
in a descriptor with a time data type of anything other than
MCC_K_DT_BIN_ABS_TIM."
Your code properly tests for a 'normal' status after calling the mcc_time_create
routine - I would have expected you to get the UNSUPP_OP error status (?)
--------- Unsolicited Info: ON
btw -- I don't know if you intend on making this portable code (to Ultrix), but
just in case ... You cannot pass a constant by reference. You must set
a variable to the constant value, then pass the variable by reference.
MCC_T_Unsigned32 time_datatype = MCC_K_DT_BIN_ABS_TIM;
:
:
status = mcc_time_create( &time_stamp, &time_datatype, 0, 0 )
--------- Unsolicited Info: OFF
/keith
|
1360.3 | logical name for LOG and TRACE ? | STKHLM::BERGGREN | Nils Berggren EIS/Project dpmt, Sweden DTN 876-8287 | Tue Aug 20 1991 16:54 | 18 |
| repl .2
>>> You put in MCC_K_DT_LATIN1STRING .. but it should be MCC_K_DT_BIN_ABS_TIM.
Thanks for the remark. I'll change the code.
>>> btw -- I don't know if you intend on making this portable code (to Ultrix), but
>>> just in case ... You cannot pass a constant by reference. You must set
>>> a variable to the constant value, then pass the variable by reference.
No, we don't have any plans on porting the code but we really hope to
get things to work with our event-sink.
What was the name of the logicals to enable tracing on the event-mgr,
and what values to use? I'll see if I can get something out of the
trace.
/Nils
|
1360.4 | event_mgr trace-log | STKHLM::BERGGREN | Nils Berggren EIS/Project dpmt, Sweden DTN 876-8287 | Wed Aug 21 1991 06:57 | 95 |
| Here's some more info.
I had a crash on my WS so I had to restart MCC and then I didn't have
any problems doing MCC_EVENT_PUT (returning 'no event requests outstanding')
in my ACC_VIO-program.
Now I started MCC/interf=decw and went down into my entities. I have a
MYMM-entity named SEB075 which contains one application named TEST-1.
double-clicking on "SEB075" and then doubleclicking on "applications..."
I get the application entity TEST-1 up int the window (so far so good).
Now in another window I tried to run my acc_vio-program, and now it
crashes whatever name I give.
Below you'll find a log with MCC_EVENT_LOG set to 1 and
MCC_EVENT_TRACE set to FFF.
Any hints?
thanks,
Nils
$ !**************** log with EVENT_LOG and EVENT_TRACE on ****************
$ defin mcc_event_log 1
$ defin mcc_event_trace fff
$ run acc_vio
Entityname [TEST-1] :
AES-dump of entity:
entity [0] wild = NOT_WILD class = 700 id = 1 type
%X0106534542303735
entity [1] wild = NOT_WILD class = 7000 id = 7101 type = 4
instance = ..TEST-1
%X0106544553542D31
ILV-dump on event-report
[ 7781 ] (
[ 7782 ] (
[ 7785 ] (
[ 4711 ] 4a 55 53 54 20 41 4e 20 45 56 45 4e 54 2d 52 4
5 50 4f 52 54 -- JUST AN EVENT-REPORT
)
)
)
Tracing error paths in Event Manager
Tracing Event code path in CIT
Tracing Event code path in Common
Tracing Event code path in Dump
Tracing Event code path in EDQ
Tracing Event code path in EDS
Tracing Event code path in EMP
Tracing Event code path in ERB
Tracing Event code path in GET
Tracing Event code path in PUT
Tracing Event code path in RCB
Tracing Event code path in RMB
Tracing Event code path in Signal
Event_Put starting
Event_Put processing Partition argument
Event_Put Input Arguments ...
entity [0] wild = NOT_WILD class = 700 id = 1 type = 4
instance = ..SEB075
%X0106534542303735
entity [1] wild = NOT_WILD class = 7000 id = 7101 type = 4
instance = ..TEST-1
%X0106544553542D31
Partition = 15
Event Code = 7785
Event Data =
Dump of MCC Descriptor reveals:
mcc_w_maxstrlen = 128
mcc_w_curlen = 42
mcc_b_flags = 0
mcc_b_ver = 1
mcc_l_id = 7781
mcc_l_dt = MCC_K_DT_ILV
mcc_a_pointer = ��e..$��f...��i....g.JUST AN EVENT-REPORT
%XBFBC65820024BFBC6682001EBFBC698200189FA467144A55535420414E204556454E542D52
45504F5254
mcc_a_link = MCC_K_NULL_PTR
Timestamp = 21-AUG-1991 11:32:22.69
Event_Put getting current time
Event_Put converting user supplied time into BAT
Event_Put building an EDS structure to store Event Data
Acquiring lock on Event Data
Adding EDS to EDS List
Incremented Reference Count in EDS to 1
Releasing lock on Event Data
Event_Put creating an AHS
Event_Put Locking Subscriber structures
Event_Put Subscriber searching for first(/next) matching request
%SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual address=00000008, PC
=00105A7C, PSL=03C00004
%SYSTEM-E-ACCVIO, access violation, reason mask=00, virtual address=0000000A, PC
=0000000A, PSL=00000004
|
1360.5 | How are you compiling/linking? /debug? | TOOK::GUERTIN | Don't fight fire with flames | Wed Aug 21 1991 11:39 | 5 |
| I've just tried to run your program and it ACCVIOed in
mcc_aes_create(), it never even got close to calling mcc_event_put().
-Matt.
|
1360.6 | how I compile/link/debug | STKHLM::BERGGREN | Nils Berggren EIS/Project dpmt, Sweden DTN 876-8287 | Wed Aug 21 1991 13:20 | 106 |
| repl .5
This is what I do:
$ cc/debu/noop acc_vio
$ type acc_vio.opt
acc_vio.obj
MCC_DESFRAME.OLB/LIBRARY
SYS$LIBRARY:MCC_kernel_init
SYS$LIBRARY:MCC_KERNEL_SHR/SHARE
$ link/debug acc_vio.opt/opt
$ run acc_vio
VAX DEBUG Version V5.4-019
%DEBUG-I-INITIAL, language is C, module set to ACC_VIO
%DEBUG-I-NOTATMAIN, type GO to get to start of main program
DBG> go
break at routine ACC_VIO\main
2012: {
DBG> set bre/excep
DBG> go
Entityname [TEST-1] :Whatever
AES-dump of entity:
entity [0] wild = NOT_WILD class = 700 id = 1 type = 4
instance = ..SEB075
%X0106534542303735
entity [1] wild = NOT_WILD class = 7000 id = 7101 type = 4
instance = ..Whatever
%X01085768617465766572
ILV-dump on event-report
[ 7781 ] (
[ 7782 ] (
[ 7785 ] (
[ 4711 ] 4a 55 53 54 20 41 4e 20 45 56 45 4e 54 2d 52 4
5 50 4f 52 54 -- JUST AN EVENT-REPORT
)
)
)
Tracing error paths in Event Manager
Tracing Event code path in CIT
Tracing Event code path in Common
Tracing Event code path in Dump
Tracing Event code path in EDQ
Tracing Event code path in EDS
Tracing Event code path in EMP
Tracing Event code path in ERB
Tracing Event code path in GET
Tracing Event code path in PUT
Tracing Event code path in RCB
Tracing Event code path in RMB
Tracing Event code path in Signal
Event_Put starting
Event_Put processing Partition argument
Event_Put Input Arguments ...
entity [0] wild = NOT_WILD class = 700 id = 1 type = 4
instance = ..SEB075
%X0106534542303735
entity [1] wild = NOT_WILD class = 7000 id = 7101 type = 4
instance = ..Whatever
%X01085768617465766572
Partition = 15
Event Code = 7785
Event Data =
Dump of MCC Descriptor reveals:
mcc_w_maxstrlen = 128
mcc_w_curlen = 42
mcc_b_flags = 0
mcc_b_ver = 1
mcc_l_id = 7781
mcc_l_dt = MCC_K_DT_ILV
mcc_a_pointer = ��e..$��f...��i....g.JUST AN EVENT-REPORT
%XBFBC65820024BFBC6682001EBFBC698200189FA467144A55535420414E204556454E542D52
45504F5254
mcc_a_link = MCC_K_NULL_PTR
Timestamp = 21-AUG-1991 17:56:39.35
Event_Put getting current time
Event_Put converting user supplied time into BAT
Event_Put building an EDS structure to store Event Data
Acquiring lock on Event Data
Adding EDS to EDS List
Incremented Reference Count in EDS to 1
Releasing lock on Event Data
Event_Put creating an AHS
Event_Put Locking Subscriber structures
Event_Put Subscriber searching for first(/next) matching request
%DEBUG-I-DYNIMGSET, setting image MCC_KERNEL_SHR
%DEBUG-I-DYNMODSET, setting module MCC_EVENT_ERB
%SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual address=00000008, PC
=00105A7C, PSL=03C00004
break on exception at MCC_EVENT_ERB\ERB_MATCH_ERB\%LINE 2021
DBG> ! set image.... set modu ....
DBG> sho call
module name routine name line rel PC abs PC
*MCC_EVENT_ERB ERB_MATCH_ERB 2021 00000050 00105A7C
*MCC_EVENT_PRB PRB_MATCH_PRB 1956 000000A7 00105383
*MCC_EVENT_CIT ESS$_MATCH_SUBSCRIPTION 4003 0000012E 0010240A
*MCC_EVENT_PUT mcc_event_put 2576 00000391 000C55C1
SHARE$ACC_VIO 00000000 00000A6D
SHARE$ACC_VIO 00000000 000027A7
SHARE$ACC_VIO 00000000 000027F2
SHARE$ACC_VIO 00000000 00002782
|
1360.7 | more info | STKHLM::BERGGREN | Nils Berggren EIS/Project dpmt, Sweden DTN 876-8287 | Wed Aug 21 1991 13:24 | 59 |
|
More info again.
When I get the acc_vio (I have done SET BREAK/EXCEPTION)
the call stack is as follows:
module name routine name line rel PC abs PC
*MCC_EVENT_ERB ERB_MATCH_ERB 2021 00000050 00105A7C
*MCC_EVENT_PRB PRB_MATCH_PRB 1956 000000A7 00105383
*MCC_EVENT_CIT ESS$_MATCH_SUBSCRIPTION 4003 0000012E 0010240A
*MCC_EVENT_PUT mcc_event_put 2576 00000391 000C55C1
*SHARE$ACC_VIO MAIN 00000251 00000A6D
*SHARE$ACC_VIO MCC_DESFRAME_VALIDATE_CALLARGS 0000149F 000027A7
*SHARE$ACC_VIO MCC_DESFRAME_VALIDATE_CALLARGS 000014EA 000027F2
*SHARE$ACC_VIO MCC_DESFRAME_VALIDATE_CALLARGS 0000147A 00002782
Looking at the instructions for ERB_MATCH_ERB they are as follows:
(only first 25 lines)
Line 1977: entry mask ^M<R2,R3,R4,R5>
: MOVAB B^-104(SP),SP
: MOVAB L^1433268,R4
Line 2007: CLRL B^-12(FP)
Line 2010: PUSHAL B^-8(FP)
: PUSHL B^12(AP)
: CALLS S^#2,L^MCC_AHS\mcc_ahs_get_state
: MOVL R0,R5
Line 2011: MCOML R5,R2
: BICL3 R2,I^#1,R2
: BNEQ MCC_EVENT_ERB\ERB_MATCH_ERB\%LINE 2018
Line 2013: PUSHAL B^123(R4)
: CALLS S^#1,L^MCC_EVENT_DUMP\evt__printf
Line 2014: PUSHL R5
: CALLS S^#1,L^MCC_EVENT_DUMP\evt__putmsg
Line 2015: MOVL R5,R0
: RET
Line 2018: TSTL B^-8(FP)
: BEQL MCC_EVENT_ERB\ERB_MATCH_ERB\%LINE 2020
: BRW MCC_EVENT_ERB\ERB_MATCH_ERB\%LINE 2073
Line 2020: MOVL B^4(AP),R3
Line 2021: TSTL B^8(R3)
: BNEQ MCC_EVENT_ERB\ERB_MATCH_ERB\%LINE 2031
Line 2023: PUSHAL B^-12(FP)
:
:
:
I not an expert on assembler but I manage to read some.
Line 2021 is the one that crashes. We're moving the first argument, B^4(AP),
to R3 and then trying to access the second longword of what R3 is pointing at.
The problem is that the first argument is NULL which gives the acc-vio on
address=00000008. All my arguemnts to MCC_EVENT_PUT are non-zero and as
far as I know, they're correct, but one never knows...
Now, can anyone who has the sources look and see what we're trying to
access, and why we're getting this acc-vio
(please....)
/Nils
|
1360.8 | Are you calling mcc_event_get()? | TOOK::GUERTIN | Don't fight fire with flames | Wed Aug 21 1991 13:40 | 5 |
| This sounds like what happens when someone calls mcc_event_get() with
an event code of zero in the first argument. What does your
mcc_event_get() call look like?
-Matt.
|
1360.9 | did you apply the patch in 1267.2? | TOOK::GUERTIN | Don't fight fire with flames | Wed Aug 21 1991 13:43 | 1 |
|
|
1360.10 | no event_get-call! | STKHLM::BERGGREN | Nils Berggren EIS/Project dpmt, Sweden DTN 876-8287 | Wed Aug 21 1991 14:41 | 4 |
| repl .8
there's no event_get call done, which means that I should get
the return-code for "no event requests outstanding" from mcc_event_put.
|
1360.11 | patch applied soon.... | STKHLM::BERGGREN | Nils Berggren EIS/Project dpmt, Sweden DTN 876-8287 | Wed Aug 21 1991 14:44 | 6 |
| repl .9
nope, I missed that one. I'll do now, and post the results.
Thanks!
|
1360.12 | Everything works fine for me, now. | TOOK::GUERTIN | Don't fight fire with flames | Wed Aug 21 1991 14:59 | 5 |
| I just realized that I forgot mcc_kernel_init.obj. After linking with
it, I get no errors. Check if you have ANY processes still running on
the system using MCC, and exit them before testing.
-Matt.
|
1360.13 | everything works fine for me too, now | STKHLM::BERGGREN | Nils Berggren EIS/Project dpmt, Sweden DTN 876-8287 | Mon Aug 26 1991 16:43 | 9 |
| I tried to apply the patch but got the acc-vio anyway.
Then, after going crazy for a while, I reinstalled MCCBMS and applied
the kernel-patch as well as the alarms-patch. Also I reregistered my
AM and now everything works fine.
No problems any more...
/Nils
|