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
Merged

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

2 commits merged into from Apr 27, 2015

Conversation

ghost
Copy link

@ghost ghost commented Mar 11, 2015

yehudasa and others added 2 commits March 11, 2015 12:25
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 92615ea)
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
Copy link

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

:octocat: Sent from GH.

@athanatos
Copy link
Contributor

Might want to run this one by yehuda

@ghost ghost assigned yehudasa and unassigned ghost Mar 16, 2015
@ldachary
Copy link
Contributor

@yehudasa ping ?

@yehudasa
Copy link
Member

yehudasa 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
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 pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants