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

Mimalloc引起ppocr推理崩溃 #12120

Open
xiaohan-W opened this issue May 15, 2024 · 2 comments
Open

Mimalloc引起ppocr推理崩溃 #12120

xiaohan-W opened this issue May 15, 2024 · 2 comments
Assignees
Labels
Code PR is needed This issue could inspire a code PR

Comments

@xiaohan-W
Copy link

端侧本地部署ppocr的推理程序。计划将ppocr编译为dll,并导出一个接口供外部调用。主程序ConsoleApplication1.exe调用这个导出的接口。主程序里引入mimalloc后,在推理过程中崩溃。

具体崩溃位置为检测过程的BoxesFromBitmap接口,见附图。

Mimalloc引起PPOCR崩溃

其中主程序ConsoleApplication.exe的代码为
ConsoleAppliction1Code

PPOCR推理库导出接口为
PPOCR导出接口

请教可能是什么原因?是ppocr里内存管理可能有不恰当的地方,还是自身与mimalloc不兼容?是否与ppocr.dll的MT、MD模式有关?

@xiaohan-W xiaohan-W added the Code PR is needed This issue could inspire a code PR label May 15, 2024
@GreatV
Copy link
Collaborator

GreatV commented May 15, 2024

  1. 尝试不使用mimalloc库,使用默认的内存分配器,看是否还会发生崩溃。
  2. 检查ppocr.dll和ConsoleApplication1.exe的编译模式是否匹配,如果不匹配,需要重新编译使之一致。

@xiaohan-W
Copy link
Author

  1. 尝试不使用mimalloc库,使用默认的内存分配器,看是否还会发生崩溃。
  2. 检查ppocr.dll和ConsoleApplication1.exe的编译模式是否匹配,如果不匹配,需要重新编译使之一致。
  1. 不使用mimalloc库是不崩溃的。
  2. 编译模式MD或MT对崩溃现象没有影响。修改为均为MT模式,引入mimalloc库崩溃,不引入的话不崩溃。

如果一定要引入mimalloc库的话有何解决办法?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code PR is needed This issue could inspire a code PR
Projects
None yet
Development

No branches or pull requests

4 participants