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

events not working - isc_event_block returns different buffer length for same events [CORE5889] #6147

Open
firebird-automations opened this issue Aug 10, 2018 · 4 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Sorien (sorien)

often events are not working in my app I found that for same event like "EVENT_MYTABLE_FOO" isc_event_block returns different buffer lengths like 27 and 7 (FEventBufferLen in code bellow)
when it returns 27 everything is working but when i returns 7 app will not get any event

it looks like bug for me, but i can't find any documentation for that function, its maybe more support question but really don't know how to use your mailing list :/

code
procedure TDBEventThread.RegisterEvents;
var
sib_event_block: Tsib_event_block;

function EBP(Index: Integer): PAnsiChar;
begin
if (Index > FEvents.Count) then
Result := nil
else
Result := PAnsiChar(AnsiString(FEvents[Index - 1]));
end;

begin
FEventBuffer := nil;
FResultBuffer := nil;
FEventBufferLen := 0;
FFirstTime := True;

FEventCount := Min(FEvents.Count, IB_MAX_EVENT_BLOCK);

sib_event_block := Tsib_event_block(FPlainDriver.GetFirebirdAPI.isc_event_block);
FEventBufferLen := sib_event_block(@FEventBuffer, @FResultBuffer, FEventCount, EBP(1), EBP(2), EBP(3), EBP(4), EBP(5), EBP(6), EBP(7), EBP(8), EBP(9), EBP(10), EBP(11), EBP(12), EBP(13), EBP(14), EBP(15));
end

@firebird-automations
Copy link
Collaborator Author

Commented by: @mrotteveel

Subscribing to the mailing list is a matter of sending an email to mailto:firebird-support-subscribe@yahoogroups.com, wait to be subscribed (currently Yahoo Groups has some hickups, so it might take a few hours), and after you have been subscribed you can then email your question to mailto:firebird-support@yahoogroups.com. That's it.

@firebird-automations
Copy link
Collaborator Author

Commented by: Sorien (sorien)

as far as i see in code returned event buffer (event_buffer) should contain "#⁠1#⁠(len of event name)..." but from time to time it returns just "#⁠1#⁠1"

@firebird-automations
Copy link
Collaborator Author

Commented by: @aafemt

Your inner routine returns pointer to already freed (and possible reused) memory. It cannot work.

@firebird-automations
Copy link
Collaborator Author

Commented by: Sorien (sorien)

@dimitry Sibiryakov you are right, thank you

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

No branches or pull requests

1 participant