Artikash / Textractor

Extracts text from video games and visual novels. Highly extensible.
GNU General Public License v3.0
2.09k stars 203 forks source link

Option to ignore threads #127

Closed scese250 closed 5 years ago

scese250 commented 5 years ago

In Higurashi Ch.1 with 07th Mod Patcher I got a lot of threads and after a while the program crash, it's possible to ignore everything else to prevent the crash?

Image

Artikash commented 5 years ago

How does it crash? Any error message?

scese250 commented 5 years ago

Error code: E06D7363 Error address: 74F9B152 Error in module: C:\Windows\System32\KERNELBASE.dll Additional info: 74EC0000 Additional info: .?AVbad_alloc@std@@ Additional info: bad allocation Additional info: 19930520 Additional info: CE3F50C Additional info: F3E504


Threads keep increasing and then I get this message before crash.

Kiru-Ufo commented 5 years ago

ITHVNR and the likes handle this issue, by simply ignoring new threads after a certain amount (i.e. 30) is reached. That's probably the best way to deal with thread spammers, especially also thinking about performance.

scese250 commented 5 years ago

ITHVNR and the likes handle this issue, by simply ignoring new threads after a certain amount (i.e. 30) is reached. That's probably the best way to deal with thread spammers, especially also thinking about performance.

Hmm, ITHVNR seems can't get text from the game, and sometimes crash without getting the text.

Artikash commented 5 years ago

So first of all, the problem is not that there are too many threads. "bad allocation" means that you ran out of memory/RAM. This means that there was too much text stored inside of the internal buffers of Textractor which used up all your memory. ITHVNR does have a hard cap on the amount of threads, but that's not the only reason it's more robust in this situation. The main reason is that ITHVNR has a hard cap on the internal text buffer size https://github.com/Artikash/Textractor/blob/9c91a0f7fb0ccc986d3760744f27472bb473a184/vnr/texthook/host/textthread_p.h#L82 after which it is cleared. The latter cap will be introduced in the next Textractor release and will solve the crash.

scese250 commented 5 years ago

Thanks for clarifying, waiting for next release.

Artikash commented 5 years ago

Should be solved in 4.0.0.

ghost commented 3 years ago

Not sure why this was closed, the issue is definitely still active. Not fixed as of latest release

Artikash commented 3 years ago

Are you getting a bad_alloc error? That's what was fixed - Textractor crashing. The flood of threads is kinda unavoidable because Unity is such a large game engine that Textractor must hook a lot of things to reliably automatically catch the text, though you can manually configure as described in https://github.com/Artikash/Textractor/issues/307 to fix that.

Anfangermon commented 3 years ago

Hi, I have a question about textractor. How can I use the translation from deepl?

vikas2316 commented 2 years ago

It's still happening (bad_alloc error). It occurs randomly in any game. textractor bad alloc