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

Use of 0 instead of isc_arg_end to terminate list of ERR_post's (and cousines) arguments is invalid. [CORE1964] #2402

Closed
firebird-automations opened this issue Jun 26, 2008 · 12 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @AlexPeshkoff

When 0 constant is used in vararg function's arguments list, it is passed as 32-bit value, but accepted in many cases as 64-bit. In case of non-zero upper bytes, this may cause various errors when working with status vector.

Commits: 13a15d4 aa7fd05 2f5e932 e33702d 1785fb6 5ac5869 4970aa0 3ce32fb a2e4162

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

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

Target: 2.1.2, 2.0.5 [ 10270, 10222 ]

Fix Version: 2.5 Beta 1 [ 10251 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Claudio Valderrama C. (robocop)

Use something like MsgPrint with SafeArg and put an end to the varargs mess.

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

In HEAD I will follow your good advice. In 2.0 & 2.1 such code rewrite appears wrong to me. Therefore - first step is use of isc_arg_end, next - solution in MsgPrint style.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

Fix Version: 2.1.2 [ 10270 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Leave it not closed cause I plan to have better solution in HEAD.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

Fix Version: 2.0.5 [ 10222 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Final solution was to replace (at least in engine) vararg with a set of special classes, making status vector build safe.

Also done:
- generic cleanup of error reporting functions
- added per-attachment circular strings buffer to avoid conflicts in MT server
When attachment is not available (isc_attach_database() in progress, services, etc.), old server-wide method is used to keep strings permanent. When attachment is dropped and error is present, strings are also re-saved in server-wide buffer.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

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

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: No test => Cannot be tested

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