DynamoRIO / DynamoRIO/dynamorio
ASSERT - drmemtrace does not create the required pipe file if it is not present (Linux AARCH64).
- Dominant language
- C
- Stars
- 3.2k
- Forks
- 629
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 31
Description
The drmemtrace client uses a pipe to write its trace data. The pipe file is opened in drmemtrace_client_main() using dr_open_file(). dr_open_file() should create the file if it does not exist, according to the comments in dr_tools.h. However in the scenario below os_open() in drlibc_unix.c does not specify the O_CREAT flag.
**To Reproduce**
```
git clone https://github.com/DynamoRIO/dynamorio.git && cd dynamorio
git submodule init
git submodule update
cd ..
mkdir dynamorio_build
cd dynamorio_build
cmake -DBUILD_TESTS=ON ../dynamorio
gcc --version
# gcc (Ubuntu 11.4.0-2ubuntu1~20.04) 11.4.0
make -j
rm /tmp/drcachesimpipe
bin64/drrun -c clients/lib64/release/libdrmemtrace.so -- ls
# ASSERT FAILURE: ../dynamorio/clients/drcachesim/tracer/tracer.cpp:2340: fd != -1 ()
touch /tmp/drcachesimpipe
bin64/drrun -c clients/lib64/release/libdrmemtrace.so -- ls
# Normal output
```
**Versions**
- What version of DynamoRIO are you using?
latest in master (commit e9d8864931fb3b6f21983c07f0aa17f38e8706ec)
- What operating system version are you running on? ("Windows 10" is *not* sufficient: give the release number.)
Ubuntu 20.04.6 LTS
- Is your application 32-bit or 64-bit?
64-bit
Contributor guide
Assessment
This issue has not been assessed yet.