otland / forgottenserver

A free and open-source MMORPG server emulator written in C++
https://otland.net
GNU General Public License v2.0
1.59k stars 1.06k forks source link

Npc onThink Bug? #535

Closed Tovar closed 10 years ago

Tovar commented 10 years ago

My server crashes after 10~15 mins, I try to find bug with visualstudio13 and I've found this, any idea whats happen?

think

conde2 commented 10 years ago

Paste here your npc, lua and xml files.

Tovar commented 10 years ago

I got the basics script from this repo, but the most part of npc and npc/script are from Printer repo, and I've tried many things changing it, but nothing, and I just want to know if you guys have any kind of way to get the "exactly file" that is giving me this error =/

exura commented 10 years ago

Okey I found out that I have the exact same callstack. I posted my issue in:

https://github.com/otland/forgottenserver/issues/563

So these can be merged?!

ghost commented 10 years ago

Okay, I had this same problem with the same call stack, and I use the printer repo. I had run the server before with no problems, but suddenly it started to crash after 10 - 20 min. I tested if it was my source code modifications but it would still crash with the old compiled version which I had run without problems for hours before.

I tried to make some debug code to see which NPC had an onThink event at the time, but it seemed to be random. I also didn't have the problem before which made it all so strange. Anyway I restarted my computer and my server has run without crashes for 3 hours now and still going.

The strange thing is that it happens after I run the server in debug mode in Visual Studio 2013 (which really slows down my computer), and then closing debug and trying to run it normally. And the only fix for that seems to be to restart my computer. So my guess is that there is no real problem with the source code, but with memory or some computer resource. Which would also explain why people have posted that switching OS fixes the problem. (I use windows 7 with 8 GB RAM btw which is barely enough to run in debug-mode).

Tovar commented 10 years ago

I fix the problem just changing the defaults files from npc folder in printer repo with the files from this repo, hope it helps you guys, there is something wrong with some "default" files on that folder.

Tovar commented 10 years ago

https://github.com/PrinterLUA/FORGOTTENSERVER-ORTS/issues/100?source=cc