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

Server crashes during prepare or throws incorrect parsing error if the remotely passed SQL query is empty [CORE3554] #3910

Closed
firebird-issue-importer opened this issue Jul 13, 2011 · 24 comments

Comments

@firebird-issue-importer

Submitted by: Gregori Arjona (garjona)

Attachments:
drwtsn32.log

In several of our servers we detected regular crashes of firebird, 1 or 2 times a day, we have set to record drwatson memory dumps and found that every time an error occurs is in the same line of code during the GDS_DSQL_PREPARE.

C:\src\Firebird-2.1.4.18393-0\src\dsql\dsql.cpp

line 1373

if (!length) {
length = strlen(string); <----- firebird crashes here.
}

Whe can attach "user.dmp" and "drwtsn32.log"

Commits: ac96c3a 23241eb acb020f

====== Test Details ======

Test was made only for 3.0 because 2.5 allows to pass in ES much longer string than 32K.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 13, 2011

Modified by: Gregori Arjona (garjona)

description: In several of our servers we detected regular blocks, we have set to record drwatson memory dumps and found that every time an error occurs in the same line of code during the GDS_DSQL_PREPARE.

C:\src\Firebird-2.1.4.18393-0\src\dsql\dsql.cpp

line 1373

if (!length) {
length = strlen(string); <----- firebird crashes here.
}

Whe can attach "user.dmp" and "drwtsn32.log"

=>

In several of our servers we detected regular crashes of firebird, 1 or 2 times a day, we have set to record drwatson memory dumps and found that every time an error occurs is in the same line of code during the GDS_DSQL_PREPARE.

C:\src\Firebird-2.1.4.18393-0\src\dsql\dsql.cpp

line 1373

if (!length) {
length = strlen(string); <----- firebird crashes here.
}

Whe can attach "user.dmp" and "drwtsn32.log"

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 13, 2011

Modified by: Gregori Arjona (garjona)

Attachment: drwtsn32.log [ 11974 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 13, 2011

Modified by: Gregori Arjona (garjona)

environment: Windows 2003, Firebird 2.1.4.18393 win32, Firebird odbc 2.0.0.148/2.0.0.151. => Windows 2003 standard edition 4gb RAM
Runing on VMware Esxi server
Firebird 2.1.4.18393 win32
Firebird odbc 2.0.0.148/2.0.0.151.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 13, 2011

Commented by: @dyemanov

What was the fbclient.dll version used to connect the server? Was a connection local or remote (TCP)?

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 13, 2011

Commented by: Gregori Arjona (garjona)

- fbclient.dll version 2.1.4.18393
- Remote TCP conection to the server.

I'm trying to upload a memory dump on an external server, because the file is too large.

Here is:
http://www.tempfiles.net/download/201107/203491/user_dmp.html

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 13, 2011

Commented by: @dyemanov

Also, SuperServer or Classic?

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 13, 2011

Commented by: Gregori Arjona (garjona)

Sorry, SuperServer version.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 13, 2011

Commented by: @dyemanov

I confirm the problem.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 13, 2011

Commented by: @dyemanov

Well, we can surely fix the server to not crash. But I'm not sure it will magically resolve your issues, as the actual problem lies on the client side. Your application either passes the empty SQL text to prepare, or passes a "too long" SQL text (64KB or 128KB etc) so its length becomes zero as a result of conversion into USHORT (unsigned 16-bit integer) which represents the supported SQL text length.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 13, 2011

Commented by: Gregori Arjona (garjona)

Ok, do you think the problem may be related to the ODBC drivers?, because I am sure that my application does not send empty or too big, SQL queries.

If so, then i ask for help to the developer of the ODBC drivers.

Thank you very much, Dmitry.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 13, 2011

Commented by: @dyemanov

Honestly, I don't know. You could start with the call tracing enabled (in the ODBC settings) and find out the last statements before the server crashes. It might give some ideas for further searching. Or you might try the next (tomorrow's) snapshot build of v2.1.5 which would have the crash supposedly fixed and test it in the field. If I'm right, you'll get the proper error reported and this could be enough to have the reason debugged on your side by adding the error logging into the application.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 13, 2011

Modified by: @dyemanov

Version: 2.5.0 [ 10221 ]

Version: 2.0.6 [ 10303 ]

Version: 3.0 Initial [ 10301 ]

Version: 1.5.6 [ 10225 ]

Version: 2.1.3 [ 10302 ]

Version: 2.1.2 [ 10270 ]

Version: 2.0.5 [ 10222 ]

Version: 2.1.1 [ 10223 ]

Version: 2.0.4 [ 10211 ]

Version: 2.1.0 [ 10041 ]

summary: Lot of crashes during sql_prepare with Access violation - code c0000005 error => Server crashes during prepare or throws incorrect parsing error if the remotely passed SQL query is empty

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 13, 2011

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 13, 2011

Modified by: @dyemanov

Fix Version: 2.1.5 [ 10420 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 13, 2011

Modified by: @dyemanov

status: Open [ 1 ] => In Progress [ 3 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 15, 2011

Commented by: Gregori Arjona (garjona)

Hello Dmitry.

Now i'm testing the snapshot build of v2.1.5 and the server does not crash, but on another server i have a diferent problem, the server crashes in a diferent way, i post the link to the server memory dump, can you have a look ? or i need to create a new issue.

http://www.tempfiles.net/download/201107/203954/user_dmp_15072011.html

Thank you very much

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 15, 2011

Commented by: @dyemanov

What is the FB version/build on that another server? 2.1.4.18393 or some snapshot build?

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 15, 2011

Commented by: Gregori Arjona (garjona)

It's Firebird 2.1.4.18393.

This server also suffers from the same problem of errors during prepare, but this new error occurs more times a day.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 15, 2011

Modified by: @dyemanov

Fix Version: 2.5.1 [ 10333 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 15, 2011

Commented by: @dyemanov

It's a known issue, already reported as CORE3409. It is going to be fixed in a few days.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 21, 2011

Modified by: @dyemanov

status: In Progress [ 3 ] => Open [ 1 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 21, 2011

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 23, 2013

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 27, 2015

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: Done successfully

Test Details: Test was made only for 3.0 because 2.5 allows to pass in ES much longer string than 32K.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment