SA-MP Forums Archive
db_free_result crashes the server - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP (https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: Bug Reports (https://sampforum.blast.hk/forumdisplay.php?fid=20)
+--- Thread: db_free_result crashes the server (/showthread.php?tid=251368)



db_free_result crashes the server - Finn - 26.04.2011

If you use db_free_result twice on the same result, it will crash the server (sometimes it works, though).

I know it's the scripter's own stupidity to do so, but IMO it shouldn't crash the server.


Re: db_free_result crashes the server - [03]Garsino - 26.04.2011

So this is what has been crashing my server? =/

I just started with SQL and got this problem, haha.


Re: db_free_result crashes the server - armyoftwo - 26.04.2011

Same with MySQL plugin. Sometimes it crashes, sometimes it doesn't.
pawn Code:
mysql_free_result()



Re: db_free_result crashes the server - Calgon - 26.04.2011

Confirmed.

Quote:
Originally Posted by armyoftwo
View Post
Same with MySQL plugin. Sometimes it crashes, sometimes it doesn't.
pawn Code:
mysql_free_result()
SQLite is natively included in SA-MP, MySQL is not.


Re: db_free_result crashes the server - [MWR]Blood - 26.04.2011

Quote:
Originally Posted by armyoftwo
View Post
Same with MySQL plugin. Sometimes it crashes, sometimes it doesn't.
pawn Code:
mysql_free_result()
No, it's not the same.
My server actually never crashed, or at least not because of that.


Re: db_free_result crashes the server - Calgon - 26.04.2011

...this isn't a bug report for the MySQL plugin.


Re: db_free_result crashes the server - thiaZ_ - 26.04.2011

Why should this be a bug, you don't have to free the same result twice...


Re: db_free_result crashes the server - Calgon - 26.04.2011

...because the server crashes maybe and scripting mistakes are [generally speaking] inevitable?


Re: db_free_result crashes the server - Sergei - 27.04.2011

Server also crashes if you want to open file from non existant directory. I guess that is much more important issue than this, since you must be really *someword* to frre result more than one time.

And also server crashes if field's value is NULL.


Re: db_free_result crashes the server - Finn - 27.04.2011

For me the server didn't crash directly at the function db_free_result, which obviously would've been easier for me (and I wouldn't have even reported this), but the weird thing was that the server called the next few callbacks properly before crashing.

I found that the bug was where it was after going through every single line and every single function from the point player connects to the point he/she spawns, even debugging the script didn't help, because like I said the moment the server crashed was jumping around.

Which is why I feel this, unlike those crashes Sergei reported, should be fixed because it's extremely sneaky one and I don't want anyone else to go through the same I did.