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

运行sm2示例程序时报错“*** Error in `./sm2keygen': free(): invalid pointer: 0x00c50700 *** Aborte” #24

Open
liuhuahan opened this issue May 22, 2018 · 1 comment

Comments

@liuhuahan
Copy link

交叉编译程序之后,在板子上运行“Tassl_demo/crypto”目录下的示例代码时,涉及SM2相关的代码,运行时均报错:/*** Error in `./sm2keygen': free(): invalid pointer: 0x00c50700 ***
Aborte

但是运行SM3、SM4的示例代码和openssl的测试代码也都正常。
是我交叉编译的问题吗?

因为公司项目,刚接触openssl,请多多指教。

@liuhuahan
Copy link
Author

通过打印发现,是ec_group_new_from_data调用函数 EC_GROUP_new_curve_GFp生成曲线参数时失败,然后程序退出时,调用BN_CTX_free释放资源,BN_CTX_free继续依次调用 BN_STACK_finish(&ctx->stack);
BN_POOL_finish(&ctx->pool);这两个函数的时候,执行到第二个函数的时候,出现free错误。

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

1 participant