Need assistance understand a bugcheck callstack - crash

So, I have a Windows program that is behaving badly. The callstack at the time of the error is:
0: kd> kn
# Child-SP RetAddr Call Site
00 9a6c3548 815a6c20 nt!KiPollFreezeExecution+0x8
01 9a6c3558 815a6d24 nt!KeBugCheck2+0x61c
02 9a6c3820 8153955c nt!KeBugCheckEx+0x14
03 9a6c3838 8147b30c nt!MY_READ_REGISTER_UCHAR+0x4590
04 9a6c3898 8141de0e nt!KeClockInterruptNotify+0x300
05 9a6c3910 8147ed26 hal!HalSetRealTimeClock+0x367e
06 9a6c3930 814dcc76 nt!KiPlayInterrupt+0x5d6
07 9a6c39f0 8145f086 nt!KiProcessInterrupt+0x17e
08 9a6c3a40 814bbe18 nt!KiInterruptException+0x126
09 9a6c3be0 814acb3a nt!KeSweepIcache+0x40
0a 9a6c3bf8 814ae742 nt!KeSweepIcacheRange+0x6e
0b 9a6c3c08 8149173c nt!MiWaitForInPageComplete+0x206
0c 9a6c3c78 8147bdb8 nt!MiIssueHardFault+0x270
0d 9a6c3cc0 8145ed08 nt!MmAccessFault+0x634
0e 9a6c3d40 6edf9920 nt!KiCommonMemoryManagementAbort+0xcc
0f 0295f4c8 6edec79a MyDriver!Bar+0x8a0
10 0295f4c8 00000000 MyDriver!Foo+0xfea
In the beginning, this makes sense. I have a page fault and try to load the page.
09 9a6c3be0 814acb3a nt!KeSweepIcache+0x40
0a 9a6c3bf8 814ae742 nt!KeSweepIcacheRange+0x6e
0b 9a6c3c08 8149173c nt!MiWaitForInPageComplete+0x206
0c 9a6c3c78 8147bdb8 nt!MiIssueHardFault+0x270
0d 9a6c3cc0 8145ed08 nt!MmAccessFault+0x634
0e 9a6c3d40 6edf9920 nt!KiCommonMemoryManagementAbort+0xcc
But, then it gets in to some interrupt handling. What's going on here?
06 9a6c3930 814dcc76 nt!KiPlayInterrupt+0x5d6
07 9a6c39f0 8145f086 nt!KiProcessInterrupt+0x17e
08 9a6c3a40 814bbe18 nt!KiInterruptException+0x126
Next we mess with the RTC?! Why?
04 9a6c3898 8141de0e nt!KeClockInterruptNotify+0x300
05 9a6c3910 8147ed26 hal!HalSetRealTimeClock+0x367e
And a bugcheck in MY_READ_REGISTER_UCHAR+0x4590? That's way far away from this tiny little function.
01 9a6c3558 815a6d24 nt!KeBugCheck2+0x61c
02 9a6c3820 8153955c nt!KeBugCheckEx+0x14
03 9a6c3838 8147b30c nt!MY_READ_REGISTER_UCHAR+0x4590
0: kd> uf nt!MY_READ_REGISTER_UCHAR
nt!MY_READ_REGISTER_UCHAR:
81534fcc e92d4800 push {r11,lr}
81534fd0 46eb mov r11,sp
81534fd2 f3bf8f4f dsb
81534fd6 7800 ldrb r0,[r0]
81534fd8 e8bd8800 pop {r11,pc}
Can anybody provide some insight in to what I'm seeing here?

Related

How to solve 'NO SPOOL' response in submitting a JCL to INTRDR from CICS?

I am practicing some CICS programming and I want to submit a job from CICS program by using spool commands. However, I get the 'NO SPOOL' return which the IBM documentation says:
80 NOSPOOL
No subsystem present.
Interface being disabled; CICS is quiescing.
Interface has been stopped.
I don't know what changes I need to make to correct this. attached below is the sample of the code I made:
IDENTIFICATION DIVISION.
PROGRAM-ID. GDGTEST
*
ENVIRONMENT DIVISION.
*
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-MSG-TEXT PIC X(56).
01 WS-MSG-LENGTH PIC S9(4) COMP VALUE 60.
01 WS-SUBMIT-MSG PIC X(56)
VALUE 'GDG BACKUP STARTED'.
01 WS-END-MSG PIC X(56)
VALUE 'BACK UP SUCCESSFULLY CREATED'.
01 WS-ERROR-MSG PIC X(56)
VALUE 'GDG BACKUP FAILED'.
01 WS-SPOOL-OPTIONS.
05 WS-TOKEN PIC X(8) VALUE LOW-VALUES.
05 WS-NODE PIC X(8) VALUE 'IBMUSER'.
05 WS-USERID PIC X(8) VALUE 'INTRDR'.
05 WS-CLASS PIC X VALUE 'A'.
05 WS-RESP PIC X(4).
05 WS-RESP2 PIC X(4).
01 WS-JCL-TXT PIC X(80).
01 WS-JOB.
05 FILLER PIC X(56) VALUE
'//GDGBCKUP JOB CLASS=A,MSGCLASS=H,MSGLEVEL=(1,1), '.
05 FILLER PIC X(56) VALUE
'// REGION=2048K,NOTIFY=&SYSUID '.
05 FILLER PIC X(56) VALUE
'//STEP1 EXEC PGM=IEBGENER '.
05 FILLER PIC X(56) VALUE
'//SYSPRINT DD SYSOUT=* '.
05 FILLER PIC X(56) VALUE
'//SYSUT1 DD DSN=IBMUSER.TEST.CASACONS.MONTHREP, '.
05 FILLER PIC X(56) VALUE
'// DISP=SHR '.
05 FILLER PIC X(56) VALUE
'//SYSUT2 DD DSN=IBMUSER.TEST.MONTHREP.BACKUP(+1), '.
05 FILLER PIC X(56) VALUE
'// DISP=(NEW,CATLG,DELETE), '.
05 FILLER PIC X(56) VALUE
'// UNIT=3390,SPACE=(TRK,4), '.
05 FILLER PIC X(56) VALUE
'// DCB=(LRECL=81,BLKSIZE=81,RECFM=FBA,DSORG=PS) '.
05 FILLER PIC X(56) VALUE
'//SYSIN DD DUMMY '.
05 FILLER PIC X(56) VALUE
'//SYSOUT DD SYSOUT=* '.
05 FILLER PIC X(56) VALUE
'//SYSUDUMP DD SYSOUT=* '.
05 FILLER PIC X(56) VALUE
'// '.
01 WX-1 PIC 9(5) VALUE 0.
*
PROCEDURE DIVISION.
0000-MAIN.
MOVE WS-SUBMIT-MSG TO WS-MSG-TEXT.
PERFORM 0200-SEND-MSG-TEXT.
IF EIBRESP NOT = DFHRESP(NORMAL)
MOVE WS-ERROR-MSG TO WS-MSG-TEXT
PERFORM 0200-SEND-MSG-TEXT
PERFORM 9999-RETURN-CICS
ELSE
PERFORM 0300-SPOOL-OPEN
ADD 1 TO ZERO GIVING WX-1
PERFORM 14 TIMES
MOVE WS-JOB(WX-1:56) TO WS-JCL-TXT
PERFORM 0400-SPOOL-WRITE
ADD 56 TO WX-1
END-PERFORM
PERFORM 0500-SPOOL-CLOSE
END-IF.
MOVE WS-END-MSG TO WS-MSG-TEXT.
PERFORM 0200-SEND-MSG-TEXT.
PERFORM 9999-RETURN-CICS.
*
0200-SEND-MSG-TEXT.
EXEC CICS SEND TEXT
FROM(WS-MSG-TEXT)
LENGTH(WS-MSG-LENGTH)
ERASE
FREEKB
END-EXEC.
*
0300-SPOOL-OPEN.
EXEC CICS SPOOLOPEN OUTPUT
TOKEN(WS-TOKEN)
USERID(WS-USERID)
NODE(WS-NODE)
CLASS(WS-CLASS)
RESP(WS-RESP)
RESP2(WS-RESP2)
END-EXEC.
*
0400-SPOOL-WRITE.
EXEC CICS SPOOLWRITE
TOKEN (WS-TOKEN)
FROM (WS-JCL-TXT)
RESP (WS-RESP)
RESP2 (WS-RESP2)
END-EXEC.
*
0500-SPOOL-CLOSE.
EXEC CICS SPOOLCLOSE
TOKEN (WS-TOKEN)
RESP (WS-RESP)
RESP2 (WS-RESP2)
END-EXEC.
*
9999-RETURN-CICS.
EXEC CICS RETURN END-EXEC.
I have a feeling the problem lies on what I specified in NODE and USER-ID options of the SPOOLOPEN OUTPUT commands. I appreciate your help. Thank you.

How we can search structures recursively for a variable value under windbg using script

can we write a script searching for a particular value under structures recursively?
One manually way (and time taking) I can think of is to create a log file with the "dt -r " and searching it manually.
what do you mean by searching for a value recursively ?
dt -r follows structures within structures and as such their Address will not be contiguous
you can use a the simple s command t osearch within a limited space like this
kd> r? $t0 = sizeof(nt!_EPROCESS)
kd> ? #$t0
Evaluate expression: 704 = 000002c0
kd> r? $t1 = ##masm(#$proc)
kd> ? #$t1
Evaluate expression: -2063606960 = 84ffdb50
kd> $$ #$proc is pointer to current process in kernel mode
let us search for char 'k' within this range
kd> s -b #$t1 l?#$t0 'k'
84ffdcbc 6b 64 2e 65 78 65 00 00-00 00 00 00 00 00 00 02 kd.exe..........
kd> dt nt!_EPROCESS ImageFileName #$proc
+0x16c ImageFileName : [15] "kd.exe"
kd> ? #$t1+0x16c
Evaluate expression: -2063606596 = 84ffdcbc
kd>

COBOL File I/O Formatting

As the title may indicate, I am having some difficulty getting the desired output for my COBOL program. The program takes in data from a file and outputs in a specific format, this is for a homework assignment. When i run the program it works for the name header, schoolID header, and column header. The first course works fine then the output starts to cut off by one and messes up all my other outputs.
Input File example
CMPS161 ALGORITHM DSGN/IMPLMNT I A 3.00
CMPS280 ALGORITHM DSGN/IMPLEM II B 3.00
Output file desired example
<Name>
<schoolID>
Course Title GR Earned
CMPS161 ALGORITHM DSGN/IMPLMNT I A 3.00
CMPS280 ALGORITHM DSGN/IMPLEM II B 3.00
Output actual example
<Name>
<schoolID>
Course Title GR Earned
CMPS161 ALGORITHM DSGN/IMPLMNT I A 0.00
MPS280 ALGORITHM DSGN/IMPLEM II B 0.00
COBOL Project
IDENTIFICATION DIVISION.
PROGRAM-ID. P2.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT myInFile ASSIGN TO "P2In.dat".
SELECT myOutFile ASSIGN TO "P2Out.dat".
DATA DIVISION.
FILE SECTION.
FD myInFile.
01 inRecord.
02 Course PIC X(13).
02 Title PIC X(32).
02 Grade PIC X(4).
02 Earned PIC Z9.99.
02 FILLER PIC X(3).
FD myOutFile.
01 outRecord.
02 myCourse PIC X(13).
02 myTitle PIC X(32).
02 myGrade PIC X(4).
02 myEarned PIC Z9.99.
02 FILLER PIC X(3).
WORKING-STORAGE SECTION.
01 E0F PIC X(3) VALUE "NO ".
01 NAME-HDR.
05 FILLER PIC X(10) VALUE "NAME HERE ".
01 SCHOOLID-HDR.
05 FILLER PIC X(8) VALUE "SCHOOLID"
01 COLUMN-HDR.
05 FILLER PIC X(6) VALUE "COURSE".
05 FILLER PIC X(6) VALUE SPACES.
05 FILLER PIC X(6) VALUE "TITLE".
05 FILLER PIC X(6) VALUE SPACES.
05 FILLER PIC X(6) VALUE "GR".
05 FILLER PIC X(6) VALUE SPACES.
05 FILLER PIC X(6) VALUE "EARNED".
PROCEDURE DIVISION.
MAIN-PROGRAM.
PERFORM HEADER.
PERFORM FILE-IO.
PERFORM CLOSING.
STOP RUN.
HEADER.
OPEN INPUT myInFile
OUTPUT myOutFile.
WRITE outRecord FROM NAME-HDR
AFTER ADVANCING 1 LINE.
WRITE outRecord FROM SCHOOLID-HDR
AFTER ADVANCING 1 LINE.
WRITE outRecord FROM COLUMN-HDR
AFTER ADVANCING 2 LINES.
MOVE SPACES TO outRecord.
WRITE outRecord
AFTER ADVANCING 1 LINE.
FILE-IO.
READ myInFile
AT END
MOVE "YES" TO EOF.
PERFORM PROCESS-RECORD
UNTIL EOF = "YES".
PROCESS-RECORD.
MOVE SPACES TO outRecord.
MOVE Course to myCourse.
MOVE Title to myTitle.
MOVE Grade to myGrade.
MOVE Earned to myEarned.
WRITE outRecord
AFTER ADVANCING 1 LINE.
READ myInFile
AT END
MOVE "YES" TO EOF.
CLOSING.
CLOSE myInFile
myOutFile.
My COBOL is very rusty but I don't think that 'Z' in input formats will work. Leading zero suppression is just for output formats. You may simply have to replace leading spaces with zeroes before you do anything with the data. Try something like:
INSPECT Earned REPLACING ALL SPACES BY '0'.
after the read (and change the input format to 99.99). It's a common problem but I can't remember how I used to deal with it.

wrong output when decoding base64 string

i seem to always get incorrect output when decoding this base64 string in vb.net ( i think its base64? it really looks like it )
im using the frombase64string function
and i did it like this
Dim b64str = "0DDQQL3uAikQBgAAc4cqK4WnSQBg4SAgExEAAF3BAmAILYojRgkBhUrBAgEDRw=="
Dim i As String = System.Text.Encoding.Unicode.GetString(Convert.FromBase64String(b64str))
MsgBox(i)
but i always get this output
バ䃐⤂ؐ
that doesn't seem right
0DDQQL3uAikQBgAAc4cqK4WnSQBg4SAgExEAAF3BAmAILYojRgkBhUrBAgEDRw==
It looks like Base64, the length is a correct size, the characters belong to the Base64 character set and the trailing "==" is reasonable. Of course it might not be a Base64 encoding.
Base64 decoding results in:
D0 30 D0 40 BD EE 02 29 10 06 00 00 73 87 2A 2B 85 A7 49 00 60 E1 20 20 13 11 00 00 5D C1 02 60 08 2D 8A 23 46 09 01 85 4A C1 02 01 03 47
Now the problem, this is not a character string, it is an array of 8-bit bytes. Thus it can not be displayed as characters. The 0x00 bytes will signal the end of a string to the print method and the no-representable characters may be ignored, displayed with special characters or multiple bytes may display as must-byte unicode characters. The only guaranteed and usual display is in hexadecimal as above.
That String can be virtually anything. It might be the result of an encryption algorithm, like sha*. Your mistake is that you assume that it must be base64 because it might be.
It is a valid observation that it might be base64, so it was a perfectly valid thing to run that function, but it is you who has to determine whether based on the results it is base64 or something else, based on particular logic, which was not described in the question.

Need help with a syntax error (COBOL)

I am working on my last homework assignment for COBOL this semester and I am being hit with a syntax error that is stopping my progress cold. Here is what I got:
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT USED-CAR-FILE-OUT
ASSIGN TO 'USED-CAR.RPT'
ORGANIZATION IS LINE SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD USED-CAR-FILE-OUT.
01 USED-CAR-RECORD-OUT PIC X(80).
WORKING-STORAGE SECTION.
01 ID-CODE PIC X(3).
01 TOTAL-CASH-PAYMENT PIC 9(5).
01 MONTHLY-PAYMENT PIC 9(4).
01 NUMBER-OF-MONTHS PIC 9(3).
01 BALANCE-TOTAL PIC S9(6)V99 VALUE ZEROS.
01 INTEREST-EARNED PIC S99V99 VALUE ZEROS.
01 COMPARE-MONTH PIC 99 VALUE ZEROS.
01 YEAR-NUMBER PIC 99 VALUE ZEROS.
01 MONTH-NUMBER PIC 99 VALUE ZEROS.
01 DETAIL-LINE.
05 ID-CODE-DL PIC X(3).
05 PIC X(3) VALUE SPACES.
05 PIC X(4) VALUE 'Yr='.
05 YEAR-NUMBER-DL PIC Z9 VALUE ZEROS.
05 PIC X(4) VALUE SPACES.
05 PIC X(4) VALUE 'Mo='.
05 MONTH-NUMBER-DL PIC Z9.
05 PIC X(4) VALUE SPACES.
05 PIC X(5) VALUE 'Pmt='.
05 PAYMENT-DL PIC $$$,$$$.
05 PIC X(4) VALUE SPACES.
05 PIC X(5) VALUE 'Int='.
05 INTEREST-EARNED-DL PIC $$$$.99.
05 PIC X(3) VALUE SPACES.
05 PIC X(5) VALUE 'Bal='.
05 BALANCE-DL PIC $$$,$$$.99.
PROCEDURE DIVISION.
100-MAIN.
OPEN OUTPUT USED-CAR-FILE-OUT
PERFORM 200-INPUT THRU 299-EXIT
CLOSE USED-CAR-FILE-OUT
STOP RUN.
200-INPUT.
DISPLAY 'Used Car Sales Report'
DISPLAY 'Enter the ID Code (or END) - maximum three char.'
ACCEPT ID-CODE
IF ID-CODE = 'END'
GO TO 299-EXIT
END-IF
DISPLAY 'Enter the Total Cash Payment - maximum five digits'
ACCEPT TOTAL-CASH-PAYMENT
DISPLAY 'Enter the Monthly Payment - maximum four digits'
ACCEPT MONTHLY-PAYMENT
DISPLAY 'Enter the Number of Months - maximum three digits'
ACCEPT NUMBER-OF-MONTHS
PERFORM 300-PROCESS.
299-EXIT.
EXIT.
300-PROCESS.
IF TOTAL-CASH-PAYMENT > 0
MOVE TOTAL-CASH-PAYMENT TO PAYMENT-DL
END-IF
IF MONTHLY-PAYMENT > 0
MOVE MONTHLY-PAYMENT TO PAYMENT-DL
END-IF
ADD PAYMENT-DL TO BALANCE-TOTAL
COMPUTE INTEREST-EARNED ROUNDED = .0175 / BALANCE-TOTAL
ADD INTEREST-EARNED TO BALANCE-TOTAL
MOVE BALANCE-TOTAL TO BALANCE-DL
ADD 1 TO COMPARE-MONTH
IF MONTH-NUMBER-DL > 13
ADD 1 TO MONTH-NUMBER
MOVE MONTH-NUMBER TO MONTH-NUMBER-DL
END-IF
IF MONTH-NUMBER-DL = 13
MOVE 1 TO MONTH-NUMBER
MOVE MONTH-NUMBER TO MONTH-NUMBER-DL
END-IF
IF MONTH-NUMBER = 1
ADD 1 TO YEAR-NUMBER
MOVE YEAR-NUMBER TO YEAR-NUMBER-DL
END-IF
MOVE DETAIL-LINE TO USED-CAR-RECORD-OUT
WRITE USED-CAR-RECORD-OUT
AFTER ADVANCING 1 LINE
IF TOTAL-CASH-PAYMENT > 0
MOVE 0 TO TOTAL-CASH-PAYMENT
MOVE 0 TO PAYMENT-DL
END-IF
IF COMPARE-MONTH > NUMBER-OF-MONTHS
PERFORM 300-PROCESS
END-IF
The problem is with PAYMENT-DL, INTEREST-EARNED-DL and BALANCE-DL. It says that an illegal character, but I know that it should work as it shows those pic clauses in my book and the teacher handed out an incomplete version of the program that I have to write. What do I have to do to get rid of those errors?
The invalid character is the "$" sign.
This should be OK, but your compiler may have been customized to use a local currency symbol as the default.
You could switch to your local currency sign (if you know it!) or change it back to "$". Changing it back to "$" depends on which compiler you are using and how the defaults are set -- you really need to read the manual for your particular compiler to find out how this is done.