Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drcachesim offline fails on fork child with error about file creation #5495

Closed
derekbruening opened this issue May 16, 2022 · 3 comments · Fixed by #5500
Closed

drcachesim offline fails on fork child with error about file creation #5495

derekbruening opened this issue May 16, 2022 · 3 comments · Fixed by #5500

Comments

@derekbruening
Copy link
Contributor

I first hit this tracing SPEC2017 perlbench.
I can reproduce it easily:

$ bin64/drrun -t drcachesim -offline -- suite/tests/bin/linux.fork
parent is running under DynamoRIO
<-- parent 564285 forked child 564286 -->
Failed to create new thread file for window ./drmemtrace.linux.fork.564286.0539.dir/raw/drmemtrace.linux.fork.564286.7156.raw.lz4
@derekbruening
Copy link
Contributor Author

Xref a malloc check issue with fork (maybe that would be hit after this error is fixed): https://groups.google.com/g/dynamorio-users/c/D0HTG6dDIsY

@derekbruening
Copy link
Contributor Author

I see two further issues with -satisfy_w_xor_x:

$ bin64/drrun -satisfy_w_xor_x -t drcachesim -verbose 2 -offline -- suite/tests/bin/linux.fork
Log directory is ./drmemtrace.linux.fork.610987.1941.dir/raw
Created thread trace file ./drmemtrace.linux.fork.610987.1941.dir/raw/drmemtrace.linux.fork.610987.0405.raw.lz4
<curiosity: rex.w on OPSZ_6_irex10_short4!>
<spurious rep/repne prefix @0x00007f3985f5a280 (f3 0f 1e fa): >
parent is running under DynamoRIO
<-- parent 610987 forked child 610988 -->
Log directory is ./drmemtrace.linux.fork.610988.1368.dir/raw
<CURIOSITY : !present && "stale fd not cleaned up" in file /home/bruening/dr/git/src/core/unix/os.c line 4179...>
Created thread trace file ./drmemtrace.linux.fork.610988.1368.dir/raw/drmemtrace.linux.fork.610988.5573.raw.lz4
parent waiting for child
child is running under DynamoRIO
<Stopping application /home/bruening/dr/git/build_x64_dbg_tests/suite/tests/bin/linux.fork (610988)>
drmemtrace exiting process 610988; traced 939577 references.
<Application /home/bruening/dr/git/build_x64_dbg_tests/suite/tests/bin/linux.fork (610988).  Internal Error: DynamoRIO debug check failure: /home/bruening/dr/git/src/core/utils.c:1566 !bitmap_test(b, first_block)
(Error occurred @3682 frags in tid 610988)...>

@derekbruening
Copy link
Contributor Author

The first is a failure to remove the dual_map_file from the protected fd table.

derekbruening added a commit that referenced this issue May 24, 2022
Fixes a bug where drcachesim -offline complained about an open file
across a fork.  This bug blocked tracing of SPECCPU perlbench.

Adds a new test of drcachesim -offline with an app that forks.  As is,
this matched the -satisfy_w_xor_x test regex, and I tried to make it
work with that option by fixing a file close bug here.  However, I did
not have time to figure out another bug which I filed as #5499.  I
thus tightened the "fork" regex to exclude this test from
-satisfy_w_xor_x.

Fixes #5495
derekbruening added a commit that referenced this issue May 25, 2022
Fixes a bug where drcachesim -offline complained about an open file
across a fork.  This bug blocked tracing of SPECCPU perlbench.

Adds a new test of drcachesim -offline with an app that forks.  As is,
this matched the -satisfy_w_xor_x test regex, and I tried to make it
work with that option by fixing a file close bug here.  However, I did
not have time to figure out another bug which I filed as #5499.  I
thus tightened the "fork" regex to exclude this test from
-satisfy_w_xor_x.  I also had to disable the malloc check and issue a
warning for static link offline across fork due to the unsolved #4660.

Issue: #5495, #5499, #4660
Fixes #5495
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant