AdaptiveCpp / AdaptiveCpp/AdaptiveCpp

dump_test fails assertion and crashes

Aperta
#1,252 0 commenti 0 reazioni 1 assegnatario Rivendicata da @normallytangent Vedi su GitHub
bug
Lingua principale
C++
Stelle
1.9k
Fork
228
Merge medio
4g 1h
PR unite (30g)
25

Descrizione

**Bug summary**
A clear and concise description of what the problem is.

**To Reproduce**

```console
~/AdaptiveCpp/build$ cmake .. -DCMAKE_C_COMPILER=clang-17 -DCMAKE_CXX_COMPILER=clang++-17 -DLLVM_DIR=/usr/lib/llvm-17/cmake/ -DCMAKE_INSTALL_PREFIX=$HOME/local/ && make && make install
...
~/AdaptiveCpp/build$ cd ../tests/build
~/AdaptiveCpp/tests/build$ cmake .. -DCMAKE_C_COMPILER=clang-17 -DCMAKE_CXX_COMPILER=clang++-17 -DACPP_TARGETS=hip:gfx1034 -DCMAKE_BUILD_TYPE=Release && make
....
~/AdaptiveCpp/tests/build$ ./dump_test/dump_test
Dumping memory requirement buffers:

MEM_REQ: RW device {10, 0, 0}+{100, 0, 0} #10MEM_REQ: R device {5, 0, 0}+{100, 0, 0} #10
Dumping Kernel Operation:

kernel: test_kernel
Dumping memory location

Memcpy: -Device32591 #10 {1, 1, 1}+{10, 0, 0}-->-Device32591 #10 {2, 2, 2}+{10, 0, 0}{100, 0, 0}Dumping entire DAG:

Node 0x5607ca7937e0
kernel: test_kernel Has requirement on: NoneNode 0x5607cb6219a0
kernel: test_kernel Has requirement on: 0x5607ca7937e0 0x5607cb602100 Node 0x5607ca0c2160
kernel: test_kernel Has requirement on: 0x5607cb6219a0 0x5607ca7937e0 Node 0x5607cb602100
Memcpy: -Device32591 #10 {1, 1, 1}+{10, 0, 0}-->-Device32591 #10 {2, 2, 2}+{10, 0, 0}{100, 0, 0} Has requirement on: 0x5607ca7937e0 ***End of dumping tests***
free(): invalid pointer
Aborted (core dumped)
```

Looks like `buffer_data_region` does not work well with 0-ranges

https://github.com/AdaptiveCpp/AdaptiveCpp/blob/306c36b104189a0b016d628781042f6e04543d0a/tests/dump_test/dump_test.cpp#L26-L27

At least, it violates the assertion in the ctor (this assertion is not triggered in the Release build shown above, which crashes later in the destructor):

https://github.com/AdaptiveCpp/AdaptiveCpp/blob/306c36b104189a0b016d628781042f6e04543d0a/include/hipSYCL/runtime/data.hpp#L414-L415

**Expected behavior**

The does does not crash.

**Describe your setup**
* how you have installed AdaptiveCpp, and which version/branch/git commit
* Describe the dependencies that AdaptiveCpp sits on top of in your setup:
* Ubuntu clang version 17.0.6 (++20231120125949+f8575ff46f89-1~exp1~20231120130005.68)
* CUDA 12.3
* ROCm 5.7.0

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.