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
isc_que_events callback function randomly return invalid Update Buffer [CORE5254] #5533
Comments
Modified by: Mahmudov Ilgar S. (maxis)description: I use POST EVENT in triggers and stored procedures. For catching events I try use FIBPlus, but found AV when registering/unregistering Events (50 % times in application staring/closing). I write my own component (similar to FIBPlus super alerter and IBEvents) and found that EventBuffer used in void EventCallback(void *Ptr, short Length, unsigned char *Updated)
} This is floating error. You can 100 times unregister and register again same event list and see this error 20-50 times. => I use POST EVENT in triggers and stored procedures. For catching events I try use FIBPlus, but found AV when registering/unregistering Events (~50 % times in application staring/closing). I write my own component (similar to FIBPlus super alerter and IBEvents) and found that EventBuffer used in void EventCallback(void *Ptr, short Length, unsigned char *Updated)
} This is floating error. You can 100 times unregister and register again same event list and see this error 20-50 times. İ can send all sources |
Commented by: @aafemt In callback you must check that length > 0 in addition to updated != NULL. |
Commented by: Mahmudov Ilgar S. (maxis) İt's already checked in UpdateResultBuffer |
Submitted by: Mahmudov Ilgar S. (maxis)
I use POST EVENT in triggers and stored procedures. For catching events I try use FIBPlus, but found AV when registering/unregistering Events (~50 % times in application staring/closing). I write my own component (similar to FIBPlus super alerter and IBEvents) and found that EventBuffer used in
res = Parent->Database->ClientLibrary->isc_que_events(StatusVector, &DBH, &EventID, EventBufferLen, EventBuffer, (TISC_CALLBACK)EventCallback, PVoid)this);
in sometimes corrupt, because of in EventCallback function receive invalid Updated, witch copied to ResulBuffer and then isc_event_counts copied ResultBuffer to EventBuffer
void EventCallback(void *Ptr, short Length, unsigned char *Updated)
{
if (Ptr && Updated)
{
TMxFBEventsBlockListener *T = (TMxFBEventsBlockListener *)Ptr;
}
//---------------------------------------------------------------------------
void __fastcall TMxFBEventsBlockListener::UpdateResultBuffer(short Length, unsigned char *Updated)
{
if (Length == EventBufferLen && Updated[0] == 1)
memcpy(ResultBuffer, Updated, Length);
else // ---------------------------------------------------> INVALID UPDATED
{
memcpy(ResultBuffer, EventBuffer, EventBufferLen); // this is my patch, witch help call isc_que_events without error 335544973
// bFirstTime = true;
Parent->DoError("MxFBEventsAlerter: Invalid Updated buffer ="+IntToStr(Length), 0);
}
}
This is floating error. You can 100 times unregister and register again same event list and see this error 20-50 times.
İ can send all sources
The text was updated successfully, but these errors were encountered: