-
Notifications
You must be signed in to change notification settings - Fork 744
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
Error : 'System.AccessViolationException' occurred in InteropRuntimeImplementer.TessApiSignaturesInstance #231
Comments
Opps I forgot to update the Samples to the new Tesseract release (3.0). I'll have a look at doing this tomorrow. |
If you've upgraded to 3.0, then it could be due to issue #232. I'll try and put together a fix tomorrow morning. |
The |
Yes, I have noticed that some of the time I'm getting AccessViolationException as well. I'll have a look but for the meantime I'd strongly suggest using version 2.4.1 instead. |
Always appreciate your effort. thanks. |
Just rebuilt the native tesseract libraries and re-added them (ab4d506). Seems to be working for me now however would appreciate it if someone else could also verify that it's working for them too. |
Note to use the samples in dev you'll need to build local copy of the Tesseract nuget package (3.0.1) and place it in your nuget package path:
Note: You can skip step 2 if you've already got this setup of course. |
Did this ever get solved? I am using 3.0.1 from NuGet package install. I am receiving the same error: System.AccessViolationException' occurred in InteropRuntimeImplementer.TessApiSignaturesInstance What version should I use if I build my own nuget package? |
I'm guessing that the answer is no as you're still getting the error. I think that something is wrong with the native build of the tesseract library. Not sure what though. |
I'm having the same problem as well. |
I've split of the samples into the own repo (https://github.com/charlesw/tessseract-samples) to make it easier to maintain and so they can be improved independently of this wrapper. I've also had a quick further look at this bug and unfortunately I cannot reliably reproduce it (just ran the console sample 20+ times and it didn't occur once). Can anyone else check this out and ideally provide an example more info on how to reproduce this? |
@charlesw, I get the error every time without fail in the same way as @satishreddy81. I started down the path of building all of the dependencies from scratch, but it didn't help. This happens when I run any number of inputs, not just the samples not just on occasion. I tried version 3.0.0 specifically as I had tried 3.0.1, both fail in the same way. |
Note, if I force the x86 platform it's intermittent. |
Thanks for the extra info. I did do some more testing to see if I could
|
It does, unfortunately. My work around for the moment is to force the platform to x86 and swallow the error if it happens. With the x86 binaries it's much less common. |
Quick update on this issue: Unfortunately I'm not making much headway here and still cannot reliably reproduce the issue. I'll look at doing a new build using VS 2015, thanks to the work by @tofutim, and hope that resolves the crash though I'm not confident it will given I have no idea what's causing this. I'm off to Europe very shortly so may not be able to do until mid\late next week. |
Hi, i'm currently having the same issue IF I specify a different language, but if I use "eng", no error occurs. BTW I happen to try "chi_sim" and "chi_tra" and both happens to have an AccessViolationError. |
I've released a new prerelease (Tesseract.3.0.2.0-alpha1) on nuget if people can test it out and respond with if it works or not on there setup that would be great. Note that this release used vs2015 to build the dependencies so you'll need to ensure that the vs2015 runtime is installed. VS2015 or .Net 4.6 is not required. |
Thanks charles, i'll definitely test this one out. best! |
Hi Charles, good news for the chi_sim language, i'm now able to convert the document into text. This is a great progress for your 3.0.2.0 alpha1! I'm just not sure how to test the other languages. Hopefully someone from the group may help. Thanks a lot again, wonderful work! For those who wish to test, please execute to your package manager -
|
Hi charlesw, |
Great, I'll do another set of test runs and assuming all is good do a On Thu, Feb 11, 2016 at 4:42 PM, dotadam notifications@github.com wrote:
|
Version 3.0.2 has now been released which should hopefully have resolved this issue :) |
Very nice, we also hope to see the home page of this project updated as well if you don't mind though this has nothing to do with a bug or any. Thanks again! |
Looks like something is wrong with your nuget environment. Have you tried
|
that was actually a clean project..have you tried re-installing / installing the tesseract package? are you having any issues? because if not, then probably its due to my network security.. |
And, its ok now..hehe my apologies. 👍 |
Hi i have the same issue with 3.2.0-alpha2 when using the GetText() method on x64. By the way i am doing this OCR stuff on parallel programming with .Net task(similar to multi threading). My guess is that it fails when GetText() is called within a multithreaded application like a windows service or any other parallel programming. Could you help me out with this? |
I'm using 3.2.0 alpha x64 GetText() multi-thread without a problem, but you must only have one thread per engine. So, when doing multi-thread create a different engine instance for each. |
Hours after I said it was all working we reproduced the problem. |
Seems to be Page.Recognize(). Another place I see it is here. I don't see ResultRenderer class on the GitHub version of the code. Is this stack wonky or is there a different code set? System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. |
Check out the bevelop branch, master is only for released stable code.
…On Sat, 18 Mar 2017, 09:06 Hintz, ***@***.***> wrote:
Seems to be Page.Recognize(). Another place I see it is here. I don't see
ResultRenderer class on the GitHub version of the code. Is this stack wonky
or is there a different code set?
System.AccessViolationException: Attempted to read or write protected
memory. This is often an indication that other memory is corrupt.
at
InteropRuntimeImplementer.TessApiSignaturesInstance.TessApiSignaturesImplementation.BaseApiRecognize(HandleRef
handle, HandleRef monitor)
at Tesseract.Page.Recognize()
at Tesseract.ResultRenderer.AddPage(Page page)
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#231 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAPzyJXeTP8blc7kLB_IXPKxRfIylheSks5rmwPTgaJpZM4G5H3F>
.
|
Destructor should release unmanaged resources when used without dispose. Would you like me to make a pull so you can review? |
You can, but I'd be surprised if the resources aren't being released since
all classes that manage resources should implement the disposable pattern.
That being said you really shouldn't be relying on the destructor to free
unmanaged resources as you have absolutely no control over the order in
which they're freed and I wouldn't be surprised if you get
accessviolationexception or other unpredictable behaviour.
…On Sat, 18 Mar 2017, 12:23 Hintz, ***@***.***> wrote:
Destructor should release unmanaged resources when used without dispose.
Would you like me to make a pull so you can review?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#231 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAPzyG0fpw_sP9zTMDvfrdx7j_mq6MHVks5rmzH-gaJpZM4G5H3F>
.
|
It isn't the access violation cause. I just noticed. It only matters for those not as careful. |
I can't push the change. Was I supposed to fork and then make the change? |
Yes that's how it normally works. If you just cloned the repo just fork and
change the origin. The exact command/process can be found on stack
overflow.
BTW what class are you looking at changing? As i said all should implement
the disposable pattern and should therefore be cleaning up after
themselves, with the previously mentioned caveats.
…On Sat, 18 Mar 2017, 14:02 Hintz, ***@***.***> wrote:
I can't push the change. Was I supposed to fork and then make the change?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#231 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAPzyEKYB9NfChvuO_YWy_9UgId1YWpLks5rm0k2gaJpZM4G5H3F>
.
|
Page.cs from to
|
I ran a stress test on a memory limited machine and experienced a similar problem when the machine exhausted memory. I repeated the test with 10,000 pages on 2 threads on a dual core with enough memory and did not experience the symptom. |
@charlesw can you please look into below issue: It's same issue but, Tesseract version: 4.0.0.0-beta3 Thanks! |
I am still running into the same issue using Tesseract version 4.1.1 from NuGet. Did anyone manage to resolve this? It would be great if it could at least throw an exception because currently, the try-catch block is not able to catch it. |
While trying to run Samples with attached image. i am getting following error:
An unhandled exception of type 'System.AccessViolationException' occurred in InteropRuntimeImplementer.TessApiSignaturesInstance
Could please help me? Screen shot attached
Thanks,
Satish
The text was updated successfully, but these errors were encountered: