assimp / assimp/assimp

Bug: Memory Leak in ODDLParser During File Parsing

Open
#5,934 1 comment 0 reactions 0 assignees View on GitHub
Bug Fuzzer OpenGEX
Dominant language
C++
Stars
13.2k
Forks
3.2k
Avg merge
2d 8h
Merged PRs (30d)
21

Description

**Describe the bug**
A memory leak has been detected within the ODDLParser component of Assimp while parsing files. The leaks occur specifically in the parseName() and parseIdentifier() functions, leading to unreleased memory allocations, which accumulate over time and may impact application performance and stability.

**To Reproduce**
[Test_assimp_leak4.tar.gz](https://github.com/user-attachments/files/18210321/Test_assimp_leak4.tar.gz)
1. Download the tar.gz file and decompress it, then (sudo) execute shell script
2. ./Test_assimp_leak4 leak-0f894c6c4932ec1dfeb6f6bb9a3c0b14f3e71c06
3. Observe the error message

**Expected behavior**
When using the importer.ReadFileFromMemory() function, all memory allocated during the parsing process should be properly managed and freed upon completion to prevent memory leaks. Memory allocated for parsing nodes and names within ODDLParser should be appropriately released.

**Screenshots**
![image](https://github.com/user-attachments/assets/3d16f7dd-00f2-497b-a27b-52d1d764f4cc)

**Platform (please complete the following information):**
- OS: ubuntu

**Additional context**
The bug was identified during a fuzz testing session aimed at identifying potential stability and security issues.
The memory leaks may not cause immediate crashes but could lead to degraded performance in long-running applications or applications that load multiple models.
This issue may affect all users of the library who utilize the OpenGEX format and similar parsing routines.

Contributor guide

Open the contributing guide

Research direction

Start by unpacking Test_assimp_leak4.tar.gz and running the supplied shell script and reproducer on Ubuntu to confirm the leak. Then inspect ODDLParser, especially parseName() and parseIdentifier(), and trace allocations reached through ReadFileFromMemory(). Done means the reproducer no longer reports unreleased parsing memory after file processing.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.