Getting AccessViolaitonException
See original GitHub issueDescription
I very often get an AccessViolationException from Consumer when raising a cancellation with a CancellationToken instance passed into .Consume()
method:
Consumer.Consume(cancellationToken);
Checklist
Please provide the following information:
- [1.1.0 ] Confluent.Kafka nuget version.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Debugging System.AccessViolationException - DllImport hell
The exception typically happens when unmanaged code tries to read or write from/to memory that hasn't been allocated yet. Debugging System.
Read more >c# - Programs randomly getting System. ...
6 Answers 6 · Go to the System properties (Win8: WinKey+X, select 'System', Win7: Open 'Properties' from my computer) · Advanced System Settings ......
Read more >.NET Exceptions - System.AccessViolationException
AccessViolationException : Attempted to read or write protected memory. This is often an indication that other memory is corrupt. To get the most ......
Read more >Getting "accessviolationexception" error after ms access ...
You get an "Access violation" error when the process trying to open a file does not have sufficient permissions for it.
Read more >Error : 'System.AccessViolationException' occurred in ...
While trying to run Samples with attached image. i am getting following error: An unhandled exception of type 'System.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m seeing the exception when running in a debugger, so VS just breaks on the
.Consume(cancellationToken)
line and displays the exception pop-up.I see that internally Consumer is doing
cancellationToken.ThrowIfCancellationRequested();
and sometimes I get the related exception (OperationCanceledException), which I expect and process accordingly, but often I get the AccessViolationException, which can only be coming fromConsumeImpl()
that interacts with librdkafka.I’m running a test Net Core 2.2 console app, and that’s where I see the behavior.
But yes, I do have
.Close()
and wrap the message consumption in atry...catch..finally
. So running outside of the debugger I’d be handling generic exception and moving on, but this is still concerning.Its probl. to late, but if someone else is reading this: I think got this error when the consumer got disposed WHILE the Consume() happened. If you Dispose the consumer and then call consume, you get the normal ObjectDisposedException.