DynamoRIO / DynamoRIO/dynamorio

Printing twice in simple test w/ fork & drrun, only reproducible w/ ctest

Open
#3,239 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 18h
Merged PRs (30d)
30

Description

With attached patch, when running the example test as follows, I am getting

```
~/dynamorio/build$ /usr/local/google/home/hgreving/dynamorio/build/suite/tests/bin/linux.epoll_pwait_bug
was here
```

With drrun alone

```
~/dynamorio/build$ /usr/local/google/home/hgreving/dynamorio/build/suite/tests/bin/linux.epoll_pwait_bug
was here
hgreving@hendrik-desktop:~/dynamorio/build$ /usr/local/google/home/hgreving/dynamorio/build/bin64/drrun -- /usr/local/google/home/hgreving/dynamorio/build/suite/tests/bin/linux.epoll_pwait_bug

<(1+x) Handling our fault in a TRY at 0x00007fb2816b7f11>

was here
<-- parent 144453 forked child 144454 -->

hgreving@hendrik-desktop:~/dynamorio/build$
```

With ctest

```
~/dynamorio/build$ ctest -V -I 67,67
UpdateCTestConfiguration from :/usr/local/google/home/hgreving/dynamorio/build/DartConfiguration.tcl
Parse Config file:/usr/local/google/home/hgreving/dynamorio/build/DartConfiguration.tcl
UpdateCTestConfiguration from :/usr/local/google/home/hgreving/dynamorio/build/DartConfiguration.tcl
Parse Config file:/usr/local/google/home/hgreving/dynamorio/build/DartConfiguration.tcl
Test project /usr/local/google/home/hgreving/dynamorio/build
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 67
Start 67: code_api|linux.epoll_pwait_bug

67: Test command: /usr/local/google/home/hgreving/dynamorio/build/bin64/drrun "-s" "90" "-quiet" "-debug" "-killpg" "-stderr_mask" "0xC" "-dumpcore_mask" "0" "-code_api" "--" "/usr/local/google/home/hgreving/dynamorio/build/suite/tests/bin/linux.epoll_pwait_bug"
67: Test timeout computed to be: 1500
67: was here
67: was here
```

[..]

Note the duplicated "was here". Some process/buffering/race issue? Hasn't been investigated further

[0001-Reproducer-for-double-printf-w-fork.patch.tar.gz](https://github.com/DynamoRIO/dynamorio/files/2512532/0001-Reproducer-for-double-printf-w-fork.patch.tar.gz)

Contributor guide

Open the contributing guide

Research direction

Start with the attached 0001-Reproducer-for-double-printf-w-fork.patch.tar.gz and reproduce test 67 using ctest -V -I 67,67. Compare that output with the direct binary and drrun commands shown in the report; done means the forked example no longer prints "was here" twice under ctest.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
operating-systems, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.