Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpp版本识别重建表格时崩溃 #11290

Open
cty-ai opened this issue Nov 22, 2023 · 0 comments
Open

cpp版本识别重建表格时崩溃 #11290

cty-ai opened this issue Nov 22, 2023 · 0 comments
Assignees

Comments

@cty-ai
Copy link

cty-ai commented Nov 22, 2023

  • 系统环境/System Environment:ubuntu 1804
  • 版本号/Version:Paddle: PaddleOCR: 问题相关组件/Related components:
  • 运行指令/Command Code:
  • 完整报错/Complete Error Message:
    Thread 3 "ppocr" received signal SIGSEGV, Segmentation fault.
    [Switching to Thread 0x7fffeb9af700 (LWP 24749)]
    0x00007fffef4334a0 in std::__cxx11::basic_string<char, std::char_traits, std::allocator >::find(char const*, unsigned long, unsigned long) const ()
    from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
    (gdb) where
    #0 0x00007fffef4334a0 in std::__cxx11::basic_string<char, std::char_traits, std::allocator >::find(char const*, unsigned long, unsigned long) const ()
    from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
    Upload PaddleOCR code  #1 0x000055555564d27a in PaddleOCR::PaddleStructure::rebuild_table (this=0x7fffeb99f1a0, structure_html_tags=std::vector of length 460, capacity 460 = {...},
    structure_boxes=std::vector of length 348, capacity 348 = {...}, ocr_result=std::vector of length 320, capacity 512 = {...})
    at /root/work/PaddleOCR/deploy/cpp_infer/src/paddlestructure.cpp:358
    del tmp #2 0x000055555564c79e in PaddleOCR::PaddleStructure::table (this=0x7fffeb99f1a0, img=..., structure_result=...)
    at /root/work/PaddleOCR/deploy/cpp_infer/src/paddlestructure.cpp:277
    optimize PaddleOCR  #3 0x000055555564b2a1 in PaddleOCR::PaddleStructure::structure (this=0x7fffeb99f1a0, srcimg=..., layout=true, table=true, ocr=true)
    at /root/work/PaddleOCR/deploy/cpp_infer/src/paddlestructure.cpp:106
    polish infer_rec and add ic15_dict #4 0x000055555560df32 in ocr_thread (param=0x7fffffffe260) at /root/work/PaddleOCR/deploy/cpp_infer/src/ekkocr.cpp:371
    Fixocr #5 0x00007ffff03bd6db in start_thread (arg=0x7fffeb9af700) at pthread_create.c:463
    Fix inference #6 0x00007fffeee2561f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

源码:PaddleOCR//deploy/cpp_infer/src/paddlestructure.cpp :
170行: if (matched[td_tag_idx].size() > 0) {
172行: if (matched[td_tag_idx][0].find("") != std::string::npos &&
可能访问越界导致崩溃
170行修改为 if (td_tag_idx < matched.size() && matched[td_tag_idx].size() > 0) { 可解决

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants