Crash when library is 'replaced'

Bug #1261041 reported by Raghavendra D Prabhu on 2013-12-14
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Galera
Undecided
Unassigned
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC
Invalid
Undecided
Unassigned
5.5
Won't Fix
High
Unassigned
5.6
Won't Fix
High
Unassigned

Bug Description

When dlopened galera library is replaced with cp, mysqld crashes
as

#0 0x000000000006f606 in ?? ()
#1 0x00007fff627b5d98 in lock (this=<optimized out>) at asio/asio/detail/posix_mutex.hpp:51
#2 lock (this=0x7fff5853cb30) at asio/asio/detail/scoped_lock.hpp:51
#3 ~task_cleanup (this=0x7fff5853cb50, __in_chrg=<optimized out>) at asio/asio/detail/impl/task_io_service.ipp:39
#4 do_one (this_idle_thread=<optimized out>, lock=..., this=<optimized out>) at asio/asio/detail/impl/task_io_service.ipp:257
#5 asio::detail::task_io_service::run (this=0x1634310, ec=...) at asio/asio/detail/impl/task_io_service.ipp:129
#6 0x00007fff627b3ac6 in run (this=0x1633fe0) at asio/asio/impl/io_service.ipp:56
#7 gcomm::AsioProtonet::event_loop (this=0x1633f40, period=...) at gcomm/src/asio_protonet.cpp:243
#8 0x00007fff627ccc99 in GCommConn::run (this=0x1633720) at gcs/src/gcs_gcomm.cpp:449
#9 0x00007fff627d1c59 in GCommConn::run_fn (arg=<optimized out>) at gcs/src/gcs_gcomm.cpp:206
#10 0x00007ffff7bc80a2 in start_thread () from /usr/lib/libpthread.so.0
#11 0x00007ffff600b3dd in clone () from /usr/lib/libc.so.6

SIGBUS here.

or

#0 0x000000000006f606 in ?? ()
#1 0x00007fff627b5100 in lock (this=0x1628320) at asio/asio/detail/posix_mutex.hpp:51
#2 scoped_lock (m=..., this=<synthetic pointer>) at asio/asio/detail/scoped_lock.hpp:35
#3 asio::detail::epoll_reactor::run (this=0x16282f0, block=<optimized out>, ops=...) at asio/asio/detail/impl/epoll_reactor.ipp:300
#4 0x00007fff627b5ca4 in do_one (this_idle_thread=<optimized out>, lock=..., this=<optimized out>) at asio/asio/detail/impl/task_io_service.ipp:263
#5 asio::detail::task_io_service::run (this=0x16281e0, ec=...) at asio/asio/detail/impl/task_io_service.ipp:129
#6 0x00007fff627b3ac6 in run (this=0x1627f00) at asio/asio/impl/io_service.ipp:56
#7 gcomm::AsioProtonet::event_loop (this=0x1627e60, period=...) at gcomm/src/asio_protonet.cpp:243
#8 0x00007fff627ccc99 in GCommConn::run (this=0x16276f0) at gcs/src/gcs_gcomm.cpp:449
#9 0x00007fff627d1c59 in GCommConn::run_fn (arg=<optimized out>) at gcs/src/gcs_gcomm.cpp:206
#10 0x00007ffff7bc80a2 in start_thread () from /usr/lib/libpthread.so.0
#11 0x00007ffff600b3dd in clone () from /usr/lib/libc.so.6

This happens even library is identical to one loaded.

This doesn't happen with rm of the loaded library.(or when rm +
cp is done).

This may impact in following ways:

When someone upgrades their galera package while mysqld is
running (either to switch provider at runtime or to restart
later), mysqld can crash. So, mysqld will need to be stopped
before upgrade.

Interestingly, this happens even with RTLD_NOW.

Just want to add that this happens only on cp but not on install. Since packaging applications use install, this shouldn't be a problem.

Krunal Bauskar (krunal-bauskar) wrote :

So install doesn't face this issue.
BTW, copying when the server is running is malicious activity. It is like making one of the disk inaccessible and expecting s/w to work and protection like this may be provided if that is the usual case.

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXC-1553

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers