cppalliance / mrdocs

MrDocs: A Clang/LLVM tool for building reference documentation from C++ code and javadoc comments.
https://mrdocs.com
Other
66 stars 16 forks source link

SegFault when processing empty Translation Units (TU) #626

Closed fpelliccioni closed 6 days ago

fpelliccioni commented 2 weeks ago

Problem Description When running tests in the test-files/old-tests/ directory with an empty file (or a file with only blank lines), the program crashes with a Segmentation Fault (SegFault).

Steps to Reproduce

  1. Go to the test-files/old-tests/ directory.
  2. Create a file named empty.cpp that is empty or contains only blank lines.
  3. Run the tests using the appropriate command.

Expected Behavior The tests should handle empty files without crashing.

Observed Behavior The program crashes with a Segmentation Fault (SegFault).

Error Backtrace

Test project /home/fernando/dev/cppalliance/mrdocs-upstream/build
2/2 Test #1: mrdocs-test2/2 Test #1: mrdocs-test.......................***Exception: SegFault  0.20 sec
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  mrdocs-test 0x0000000002e30afb
1  mrdocs-test 0x0000000002e2e0eb
2  libc.so.6   0x00007f8dc5970710
3  mrdocs-test 0x000000000071a97d
4  mrdocs-test 0x000000000071aba2
5  mrdocs-test 0x000000000070919a
6  mrdocs-test 0x000000000063ce02
7  mrdocs-test 0x00000000004edac7
8  mrdocs-test 0x00000000004f1175
9  mrdocs-test 0x00000000004e9e9b
10 mrdocs-test 0x00000000004f062a
11 mrdocs-test 0x00000000004e58c0
12 mrdocs-test 0x00000000004e6313
13 mrdocs-test 0x0000000000458d49
14 libc.so.6   0x00007f8dc595a088
15 libc.so.6   0x00007f8dc595a14b __libc_start_main + 139
16 mrdocs-test 0x00000000004a3d45