1

We are using some VB6 (please don't ask) code to make a call to a DLL (which is also our own code) that uses the Entity Framework in .NET 4.0.30319.1 - and SOMETIMES this results in System.Data.Entity.ni.dll coughing up a c0000005 (a buffer overrun).

I know that, usually, this is caused by a C++ string being incorrectly terminated (as in: not terminated with a NULL), but I am hesitant to believe that this would be a general bug in the System.Data.Entity code. It only happens at one customer, and it only happens once in a blue moon or so. And I'm not even sure of that - the application event log that I got didn't even go that far back, so I am seeing only proof of one actual instance. And yes, I have asked if the problem can be reproduced... :-|

My question is: could there be an error condition in a database record that could throw System.Data.Entity a curveball, resulting in a c0000005? Is there anything specific that I should be looking for?

Any help would be greatly appreciated!

Peter Huppertz
  • 361
  • 3
  • 7
  • Your best bet is to try and reproduce the issue. What would happen if you were to create a database field that is capped at a maximum length of 250 chars and you submitted your call to this DLL with a string over that length? Or, if you submitted a call to this DLL where one of your parameters went over the size boundaries of that database data type? – Alexandru Nov 20 '14 at 12:41
  • That is going down on the list of useful suggestions to give a try once I have my troubleshooting stream. I would, however, expect this to be caught properly within the Entity Framework. I am more thinking towards what would happen if EF would read a record and there would be garbage in it - as in "we're trying to get some mhtml, and the wrong character set is specified", maybe even. – Peter Huppertz Nov 20 '14 at 12:50
  • c0000005 == null reference exception (not buffer overrun) – leppie Nov 20 '14 at 12:51
  • @leppie w00t? Exception code c0000005 is "access violation". That means that your program is accessing (either reading or writing) a memory address to which it does not have rights. [link](http://stackoverflow.com/questions/17168982/exception-error-c0000005-in-vc) – Peter Huppertz Nov 20 '14 at 12:58
  • @leppie `#define STATUS_ACCESS_VIOLATION ((NTSTATUS)0xC0000005L)` – Alexandru Nov 20 '14 at 14:09
  • @PeterHuppertz I wrote a stack tracer for MSVC++ applications awhile back, perhaps it can help you get to the bottom of the customer's problem: http://www.dima.to/blog/?p=13 – Alexandru Nov 20 '14 at 14:10

0 Answers0