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

企业微信api的ExecuteGetMediaFileBufferAsync接口获取文件失败 #95

Closed
duzijian opened this issue May 19, 2023 · 8 comments · Fixed by #96
Closed

企业微信api的ExecuteGetMediaFileBufferAsync接口获取文件失败 #95

duzijian opened this issue May 19, 2023 · 8 comments · Fixed by #96
Labels
bug Something isn't working

Comments

@duzijian
Copy link

简单描述

企业微信api的ExecuteGetMediaFileBufferAsync接口获取文件失败
调试发现:
在获取一次分片后进行释放时(FinanceDllWindowsPInvoker.FreeMediaData)应用程序直接退出

源代码

使用
SKIT.FlurlHttpClient.Wechat.Work.UnitTests
TestCase_FinanceSdkTests.cs中的ExecuteGetMediaFileAsync

异常

在获取一次分片后进行释放时(FinanceDllWindowsPInvoker.FreeMediaData)应用程序直接退出

发生问题的运行环境

使用的模块及版本:Windows11
使用的模块及版本:.NET 6
使用的模块及版本:SKIT.FlurlHttpClient.Wechat.Work 2.16.0

@duzijian duzijian added the question Q & A label May 19, 2023
@fudiwei fudiwei added the bug Something isn't working label May 19, 2023
@fudiwei
Copy link
Owner

fudiwei commented May 19, 2023

可能存在 Double Free。

麻烦确认一下 ExecuteGetChatRecordsAsyncExecuteDecryptChatRecordAsync 接口、即内部调用了 FinanceDllWindowsPInvoker.FreeSlice 的,有没有同样的闪退问题?

@duzijian
Copy link
Author

duzijian commented May 19, 2023

首先 非常感谢您的回复

我调用了下ExecuteGetChatRecordsAsyncExecuteDecryptChatRecordAsync 在FinanceDllWindowsPInvoker.FreeSlice的时候没有发现闪退现象;之后我再次调用ExecuteGetMediaFileAsync后,在FinanceDllWindowsPInvoker.FreeMediaData 还是出现了闪退

@fudiwei
Copy link
Owner

fudiwei commented May 19, 2023

我推送了一个新的分支 bugfix/double_free,尝试修复了该 Bug。

麻烦您拉取一下该分支,确认一下问题是否已解决,如果解决的话我再发版。谢谢🙏

@duzijian
Copy link
Author

duzijian commented May 19, 2023

我刚刚尝试了一下 问题依然存在,还是同样在FinanceDllWindowsPInvoker.FreeMediaData出现闪退

目前FinanceDllWindowsPInvoker.FreeMediaData的时候出现
System.AccessViolationException:“Attempted to read or write protected memory. This is often an indication that other memory is corrupt.”

@duzijian
Copy link
Author

大佬
我刚调试了下 注释图中的那行代码就可以正常运行了
image

@fudiwei
Copy link
Owner

fudiwei commented May 19, 2023

我们这面做个测试后验证下 Linux 环境后发版。

@duzijian
Copy link
Author

好的
非常感谢

@fudiwei fudiwei linked a pull request May 19, 2023 that will close this issue
@fudiwei fudiwei removed the question Q & A label May 19, 2023
@fudiwei
Copy link
Owner

fudiwei commented May 19, 2023

Fix this on release v2.17.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants