-
Notifications
You must be signed in to change notification settings - Fork 5
libcoredumpsrv: introduction of coredumping #57
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @etiaro, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request introduces libcoredumpsrv, a new static library designed to provide coredump server functionality and configuration options. Its primary motivation is to enable coredumping on memory-constrained devices, similar to how posixsrv and dummyfs operate, by allowing it to be included as a static library. The library also exports necessary functions and constants for external configuration, such as via a psh applet.
Highlights
- Coredump Server Core Logic: Implements the central coredump mechanism, including ELF header generation, capturing process information (threads, memory segments, CPU contexts), and handling output to files or console.
- Configurable Coredump Options: Introduces various configuration parameters for the coredump server, such as maximum threads to dump, maximum stack size, memory scope (none, exception thread stack, all stacks, or all memory), floating-point context saving, print options, save path, and maximum number of coredump files.
- ELF Format Support: Provides structures and functions for generating coredumps in the ELF (Executable and Linkable Format) standard, supporting both 32-bit and 64-bit ELF classes, including program headers and note sections for process and thread information.
- Architecture-Specific HAL: Includes a Hardware Abstraction Layer (HAL) with implementations for multiple CPU architectures (AArch64, ARMv7-A, ARMv7-M, ARMv7-R, ARMv8-M, ARMv8-R, IA32, RISC-V 64-bit, SPARCv8 LEON) to correctly capture and format CPU-specific register contexts and FPU states for the coredump.
- Data Encoding Utilities: Integrates CRC32 and Base64 encoding functionalities, used for data integrity checks and efficient text-based output of binary coredump data.
- Kernel Communication Interface: Defines a communication protocol and functions for the coredump server to interact with the kernel, requesting crash information, thread contexts, and memory contents from the crashed process.
- Dynamic Configuration via Device: Allows runtime configuration of the coredump server settings through a dedicated device interface (/dev/coredumpctrl), enabling dynamic adjustments to coredump behavior.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a significant new feature: a coredump server library. The implementation is comprehensive, covering various CPU architectures and providing a flexible configuration mechanism. My review focuses on ensuring correctness, robustness, and proper memory management in this new, complex codebase. I've identified a few critical and high-severity issues related to potential crashes and memory leaks that should be addressed. Additionally, there are some medium-severity issues that would improve the code's correctness and clarity.
067f3d9 to
9503089
Compare
9503089 to
aa539d9
Compare
aa539d9 to
ccc4659
Compare
Introduces libcoredumpsrv which provides coredump server functionality and configuration options. Created as static library in order to allow including in -multi devices to save memory on chosen targets similar to posixsrv and dummyfs. Standard way of use is standalone executable provided in phoenix-rtos-utils. Exports functions and constants required for configuration eg. via psh applet. JIRA: RTOS-1054
ccc4659 to
1368e17
Compare
Description
Introduces libcoredumpsrv which provides coredump server functionality and configuration options.
JIRA: RTOS-1054
Motivation and Context
Created as static library in order to allow including in -multi devices to save memory on chosen targets similar to posixsrv and dummyfs.
Standard way of use is standalone executable provided in phoenix-rtos-utils.
Exports functions and constants required for configuration eg. via psh applet.
Types of changes
How Has This Been Tested?
Checklist:
Special treatment