-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
Using vision framework causes grpc-go "panic: Cannot free freed buffer" #277
Comments
Hm... if I remove this line, it doesn't crash
|
An excerpt of some of the logs (they don't mean much to me) around the crash. I think these logs are only the aftermath, I didn't find any logs regarding the cause. 62752 is the PID of the server running the obj-c.
|
The consensus from the grpc-go team after investigating was that an unsafe pointer was being incorrectly used and was overwriting a reference counter in the grpc internals. They proved this using a number of tests and then said that the problem was either in my implementation of darwinkit, or within darwinkit itself. |
Thanks for digging into this.
…On Wed, Jan 29, 2025 at 8:00 AM Clark McCauley ***@***.***> wrote:
The consensus from the grpc-go team after investigating was that an unsafe
pointer was being incorrectly used and was overwriting a reference counter
in the grpc internals. They proved this using a number of tests and then
said that the problem was either in my implementation of darwinkit, or
within darwinkit itself.
—
Reply to this email directly, view it on GitHub
<#277 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAFB7LB2PWLN5JRX3NL2D2ND3ITAVCNFSM6AAAAABVRLUVZOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMRSGA2DSNRQGA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
This is a long shot question, but I'm not sure where else to go. I have a grpc-go server that accepts image data, performs OCR using Apple Vision Framework on it, and then returns the results. I've found that sometimes (usually within about 5-10 calls) when I call the following code using the darwinkit library, it triggers a nearly meaningless panic in grpc-go
I've spent the day isolating the conditions under which this panic appears, and apparently it only appears when I call the objc code attached. Even if I use an entirely different image than what's contained in the grpc-go request's byte slice, I can reliably reproduce this panic, but it only happens after 5-10 calls, meaning the first few calls work just fine. Not calling this code prevents the panic from happening. I've moved this code into a separate thread from the grpc-endpoint to confirm that there wasn't an issue with the autorelease pool locking the OS thread or something, and no luck.
Here is the grpc-go issue: grpc/grpc-go#8023
So my question to darwinkit is: is there anything in here that looks off, that you think could maybe be causing this grpc-go panic?
The text was updated successfully, but these errors were encountered: