Open firebird-automations opened 8 years ago
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 if (Length == EventBufferLen && Updated[0] == 1)
Commented by: @hvlad
It looks like recently fixed CORE5521 Is it still actual ?
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