Skip to content

Commit

Permalink
Fix an incorrect check in the recovery router
Browse files Browse the repository at this point in the history
The recovery facility might erroneously free the state cell-pool if an
ABEND occurs right after the ESTAEX has been set but before any recovery
states with the retry option have been pushed; this issued is caused
by an incorrectly coded check in the recovery router code (the check is
inverted).

The commit fixes the incorrect instruction and adds some code to leave
"bread crumbs" when the state cell-pool is deleted.

Fixes: #446
Signed-off-by: Irek Fakhrutdinov <[email protected]>
  • Loading branch information
ifakhrutdinov committed May 22, 2024
1 parent 292082a commit 1ecbdb4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## `2.17.0`
- Fixed `xplatform.loadFileUTF8` when trying to open nonexistent file (#454)
- Bugfix: fix an incorrect check in the recovery router code which might lead to
the state cell-pool being released prematurely (#446)

## `2.16.0`
- No yaml value converted to null (#442)
Expand Down
6 changes: 5 additions & 1 deletion c/recovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,14 +497,16 @@ static void * __ptr32 getRecoveryRouterAddress() {
" LA 1,RCVXINF LOAD ROUTER SERVICE INFO \n"
" BRAS 14,RCVSIFLB RECORD IT, REMOVE CONTEXT, PERCOLATE \n"
" TM RCXFLAG1,R@CF1USP USER STATE POOL? \n"
" BZ RCVFRL04 NO, DO NOT FREE IT \n"
" BNZ RCVFRL04 NO, DO NOT FREE IT \n"
" LT 2,RCXSCPID CELL POOL ZERO? \n"
" BZ RCVFRL04 YES, DO NOT FREE IT \n"
#ifdef _LP64
" SAM31 \n"
" SYSSTATE AMODE64=NO \n"
#endif
" CPOOL DELETE,CPID=(2) FREE THE STATE CELL POOL \n"
" LGFI 2,X'7FFFFBA3' MAKE AN OBVIOUSLY BAD ADDRESS \n"
" ST 2,RCXSCPID MARK THE CPID FOR DEBUGGING PURPOSES \n"
#ifdef _LP64
" SAM64 \n"
" SYSSTATE AMODE64=YES \n"
Expand Down Expand Up @@ -1291,6 +1293,8 @@ RecoveryStatePool *recoveryMakeStatePool(unsigned int stateCount) {

void recoveryRemoveStatePool(RecoveryStatePool *statePool) {
removeRecoveryStatePool(statePool->cellPool);
// put a bad address for debugging (in case the statePool storage survives)
statePool->cellPool = 0x7FFFFBA1;
storageRelease(statePool, sizeof(RecoveryStatePool));
}

Expand Down

0 comments on commit 1ecbdb4

Please sign in to comment.