icpx hangs when compiling erroneous code
- Dominant language
- LLVM
- Stars
- 1.5k
- Forks
- 854
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 137
Description
### Describe the bug
Hi,
I found icpx to be hanging in an infinite loop, consuming more and more memory. I have to admit that I used AI to narrow it down to a manageable size and still be able to reproduce it. The hang happens with 2025.1.1, unfortunately at the moment I don't have time to reproduce it with newer compilers.
The code itself has errors, but icpx doesn't flag them. Instead it drops into an endless loop.
[BUG_REPORT.md](https://github.com/user-attachments/files/31354185/BUG_REPORT.md)
[repro_M10.cpp](https://github.com/user-attachments/files/31354191/repro_M10.cpp)
### To reproduce
1. Include a code snippet that is as short as possible
I attached the code. Snippet is probably too long to add here.
3. Specify the command which should be used to compile the program
e.g. icpx -std=c++17 -qopenmp -march=x86-64-v2 -O2 -g1 -fPIC -c repro_M10.cpp
4. Specify the command which should be used to launch the program
Launching is not the problem here.
5. Indicate what is wrong and what was expected
It should give an error message and not hang ;-)
### Environment
- OS: Linux (x86-64)
- Target device and vendor: AMD64
- DPC++ version: 2025.1.1.20250418
- Dependencies version: no dependencies
### Additional context
_No response_
Contributor guide
Research direction
Start by reading BUG_REPORT.md and repro_M10.cpp, then run the reported icpx 2025.1.1 command on Linux with the attached reproducer. Trace the compiler behavior around the hang and confirm that the erroneous input produces a diagnostic and terminates instead of looping or consuming unbounded memory.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100