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

common: Rados.shutdown() dies with Illegal instruction (core dumped) #3963

Merged
2 commits merged into from Apr 27, 2015

Conversation

Projects
None yet
5 participants
@ghost
Copy link

commented Mar 11, 2015

yehudasa and others added some commits May 3, 2014

common/RWLock: track read/write locks via atomics for assertion checks
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 92615ea)
common: do not unlock rwlock on destruction
According to pthread_rwlock_unlock(3p):

 Results are undefined if the read-write lock rwlock is not held
 by the calling thread.

and:

 https://sourceware.org/bugzilla/show_bug.cgi?id=17561

 Calling pthread_rwlock_unlock on an rwlock which is not locked
 is undefined.

calling pthread_rwlock_unlock on RWLock destruction could cause
an unknown behavior for two reasons:

- the lock is acquired by another thread (undefined)
- the lock is not acquired (undefined)

Moreover since glibc-2.20 calling pthread_rwlock_unlock on a
rwlock that is not locked results in a SIGILL that kills the
application.

This patch removes the pthread_rwlock_unlock call on destruction
and replaces it with an assertion to check that the RWLock is
not in use.

Any code that relied on the implicit release is now going to
break the assertion, e.g.:

 {
   RWLock l;
   l.get(for_write);
 } // implicit release, wrong.

Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
(cherry picked from commit cf2104d)

@ghost ghost added bug fix core labels Mar 11, 2015

@ghost ghost added this to the firefly milestone Mar 11, 2015

@ghost ghost self-assigned this Mar 11, 2015

@loic-bot

This comment has been minimized.

Copy link

commented Mar 11, 2015

SUCCESS: the output of run-make-check.sh on centos-7 for e9871a8 is http://paste2.org/m4E2a3sP

:octocat: Sent from GH.

@athanatos

This comment has been minimized.

Copy link
Contributor

commented Mar 16, 2015

Might want to run this one by yehuda

@ghost ghost assigned yehudasa and unassigned ghost Mar 16, 2015

@ldachary

This comment has been minimized.

Copy link
Contributor

commented Mar 25, 2015

@yehudasa ping ?

@yehudasa

This comment has been minimized.

Copy link
Member

commented Apr 6, 2015

@dachary looks fine to me

@yehudasa yehudasa assigned ghost and unassigned yehudasa Apr 6, 2015

ghost pushed a commit that referenced this pull request Apr 27, 2015

Loic Dachary
Merge pull request #3963 from dachary/wip-10153-firefly
Rados.shutdown() dies with Illegal instruction (core dumped)

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>

@ghost ghost merged commit dd15e54 into ceph:firefly Apr 27, 2015

@ghost ghost changed the title Rados.shutdown() dies with Illegal instruction (core dumped) common: Rados.shutdown() dies with Illegal instruction (core dumped) Jul 14, 2015

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.