NAME
bpcrash_hard - Bundle Protocol transaction crash test utility (with SDR modification)
SYNOPSIS
bpcrash_hard
DESCRIPTION
bpcrash_hard is an enhanced test utility that forces a Bundle Protocol transaction to be cancelled after the SDR has been modified. This ensures that transaction reversal logic is properly exercised in ION 4.1.3 and later versions.
Unlike the original bpcrash utility, bpcrash_hard explicitly modifies the SDR by allocating space and writing data before cancelling the transaction. This guarantees that the "sdr->modified" flag is set, which is required to trigger transaction reversal in ION 4.1.3+.
The utility performs the following steps:
- Attaches to Bundle Protocol
- Begins an SDR transaction
- Allocates 10,000 bytes in the SDR
- Writes test data to the allocated space (marks transaction as modified)
- Cancels the transaction, triggering reversal
- Waits briefly for ionrestart to execute (if configured)
When the transaction is cancelled with modifications present, ION will:
- Log "Attempting transaction reversal..." message
- Execute the reversal process to roll back SDR changes
- Execute the restartCmd (typically ionrestart) if configured
- Halt the SDR to allow restart utility to reinitialize volatile state
EXIT STATUS
-
0Transaction successfully created and cancelled.
-
1bpcrash_hard was unable to attach to Bundle Protocol or allocate SDR space.
USAGE
bpcrash_hard is typically used in automated tests of ION's transaction reversibility mechanisms. It is run while ION is operational to simulate a crash condition that requires transaction reversal.
Example test sequence:
# Start ION
ionstart
# Run bpcrash_hard to trigger reversal
bpcrash_hard
# Verify ionrestart executed
# Check for "Attempting transaction reversal" in ion.log
# Restart daemons manually if needed
ionadmin restart.ionrc
bpadmin restart.bprc
# Verify system recovered
bpdriver 10 ipn:1.1 ipn:2.1 -100
FILES
No configuration files are required.
ENVIRONMENT
No environment variables apply.
DIAGNOSTICS
The following diagnostics may be issued to the ion.log log file:
-
bpcrash_hard: Can't attach to BP.
Bundle Protocol functionality was not initialized. Run ionadmin first.
-
bpcrash_hard: Can't allocate SDR space.
Insufficient SDR heap space available. This is unexpected and indicates a severely constrained or corrupted SDR.
-
bpcrash_hard: Forcing transaction cancellation with modifications.
Normal output indicating the transaction is being cancelled after SDR modifications were made.
-
bpcrash_hard: Transaction aborted.
Normal output confirming transaction cancellation.
-
Attempting transaction reversal...
Expected message from SDR library indicating reversal is being performed.
BUGS
Report bugs to <https://github.com/nasa-jpl/ION-DTN/issues>
SEE ALSO
bpadmin(1), bpcrash(1), ionadmin(1), ionrestart(1), sdrmend(1), sdr(3)