Skip to content
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 output written in mysql_log from mysql_tquery/mysql_pquery is corrupted #120

Closed
Konstantinos-Sk opened this issue Sep 17, 2016 · 13 comments

Comments

@Konstantinos-Sk
Copy link
Contributor

Konstantinos-Sk commented Sep 17, 2016

Version R41.

I was testing if some certain errors are given in OnQueryError and just noticed that:

[ERROR] €¬q
[ERROR] ÈÏ/ 
[ERROR] Ä 
[ERROR] ¸¶/ 

I executed the same faulty query and each time random characters are given.

@Konstantinos-Sk
Copy link
Contributor Author

Konstantinos-Sk commented Sep 17, 2016

Another one I just found: using cache_num_rows() to a place without active cache reports line 182 from a_mysql.inc file which actually makes sense since the function is in the include. Instead of calling cache_get_row_count, is there any other way to report the previous place was called from for that specific function?

@maddinat0r
Copy link
Collaborator

Which query were you executing?
And I'm already aware of that problem with calling natives in non-public functions. I'm working on a way to incorporate a small AMX call trace into log calls.

@Konstantinos-Sk
Copy link
Contributor Author

Konstantinos-Sk commented Sep 18, 2016

So far any query with error in the syntax or table/column that does not exist.

@Konstantinos-Sk
Copy link
Contributor Author

I run samp-server.exe many times because of testing and I mostly click on X button instead of typing exit. I get the message that "SA-MP dedicated server has stopped working". I downgrade to R40 and this doesn't happen. Updated to R41 again to make sure and it happens.

@Konstantinos-Sk
Copy link
Contributor Author

It's getting even more weird. Since today morning, when a fault query (table does not exist) is executed, samp-server.exe stops working immediately. I don't know if the debug output from Visual Studio is at all useful: http://pastebin.com/raw/Vb8vbQyb

@maddinat0r
Copy link
Collaborator

maddinat0r commented Sep 19, 2016

I can't seem to reproduce the error message bug with a query like SEuLECT 1234 or SELECT * FROM invalidtable.
I also can't reproduce the "server stopped working" issue. The log core reacts when you press the X button and shuts down itself correctly, but this is already implemented in R40. There are no notable changes between the log-core used in R40 and the one in R41. The worst thing you should experience is a "freeze" when pressing the X button. That means the log core is writing all remaining logs into their log files in background.
And that error code you receive on crash stands for INVALID_CRUNTIME_PARAMETER, and I'm not really sure if this is caused by the MySQL plugin nor the log core.
If you're running this through Visual Studio, you could compile everything in Debug configuration and launch your SA:MP server through the Visual Studio debugger. This way you should get more descriptive error messages.

@maddinat0r
Copy link
Collaborator

Can you also tell me more about your setup (system, used plugins, used includes, ...)?

@maddinat0r
Copy link
Collaborator

I think I managed to reproduce that error gibberish string bug.

@Konstantinos-Sk
Copy link
Contributor Author

I'm not sure if I can manage to link them all together and compile the plugin myself.

In the AppVeyor, the "Configuration: Debug" option does anything useful? Because if I run it, I get: http://i.imgur.com/S7UJrTY.png

maddinat0r added a commit that referenced this issue Sep 19, 2016
@maddinat0r
Copy link
Collaborator

Yes, the AppVeyor debug build should work too. You can press "Retry" in that window and the debugger should open with a call trace somewhere. Take a look at that trace and you should see if that crash was really caused within the SA:MP server or an other plugin.

@Konstantinos-Sk
Copy link
Contributor Author

Konstantinos-Sk commented Sep 19, 2016

The second box is given all the time when clicking "Retry" and no debugger opens. I tried the version for the commit above but the problem still persists.

Windows 7 64-bit
plugins running: only mysql
script:

#include <a_samp>
#include <a_mysql>

main() {}

public OnGameModeInit()
{
    mysql_connect("127.0.0.1", "root", "...", "R40");

    mysql_tquery(MYSQL_DEFAULT_HANDLE, "SELECT * FROM usrs", "OLD", "");
    return 1;
}

forward OLD(); public OLD() {}

@Konstantinos-Sk
Copy link
Contributor Author

Konstantinos-Sk commented Sep 20, 2016

I finally found the reason causing all this. I was testing the specifiers in logtimeformat (server.cfg) and I apparently had an invalid specifier.

I also re-downloaded the last compiled version and it reports the errors again.

@maddinat0r
Copy link
Collaborator

Ah, I see. I should probably check if the datetime format string is valid first and then set it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants