Project

General

Profile

Actions

Bug #18427

closed

Segment fault when running vstart with bluestore

Added by Xiaoyan Li over 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
ceph-disk
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

On current master branch 2017/1/5.

Process:
1. Build vstart
2. Run command "MON=1 OSD=3 ../src/vstart.sh -d -n -x -b"

Error:
Segment fault.

ceph version 11.1.0-6301-g27d9cf8 (27d9cf8fd95ba3309df853f8bfb7cb163402dd3a)
1: (ceph::BackTrace::BackTrace(int)+0x2d) [0x5586662eb4cb]
2: (()+0x2136be5) [0x5586664fbbe5]
3: (()+0x10330) [0x7fb1caee6330]
4: (std::enable_if<boost::is_same<bluestore_pextent_t const, bluestore_pextent_t>::value||boost::is_same<bluestore_pextent_t const, bluestore_pextent_t const>::value, void>::type denc_friend<bluestore_pextent_t const, unsigned long>(bluestore_pextent_t const&, unsigned long&)+0x14) [0x5586663ebf43]
5: (bluestore_pextent_t::bound_encode(unsigned long&) const+0x23) [0x5586663e38a5]
6: (denc_traits<bluestore_pextent_t, void>::bound_encode(bluestore_pextent_t const&, unsigned long&, unsigned long)+0x27) [0x5586663e391a]
7: (std::enable_if<(denc_traits&lt;bluestore_pextent_t, void&gt;::supported!=(0))&&(!denc_traits&lt;bluestore_pextent_t, void&gt;::featured), void>::type denc&lt;bluestore_pextent_t, denc_traits&lt;bluestore_pextent_t, void&gt; >(bluestore_pextent_t const&, unsigned long&, unsigned long)+0x2c) [0x5586663ec017]
8: (denc_traits&lt;std::vector&lt;bluestore_pextent_t, std::allocator&lt;bluestore_pextent_t&gt; >, void>::bound_encode(std::vector&lt;bluestore_pextent_t, std::allocator&lt;bluestore_pextent_t&gt; > const&, unsigned long&)+0x40) [0x5586663e39ae]
9: (std::enable_if<(denc_traits&lt;std::vector&lt;bluestore_pextent_t, std::allocator&lt;bluestore_pextent_t&gt; >, void>::supported!=(0))&&(!denc_traits&lt;std::vector&lt;bluestore_pextent_t, std::allocator&lt;bluestore_pextent_t&gt; >, void>::featured), void>::type denc&lt;std::vector&lt;bluestore_pextent_t, std::allocator&lt;bluestore_pextent_t&gt; >, denc_traits&lt;std::vector&lt;bluestore_pextent_t, std::allocator&lt;bluestore_pextent_t&gt; >, void> >(std::vector&lt;bluestore_pextent_t, std::allocator&lt;bluestore_pextent_t&gt; > const&, unsigned long&, unsigned long)+0x27) [0x5586663ec6ac]
10: (bluestore_blob_t::bound_encode(unsigned long&, unsigned long) const+0x52) [0x5586663e3f3c]
11: (denc_traits&lt;bluestore_blob_t, void&gt;::bound_encode(bluestore_blob_t const&, unsigned long&, unsigned long)+0x2b) [0x5586663e5501]
12: (std::enable_if<(denc_traits&lt;bluestore_blob_t, void&gt;::supported!=(0))&&denc_traits&lt;bluestore_blob_t, void&gt;::featured, void>::type denc&lt;bluestore_blob_t, denc_traits&lt;bluestore_blob_t, void&gt; >(bluestore_blob_t const&, unsigned long&, unsigned long)+0x2b) [0x5586663ee27b]
13: (BlueStore::Blob::bound_encode(unsigned long&, unsigned long, unsigned long, bool) const+0x39) [0x5586663e7b41]
14: (BlueStore::ExtentMap::encode_some(unsigned int, unsigned int, ceph::buffer::list&, unsigned int*)+0x41a) [0x55866638b8a8]
15: (BlueStore::ExtentMap::update(std::shared_ptr&lt;KeyValueDB::TransactionImpl&gt;, bool)+0xd0) [0x5586663890a4]
16: (BlueStore::_txc_write_nodes(BlueStore::TransContext*, std::shared_ptr&lt;KeyValueDB::TransactionImpl&gt;)+0x28f) [0x5586663be8ad]
17: (BlueStore::queue_transactions(ObjectStore::Sequencer*, std::vector&lt;ObjectStore::Transaction, std::allocator&lt;ObjectStore::Transaction&gt; >&, std::shared_ptr&lt;TrackedOp&gt;, ThreadPool::TPHandle*)+0x761) [0x5586663c5be9]
18: (ObjectStore::queue_transactions(ObjectStore::Sequencer*, std::vector&lt;ObjectStore::Transaction, std::allocator&lt;ObjectStore::Transaction&gt; >&, Context*, Context*, Context*, std::shared_ptr&lt;TrackedOp&gt;, ThreadPool::TPHandle*)+0xdb) [0x558665dfb57f]
19: (ObjectStore::apply_transactions(ObjectStore::Sequencer*, std::vector&lt;ObjectStore::Transaction, std::allocator&lt;ObjectStore::Transaction&gt; >&, Context*)+0x152) [0x5586662a62f0]
20: (ObjectStore::apply_transaction(ObjectStore::Sequencer*, ObjectStore::Transaction&&, Context*)+0x5b) [0x558665dfb333]
21: (OSD::mkfs(CephContext*, ObjectStore*, std::string const&, uuid_d, int)+0xc10) [0x558665d991bc]
22: (main()+0x1265) [0x558665d78a4f]
23: (
_libc_start_main()+0xf5) [0x7fb1c9559f45]
24: (()+0x19b1f66) [0x558665d76f66]
Actions #1

Updated by Xiaoyan Li over 7 years ago

The problem is that
https://github.com/ceph/ceph/blob/master/src/os/bluestore/bluestore_types.h#L159

denc((bluestore_pextent_t)nullptr, per);

And segment fault happens in the code later when it accesses the fields of the null object.

https://github.com/ceph/ceph/blob/master/src/os/bluestore/bluestore_types.h#L139

DENC(bluestore_pextent_t, v, p) {
denc_lba(v.offset, p);
denc_varint_lowz(v.length, p);
}
Actions #2

Updated by Kefu Chai over 7 years ago

  • Status changed from New to Fix Under Review
Actions #3

Updated by Xiaoyan Li over 7 years ago

vstart was built with debug flag "-DCMAKE_C_FLAGS="-O0 -g3 -gdwarf-4" -DCMAKE_BUILD_TYPE=Debug".

Actions #4

Updated by Sage Weil almost 7 years ago

  • Status changed from Fix Under Review to Closed

this was fixed long ago

Actions

Also available in: Atom PDF