Tips for a strange bug in firebird integrated into LibreOffice

10 views
Skip to first unread message

Mike Kaganski

unread,
Sep 3, 2021, 3:14:04 AM9/3/21
to firebird-general
Hi!

I understand that the question is less than ideal, and I'm sorry for that.
I'm trying to debug a very strange bug in Firebird built into LibreOffice (embedded DB functionality). A specific ODB (a package that contains a FB database) crashes executing a query 'SELECT DISTINCT "ТипВорот" FROM "ВОРОТА"', with the field used in the query is a Varchar; and I was able to debug up to the point at Sort::diddleKey, where for some reason the following line:

  const USHORT fill = n - sizeof(USHORT) - vlen;

has n less than (sizeof(USHORT) + vlen), resulting in a large resulting value, which then in the following line:

  memset(fill_pos, fill_char, fill);

results in access violation.

Additionally, the wrong value of vlen seems to be set in the same function at

  ((vary*) p)->vary_length = *((USHORT*) (record + key->skd_vary_offset));

but I fail to follow the logic why that happens.

I tried to extract the database, and use isql tool to perform the same query interactively - and that works fine. I also have cloned and built FB from its github repo in DEBUG mode, in the hope that it could allow me to catch the condition in the debugger - bit in it, the problem is never met.

I actually suspect that our integration might do something wrong initializing the engine, but I am very inexperienced in FB development, and can't easily see what's wrong there.

LibreOffice project uses FB 3. I am debugging on Windows using VS. I would be glad for any advise where to look/put a breakpoint/etc to nail down the project. Possibly my poor description could still make some dev here to tell "Of course, it's Foo; how could he not know that basic thing!" - that would be super-cool :)

Thank you for any advise, and thanks for the great product!

-- 
Best regards,
Mike Kaganski

Mark Rotteveel

unread,
Sep 3, 2021, 3:19:22 AM9/3/21
to firebird...@googlegroups.com
Hi Mike,

This question is more suitable for our development list (firebird-devel)
which is still hosted at SourceForge. You can subscribe at
https://sourceforge.net/projects/firebird/lists/firebird-devel after
subscribing, you can send emails to firebir...@lists.sourceforge.net

Mark Rotteveel
> --
> You received this message because you are subscribed to the Google
> Groups "firebird-general" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to firebird-gener...@googlegroups.com
> <mailto:firebird-gener...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/firebird-general/08f609bc-3799-45e4-8783-1966f2accc3an%40googlegroups.com
> <https://groups.google.com/d/msgid/firebird-general/08f609bc-3799-45e4-8783-1966f2accc3an%40googlegroups.com?utm_medium=email&utm_source=footer>.


--
Mark Rotteveel

Mike Kaganski

unread,
Sep 3, 2021, 4:57:47 AM9/3/21
to firebird-general
Thank you very much for the hint! Sorry for an off-topic (I took this list from https://firebirdsql.org/en/mailing-lists/, where this one is described as " the developer community heartland" :))

Will join that one immediately :)

пятница, 3 сентября 2021 г. в 10:19:22 UTC+3, ma...@lawinegevaar.nl:
Reply all
Reply to author
Forward
0 new messages