Skip to content

Fix #16: Hang on ASAN builds of R#17

Merged
jcheng5 merged 1 commit intomasterfrom
joe/bugfix/asan-hang
Oct 11, 2017
Merged

Fix #16: Hang on ASAN builds of R#17
jcheng5 merged 1 commit intomasterfrom
joe/bugfix/asan-hang

Conversation

@jcheng5
Copy link
Member

@jcheng5 jcheng5 commented Oct 5, 2017

Apparently due to trying to call pthread_create during dlopen.
The fix is to create the thread on demand instead of during
initialization.

Apparently due to trying to call pthread_create during dlopen.
The fix is to create the thread on demand instead of during
initialization.
@jcheng5
Copy link
Member Author

jcheng5 commented Oct 5, 2017

@wch Sigh.

@jcheng5
Copy link
Member Author

jcheng5 commented Oct 5, 2017

The diff is less scary if you ignore whitespace:
https://github.com/r-lib/later/pull/17/files?w=1

pthread_cond_signal(&this->cond);
pthread_mutex_unlock(&this->mutex);

pthread_join(*this->bgthread, NULL);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the * supposed to be there?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. bgthread is a boost::optional<pthread_t>, and pthread_join wants a pthread_t.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah OK, I see it now.

@jcheng5 jcheng5 merged commit a11d98e into master Oct 11, 2017
@jcheng5 jcheng5 deleted the joe/bugfix/asan-hang branch October 11, 2017 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants