-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Querying
-
None
-
Fully Compatible
-
ALL
-
-
Query 2020-02-10
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Stack trace:
at /opt/mongodbtoolchain/revisions/9b224ef3e13ae2094ba3c865966ac238660d9552/stow/gcc-v3.fo3/include/c++/8.2.0/x86_64-mongodb-linux/bits/gthr-default.h:748
#15 lock (this=0x0) at /opt/mongodbtoolchain/revisions/9b224ef3e13ae2094ba3c865966ac238660d9552/stow/gcc-v3.fo3/include/c++/8.2.0/bits/std_mutex.h:103
#16 lock_guard (__m=..., this=<synthetic pointer>) at /opt/mongodbtoolchain/revisions/9b224ef3e13ae2094ba3c865966ac238660d9552/stow/gcc-v3.fo3/include/c++/8.2.0/bits/std_mutex.h:162
#17 mongo::LogicalClock::reserveTicks(unsigned long) () at src/mongo/db/logical_clock.cpp:102
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
Relevant code that seems to crash is here:
ObjectReplaceExecutor::ObjectReplaceExecutor(BSONObj replacement)
: _replacementDoc(replacement.getOwned()), _containsId(false) {
// Replace all zero-valued timestamps with the current time and check for the existence of _id.
for (auto&& elem : _replacementDoc) {
// Do not change the _id field.
if (elem.fieldNameStringData() == kIdFieldName) {
_containsId = true;
continue;
}
if (elem.type() == BSONType::bsonTimestamp) {
auto timestampView = DataView(const_cast<char*>(elem.value()));
// We don't need to do an endian-safe read here, because 0 is 0 either way.
unsigned long long timestamp = timestampView.read<unsigned long long>();
if (timestamp == 0) {
ServiceContext* service = getGlobalServiceContext();
auto ts = LogicalClock::get(service)->reserveTicks(1).asTimestamp();
timestampView.write(tagLittleEndian(ts.asULL()));
}
}
}
}
Seems like LogicalClock::get(service) is returning nullptr when it enters the codepath via the stitch support lib.