Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #158, Implement exception storage in PSP #159

Merged
merged 2 commits into from
May 8, 2020

Conversation

jphickey
Copy link
Contributor

Describe the contribution
Implements exception capture and storage within the PSP.
Provides a new API so that CFE can poll for exceptions at a later time and also record the information in the ER log.

Testing performed
Add a divide by zero "bug" to sample_app
Confirm that the PSP captures the exception context correctly and it is later logged by CFE
Confirm SIGINT, SIGQUIT, and SIGTERM are appropriately handled on POSIX

Expected behavior changes
Exception handling is now implemented on POSIX. The initial config will capture arithmetic errors (SIGFPE) as well as SIGINT and SIGTERM. The latter is notable in that there is no longer a separate handler for SIGINT - it is now treated as an exception and goes through the normal process which ends up "restarting" CFE, which on pc-linux causes the process to exit normally.

Importantly, as CTRL+C is frequently used during testing, this means that there is now a mechanism through which the exception code will get used during normal test cycles. Otherwise the code is very infrequently used and could suffer from bit-rot.

System(s) tested on
Ubuntu 20.04 LTS
VxWorks 6.9 on MCP750
i686-rtems4.11 (pc-rtems) on QEMU (no exception handling here, just tested to ensure nothing broke)

Additional context
Goes along with nasa/cFE#411, nasa/cFE#76

Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.

Implment exceptions for VxWorks and PC-Linux PSP

Exceptions are buffered in an extra block inside the PSP reserved area.

On pc-linux, the interrupt (CTRL+C) handling is also treated as
an exception, which shuts down the CFE normally.  This also means
processor resets on the pc-linux can be tested.
@jphickey jphickey force-pushed the fix-158-exceptions branch from 21b017b to fe5e019 Compare May 5, 2020 18:35
@jphickey jphickey marked this pull request as ready for review May 5, 2020 18:36
@jphickey
Copy link
Contributor Author

jphickey commented May 5, 2020

All components of this are now rebased. Ready for merge.
This was reviewed in a special topic on 2020-04-30.

@skliper
Copy link
Contributor

skliper commented May 5, 2020

Need to resolve CI failures

Comment on lines +387 to +394
start_addr = (cpuaddr) sysMemTop();
end_addr = start_addr;

memset(&CFE_PSP_ReservedMemoryMap, 0, sizeof(CFE_PSP_ReservedMemoryMap));

CFE_PSP_ReservedMemoryMap.BootPtr = (CFE_PSP_ReservedMemoryBootRecord_t *)end_addr;
end_addr += sizeof(CFE_PSP_ReservedMemoryBootRecord_t);
end_addr = (end_addr + CFE_PSP_MEMALIGN_MASK) & ~CFE_PSP_MEMALIGN_MASK;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you look into the routines Doyle suggested?

@skliper skliper added the CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) label May 6, 2020
@astrogeco
Copy link
Contributor

CCB 20200506 - Had special topic on April 30 2020. @acudmore will review later this week.

@astrogeco astrogeco added CCB-20200506 and removed CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) labels May 6, 2020
@astrogeco astrogeco changed the base branch from master to integration-candidate May 8, 2020 19:32
@astrogeco astrogeco added CCB:Approved Indicates Approval by CCB IC-20200429 labels May 8, 2020
@astrogeco astrogeco requested a review from a user May 8, 2020 19:33
@astrogeco astrogeco removed the CCB:Approved Indicates Approval by CCB label May 8, 2020
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement, and having the linux exception handling helps as well.
When I finally merge RTEMS 5.x changes in, I would like to implement the exception code for RTEMS and also explore concepts of saving the exception storage on boot, but that can be a separate effort.

@astrogeco astrogeco merged commit e6e247a into nasa:integration-candidate May 8, 2020
@jphickey jphickey deleted the fix-158-exceptions branch May 14, 2020 14:56
@skliper skliper added this to the 1.5.0 milestone Jun 1, 2020
@astrogeco astrogeco linked an issue Oct 1, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement exception logging/capture in PSP
3 participants