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

HANG on attach if thread exits #2601

Closed
derekbruening opened this issue Aug 8, 2017 · 2 comments
Closed

HANG on attach if thread exits #2601

derekbruening opened this issue Aug 8, 2017 · 2 comments

Comments

@derekbruening
Copy link
Contributor

There's a hang on UNIX during attach where it waits with no timeout for a thread it found on the task list, but if the thread has exited it will wait forever. I have observed this happening in a test I created for #2600.

@derekbruening derekbruening self-assigned this Aug 8, 2017
derekbruening added a commit that referenced this issue Nov 2, 2017
started_detach for the few checks that need pre-synch querying.

Reminder to change to #2601 and to add a xref to #2075: we've now removed
the dynamo_thread_init_during_process_exit flag that was added by 45dd931
as #2600's counter fixed that race.
@derekbruening
Copy link
Contributor Author

While I've fixed this particular issue, the api.detach_spawn test continues to reveal other races, making it hard to check it in. I already had to bail on Windows due to #2611 and I'm now hitting races on 32-bit Linux that may need #1921 to solve.

derekbruening added a commit that referenced this issue Nov 6, 2017
Adds a check when taking over a new thread during attach to avoid
self-interp when the new thread is the child of a thread that's already
been taken over.

Tested with the api.detach_spawn test from #2601.

Fixes #2688
@derekbruening
Copy link
Contributor Author

The races mentioned above are actually self-interp filed as #2688.

I also hit #2690 while testing the new test.

derekbruening added a commit that referenced this issue Nov 6, 2017
Adds a check when taking over a new thread during attach to avoid
self-interp when the new thread is the child of a thread that's already
been taken over.

Tested with the api.detach_spawn test from #2601.

Fixes #2688
fhahn pushed a commit that referenced this issue Dec 4, 2017
Adds a check when taking over a new thread during attach to avoid
self-interp when the new thread is the child of a thread that's already
been taken over.

Tested with the api.detach_spawn test from #2601.

Fixes #2688
fhahn pushed a commit that referenced this issue Dec 4, 2017
To handle a thread exiting on attach, adds a timeout to wait_event() and
its corresponding implementations: os_wait_event() on Windows and
ksynch_wait() on UNIX.  Uses the timeout to check whether a thread exited,
and if so, to move on.

Augments the test from #2600 to test this race.

Abandon the api.detach_spawn test on Windows:i#2611 covers fixing the
tricky problems on Windows.  Leaves in place some fixes toward #2611:
+ Fixes a race where we put interception_code hooks in place before marking
  them +x
+ Increases MAX_THREADS_WAITING_FOR_DR_INIT

Fixes clang 32-bit missing __moddi3 by adding it to third_party/libgcc and linking
that into x86 and arm.

To enable adding race checks, moves doing_detach inside the synchall and adds
started_detach for the few checks that need pre-synch querying.

Removes the dynamo_thread_init_during_process_exit flag that was added in
45dd931 for #2075, as the UNIX uninit_thread_count solution from #2600 solves
that problem on its own.

Fixes #2601
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant