This project is read-only.

Memory corruption

Topics: Developer Forum, User Forum
Jul 9, 2008 at 6:59 AM

I'm using the ScintillaNET in an application for editing source code, I have my pure managed lib that I'm using to show extra information when the user is on a specific line\specific symbol.

When I use my library with a rich text box all is well and the applicaiton behaves normally, when I used ScintillaNET I got a number of strange memory read\write errors that look like memory corruption problems.

Anyone faced such problems? any suggestions on how to debug these? I tried the CLR profiler with no luck.

Jul 25, 2008 at 2:07 PM
ScintillaNET is a .NET wrapper around the unmanaged Scintilla component. Scintilla doesn't do runtime validation of the values you pass to it so if they are invalid it won't let you know. Instead it writes corrupted memory and can eventually lead to a GPF in your app.
It may be that there's a bug somewhere in ScintillaNET or you may be giving it bad values. ScintillaNET does some runtime validation on parameters but isn't 100%. Unfortunately these kinds of things are extremely difficult to track down. My suggestion is to create a minimal test app and slowly add code until it starts exhibiting the said behavior. Once you get the app to that point if you post the code I can take a look.