Project

General

Profile

Bug #1034

librados: Calling connect twice causes a segfault

Added by Wido den Hollander over 8 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
librados
Target version:
Start date:
04/29/2011
Due date:
% Done:

0%

Spent time:
Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

Description

While working on phprados I called rados.connect() twice by accident, this resulted in:

wido@wido-desktop:~/repos/phprados$ php testrados.php 
mon/MonMap.h: In function 'void MonMap::add(const std::string&, const entity_addr_t&)', in thread '0x7f42620ba720'
mon/MonMap.h: 77: FAILED assert(mon_addr.count(name) == 0)
mon/MonMap.h: In function 'void MonMap::add(const std::string&, const entity_addr_t&)', in thread '0x7f42620ba720'
mon/MonMap.h: 77: FAILED assert(mon_addr.count(name) == 0)
 ceph version 0.27 (commit:793034c62c8e9ffab4af675ca97135fd1b193c9c)
 1: (MonClient::build_initial_monmap()+0xc11) [0x7f4258b0d181]
 2: (librados::RadosClient::connect()+0x20) [0x7f4258a43530]
 3: (zim_Rados_connect(int, _zval_struct*, _zval_struct**, _zval_struct*, int)+0x15) [0x7f4258d94a25]
 4: php() [0x6e7caa]
 5: (execute()+0x210) [0x6bef90]
 6: (zend_execute_scripts()+0x15d) [0x696bad]
 7: (php_execute_script()+0x1d8) [0x6427a8]
 8: php() [0x727dc6]
 9: (__libc_start_main()+0xfd) [0x7f425f397c4d]
 10: php() [0x42c6a9]
 ceph version 0.27 (commit:793034c62c8e9ffab4af675ca97135fd1b193c9c)
 1: (MonClient::build_initial_monmap()+0xc11) [0x7f4258b0d181]
 2: (librados::RadosClient::connect()+0x20) [0x7f4258a43530]
 3: (zim_Rados_connect(int, _zval_struct*, _zval_struct**, _zval_struct*, int)+0x15) [0x7f4258d94a25]
 4: php() [0x6e7caa]
 5: (execute()+0x210) [0x6bef90]
 6: (zend_execute_scripts()+0x15d) [0x696bad]
 7: (php_execute_script()+0x1d8) [0x6427a8]
 8: php() [0x727dc6]
 9: (__libc_start_main()+0xfd) [0x7f425f397c4d]
 10: php() [0x42c6a9]
 ceph version 0.27 (commit:793034c62c8e9ffab4af675ca97135fd1b193c9c)
 1: (MonClient::build_initial_monmap()+0xc11) [0x7f4258b0d181]
 2: (librados::RadosClient::connect()+0x20) [0x7f4258a43530]
 3: (zim_Rados_connect(int, _zval_struct*, _zval_struct**, _zval_struct*, int)+0x15) [0x7f4258d94a25]
 4: php() [0x6e7caa]
 5: (execute()+0x210) [0x6bef90]
 6: (zend_execute_scripts()+0x15d) [0x696bad]
 7: (php_execute_script()+0x1d8) [0x6427a8]
 8: php() [0x727dc6]
 9: (__libc_start_main()+0xfd) [0x7f425f397c4d]
 10: php() [0x42c6a9]
 ceph version 0.27 (commit:793034c62c8e9ffab4af675ca97135fd1b193c9c)
 1: (MonClient::build_initial_monmap()+0xc11) [0x7f4258b0d181]
 2: (librados::RadosClient::connect()+0x20) [0x7f4258a43530]
 3: (zim_Rados_connect(int, _zval_struct*, _zval_struct**, _zval_struct*, int)+0x15) [0x7f4258d94a25]
 4: php() [0x6e7caa]
 5: (execute()+0x210) [0x6bef90]
 6: (zend_execute_scripts()+0x15d) [0x696bad]
 7: (php_execute_script()+0x1d8) [0x6427a8]
 8: php() [0x727dc6]
 9: (__libc_start_main()+0xfd) [0x7f425f397c4d]
 10: php() [0x42c6a9]
terminate called after throwing an instance of 'ceph::FailedAssertion'
Aborted
wido@wido-desktop:~/repos/phprados$

I know the "old" librados had the same issue with calling initialize double, a simple booling 'initialized' solved it.

Anyway, librados should not go down like this when calling connect twice.

Associated revisions

Revision 203edaca (diff)
Added by Sage Weil over 8 years ago

librados: don't crash if we call connect twice

Fixes: #1034
Reported-by: Wido den Hollander <>
Signed-off-by: Sage Weil <>

History

#1 Updated by Sage Weil over 8 years ago

  • Target version set to v0.27.1

#2 Updated by Sage Weil over 8 years ago

  • translation missing: en.field_position set to 1

#3 Updated by Sage Weil over 8 years ago

  • Status changed from New to Resolved

#4 Updated by Sage Weil over 8 years ago

  • Target version changed from v0.27.1 to v0.28

Also available in: Atom PDF