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

On startup #28

Closed nclx closed 11 years ago

nclx commented 11 years ago

tfs: /home/nclx/Documents/mygit/forgottenserver/src/luascript.h:300: static ScriptEnvironment* LuaScriptInterface::getScriptEnv(): Assertion `m_scriptEnvIndex >= 0 && m_scriptEnvIndex < 16' failed. Aborted (core dumped)

?

marksamman commented 11 years ago

Try applying the patch from the referenced commit and see if that solves it

nclx commented 11 years ago

tfs: /home/nclx/Documents/mygit/forgottenserver/src/luascript.h:301: static ScriptEnvironment* LuaScriptInterface::getScriptEnv(): Assertion `m_scriptEnvIndex >= 0 && m_scriptEnvIndex < 17' failed. Aborted (core dumped)

dalkon commented 11 years ago

I do not get this problem, do you have some sort of broken script?

nclx commented 11 years ago

Server was working in previous commits (7e02d7f) from aug 02... the only thing that I did was replacing the new binary (latest commit by now), I also modified the global.lua (to add new group constants), added channel folder (latest), added groups to XML (latest)...

The database is also old so I guess it also have to do the optimizations (moving player skills to players etc) in that case it would be the only new script in the server (the database migrations) and chat channel scripts

dalkon commented 11 years ago

I just copied the latest data folder and started the server, works just fine. Edit: works on windows and debian for me.

nclx commented 11 years ago

Now that you said that, I tried replacing my data to new data, and it still crashed so I tested with clean DB and worked... problem is happening upgrading to database 15:

Updating database to version 15 (moving groups to data/XML/groups.xml) tfs: /home/nclx/Documents/mygit/forgottenserver/src/luascript.h:301: static ScriptEnvironment* LuaScriptInterface::getScriptEnv(): Assertion `m_scriptEnvIndex >= 0 && m_scriptEnvIndex < 17' failed. Aborted (core dumped)

This is how groups.xml ends up after it:

<?xml version="1.0" encoding="UTF-8"?> < groups >

^ with no spaces

(obviously not how its suposed to be) replacing it with the latest groups.xml wont fix it because it keeps trying to edit it and the result will be the same, is not a permission problem neither (i gave full permision to the file, didnt work, tried executing as root, didnt work neither)

nclx commented 11 years ago

Yup... I edited 14.lua and deleted all the file modification part leaving only the DB changes and the drop_group and server optimized everything perfectly, the error is somewhere in the file edition part

dalkon commented 11 years ago

I believe the error is that there is no "reserve/release"ScriptEnv() functions in the source part, because its possible that the file do not flush the written data quickly enough before it dies.

marksamman commented 11 years ago

Can you check if this is still happening after this commit 6a2806ed14f010df72cb6b93726cd6dccfd5336b?

nclx commented 11 years ago

Apparently is fixed now