diff --git a/package/package.sh b/package/package.sh index d1561e18f00..590c6ded682 100755 --- a/package/package.sh +++ b/package/package.sh @@ -50,7 +50,7 @@ function _extra_release_variables { package_one="OFF" enable_compressed_debug_info="ON" dump_symbols="OFF" - fi + fi } _default_release_variables @@ -227,7 +227,15 @@ function dump_syms { tmp=${pack#nebula-graph} ver=${tmp%.*} + hash objcopy &> /dev/null || { + echo "'objcopy' is not installed" + exit 1 + } + for bin in nebula-graphd nebula-storaged nebula-metad; do + # Create separate debuginfo for GDB + objcopy --only-keep-debug ${build_dir}/bin/${bin} ${syms_dir}/${bin}${ver}.debug + # Create separate debuginfo for breakpad if ! (${dump_syms} ${build_dir}/bin/${bin} > ${syms_dir}/${bin}${ver}.sym); then echo ">>> dump ${bin} symbols failed: $?. <<<" exit 1 diff --git a/src/storage/mutate/DeleteEdgesProcessor.cpp b/src/storage/mutate/DeleteEdgesProcessor.cpp index 0761fe8e7ca..41cd9142d48 100644 --- a/src/storage/mutate/DeleteEdgesProcessor.cpp +++ b/src/storage/mutate/DeleteEdgesProcessor.cpp @@ -103,6 +103,14 @@ void DeleteEdgesProcessor::process(const cpp2::DeleteEdgesRequest& req) { nebula::cpp2::ErrorCode err = nebula::cpp2::ErrorCode::SUCCEEDED; for (const auto& edgeKey : part.second) { + if (!NebulaKeyUtils::isValidVidLen( + spaceVidLen_, edgeKey.src_ref()->getStr(), edgeKey.dst_ref()->getStr())) { + LOG(ERROR) << "Space " << spaceId_ << " vertex length invalid, " + << "space vid len: " << spaceVidLen_ << ", edge srcVid: " << *edgeKey.src_ref() + << " dstVid: " << *edgeKey.dst_ref(); + err = nebula::cpp2::ErrorCode::E_INVALID_VID; + break; + } auto l = std::make_tuple(spaceId_, partId, edgeKey.src_ref()->getStr(), diff --git a/src/storage/mutate/DeleteVerticesProcessor.cpp b/src/storage/mutate/DeleteVerticesProcessor.cpp index 6a1dccd2d3e..63a21f2ad20 100644 --- a/src/storage/mutate/DeleteVerticesProcessor.cpp +++ b/src/storage/mutate/DeleteVerticesProcessor.cpp @@ -114,6 +114,12 @@ ErrorOr DeleteVerticesProcessor::deleteVer target.reserve(vertices.size()); std::unique_ptr batchHolder = std::make_unique(); for (auto& vertex : vertices) { + if (!NebulaKeyUtils::isValidVidLen(spaceVidLen_, vertex.getStr())) { + LOG(ERROR) << "Space " << spaceId_ << ", vertex length invalid, " + << " space vid len: " << spaceVidLen_ << ", vid is " << vertex; + auto code = nebula::cpp2::ErrorCode::E_INVALID_VID; + return code; + } batchHolder->remove(NebulaKeyUtils::vertexKey(spaceVidLen_, partId, vertex.getStr())); auto prefix = NebulaKeyUtils::tagPrefix(spaceVidLen_, partId, vertex.getStr()); std::unique_ptr iter; diff --git a/src/webservice/SetFlagsHandler.cpp b/src/webservice/SetFlagsHandler.cpp index dcb7506a970..dc5b572663b 100644 --- a/src/webservice/SetFlagsHandler.cpp +++ b/src/webservice/SetFlagsHandler.cpp @@ -39,10 +39,15 @@ void SetFlagsHandler::onBody(std::unique_ptr body) noexcept { void SetFlagsHandler::onEOM() noexcept { folly::dynamic flags; try { - std::string body = body_->moveToFbString().toStdString(); - flags = folly::parseJson(body); - if (flags.empty()) { + if (!body_) { + LOG(ERROR) << "Got an empty body"; err_ = HttpCode::E_UNPROCESSABLE; + } else { + std::string body = body_->moveToFbString().toStdString(); + flags = folly::parseJson(body); + if (flags.empty()) { + err_ = HttpCode::E_UNPROCESSABLE; + } } } catch (const std::exception &e) { LOG(ERROR) << "Fail to update flags: " << e.what();