A/LIBC:致命信号11(Sigsegv),代码1(SEGV_MAPERR),TID 26201中的故障ADDR 0x0(MediaPipe_GL_RU),PID 26095(apps.facefect)
这是两个相关方法:
absl::Status Open(CalculatorContext* cc) override {
...
return gpu_helper_.RunInGlContext([&]() -> absl::Status {
const auto& options = cc->Options<FaceGeometryEffectRendererCalculatorOptions>();
// If i replace
// ASSIGN_OR_RETURN(ImageFrame effect_texture, ReadTextureFromFile(options._path()),_ << "Failed ");
// using
// ASSIGN_OR_RETURN(ImageFrame effect_texture, ReadTextureFromFile("mediapipe/graphs/face_effect/data:ic_cube_maps_left.pngblob"),_ << "Failed");
//
// it will report error:
// "A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 22251 (mediapipe_gl_ru), pid 21862 (apps.faceeffect)"
//
// 'ASSIGN_OR_RETURN()' defined here https://github.com/google/mediapipe/blob/ecb5b5f44ab23ea620ef97a479407c699e424aa7/mediapipe/framework/port/status_macros.h
ASSIGN_OR_RETURN(ImageFrame effect_texture, ReadTextureFromFile(options._path()), _ << "Failed ");
// This line print "mediapipe/graphs/face_effect/data:ic_cube_maps_left.pngblob", this is the main param of above method.
LOG(INFO) << options.effect_texture_path();
...
return absl::OkStatus();
});
}
static absl::StatusOr<ImageFrame> ReadTextureFromFile(const std::string& texture_path) {
...
cv::Mat output_mat;
switch (decoded_mat.channels()) {
case 3:
image_format = ImageFormat::SRGB;
cv::cvtColor(input_mat, output_mat, cv::COLOR_BGR2RGB);
break;
case 4:
image_format = ImageFormat::SRGBA;
cv::cvtColor(input_mat, output_mat, cv::COLOR_BGRA2RGBA);
break;
}
ImageFrame output_image_frame(image_format, output_mat.size().width,
output_mat.size().height,
ImageFrame::kGlDefaultAlignmentBoundary);
output_mat.copyTo(formats::MatView(&output_image_frame));
// This line works fine ,it print 4096.
// Even if after replacing
// ASSIGN_OR_RETURN(ImageFrame effect_texture, ReadTextureFromFile(options._path()),_ << "Failed ");
// using
// ASSIGN_OR_RETURN(ImageFrame effect_texture, ReadTextureFromFile("mediapipe/graphs/face_effect/data:ic_cube_maps_left.pngblob"),_ << "Failed");
// this is still can print 4096.
LOG(INFO) << "output_image_frame.Width() " << output_image_frame.Width() ;
return output_image_frame;
}
我只替换options._path()
使用“ MediaPipe/graphs/face_effect/data:ic_cube_maps_left.pngblob”
当Invoke ReadTextureFromFile(),然后我得到了此错误a/libc:致命信号11(sigsegv),代码1(segv_maperr),tid 22251中的故障addr 0x0(MediaPipe_GL_RU),PID 21862(Apps.faceeff)有点有线。
方法options._path()
,它返回path_.get()
,path _
的类型是 is :: protobuf_namespace_id :::::内部:: Arenastringptr
。
我在代码注释中添加了大多数说明。似乎更直接。
This is the two related method:
absl::Status Open(CalculatorContext* cc) override {
...
return gpu_helper_.RunInGlContext([&]() -> absl::Status {
const auto& options = cc->Options<FaceGeometryEffectRendererCalculatorOptions>();
// If i replace
// ASSIGN_OR_RETURN(ImageFrame effect_texture, ReadTextureFromFile(options._path()),_ << "Failed ");
// using
// ASSIGN_OR_RETURN(ImageFrame effect_texture, ReadTextureFromFile("mediapipe/graphs/face_effect/data:ic_cube_maps_left.pngblob"),_ << "Failed");
//
// it will report error:
// "A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 22251 (mediapipe_gl_ru), pid 21862 (apps.faceeffect)"
//
// 'ASSIGN_OR_RETURN()' defined here https://github.com/google/mediapipe/blob/ecb5b5f44ab23ea620ef97a479407c699e424aa7/mediapipe/framework/port/status_macros.h
ASSIGN_OR_RETURN(ImageFrame effect_texture, ReadTextureFromFile(options._path()), _ << "Failed ");
// This line print "mediapipe/graphs/face_effect/data:ic_cube_maps_left.pngblob", this is the main param of above method.
LOG(INFO) << options.effect_texture_path();
...
return absl::OkStatus();
});
}
static absl::StatusOr<ImageFrame> ReadTextureFromFile(const std::string& texture_path) {
...
cv::Mat output_mat;
switch (decoded_mat.channels()) {
case 3:
image_format = ImageFormat::SRGB;
cv::cvtColor(input_mat, output_mat, cv::COLOR_BGR2RGB);
break;
case 4:
image_format = ImageFormat::SRGBA;
cv::cvtColor(input_mat, output_mat, cv::COLOR_BGRA2RGBA);
break;
}
ImageFrame output_image_frame(image_format, output_mat.size().width,
output_mat.size().height,
ImageFrame::kGlDefaultAlignmentBoundary);
output_mat.copyTo(formats::MatView(&output_image_frame));
// This line works fine ,it print 4096.
// Even if after replacing
// ASSIGN_OR_RETURN(ImageFrame effect_texture, ReadTextureFromFile(options._path()),_ << "Failed ");
// using
// ASSIGN_OR_RETURN(ImageFrame effect_texture, ReadTextureFromFile("mediapipe/graphs/face_effect/data:ic_cube_maps_left.pngblob"),_ << "Failed");
// this is still can print 4096.
LOG(INFO) << "output_image_frame.Width() " << output_image_frame.Width() ;
return output_image_frame;
}
I just replace options._path()
using "mediapipe/graphs/face_effect/data:ic_cube_maps_left.pngblob"
when invoke ReadTextureFromFile() , then i got this error A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 22251 (mediapipe_gl_ru), pid 21862 (apps.faceeffect)
. it's a little wired.
Method options._path()
, it return path_.Get()
, and the type of path_
is ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr
.
I add most explanation in the code comments. it seems more directly.
Reference project : https://github.com/google/mediapipe
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论