Welcome to the Runtime Garbage Checked C Allocation Layer repository! This project offers a powerful tool to enhance memory management in C programs. It uses the LD_PRELOAD
method to interpose and wrap all malloc
-family calls. By embedding canary-guarded headers, it effectively catches double frees and buffer overflows. Additionally, it provides leak reporting at exit while ensuring thread and fork safety.
- Memory Management: Efficiently manage memory allocations and deallocations.
- Double-Free Detection: Identify and prevent double-free errors.
- Buffer Overflow Protection: Guard against buffer overflows with canary values.
- Leak Reporting: Automatically report memory leaks upon program exit.
- Thread and Fork Safety: Ensure safe operation in multi-threaded and forked environments.
To get started, clone the repository to your local machine:
git clone https://github.com/muromc13/Runtime-Garbage-Checked-C-Allocation-Layer.git
cd Runtime-Garbage-Checked-C-Allocation-Layer
Next, build the project:
make
You can now set the LD_PRELOAD
environment variable to use the interposer:
export LD_PRELOAD=./libmalloc_wrapper.so
To use the Runtime Garbage Checked C Allocation Layer, simply run your C program with the LD_PRELOAD
variable set. For example:
LD_PRELOAD=./libmalloc_wrapper.so ./your_program
This setup will ensure that all memory allocations in your_program
will be monitored for errors.
This project covers several important topics in memory management:
- Buffer Overflow Protection: Safeguards against unauthorized access to memory.
- C: The programming language this tool is built for.
- Double-Free Detection: Helps catch errors that can lead to crashes.
- Fork-Safe: Ensures safe operation in forked processes.
- Heap Sanitizer: Assists in identifying heap-related issues.
- LD_PRELOAD: A powerful method to interpose library calls.
- Malloc Wrapper: A wrapper around standard memory allocation functions.
- Memory Leak: Detects memory that is allocated but never freed.
- Memory Management: The overall practice of handling memory allocation and deallocation.
We welcome contributions to improve this project. To contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them.
- Push your branch to your forked repository.
- Create a pull request detailing your changes.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or feedback, feel free to reach out:
- Author: Your Name
- Email: your.email@example.com
You can find the latest releases of this project here. Please download and execute the files as needed.
We hope you find the Runtime Garbage Checked C Allocation Layer useful for your memory management needs. Your feedback is valuable to us as we strive to improve this tool further!