Malformed string

55 views
Skip to first unread message

Tomasz Dubiel

unread,
Jul 4, 2024, 7:13:57 AMJul 4
to firebird-support
Hello.
How can I access monitoring tables? Regardless whether it's IBExpert with various charsets or ISQL, I get error: "Malformed string".
Oracle Linux Server release 9.2, Firebird 3.0.11 SuperServer.
Best regards,
Tomasz.

Dimitry Sibiryakov

unread,
Jul 4, 2024, 7:17:33 AMJul 4
to firebird...@googlegroups.com
Tomasz Dubiel wrote 04.07.2024 13:13:
> How can I access monitoring tables?

Adding fields one-by-one you can find exactly which field makes problem. Then
cast this field to charset OCTETS or NONE to see what is inside.

--
WBR, SD.

Tomasz Dubiel

unread,
Jul 4, 2024, 7:20:23 AMJul 4
to firebird-support
select 1 from mon$transactions; select 1 from mon$attachments; its enough for an error to appear.

Dimitry Sibiryakov

unread,
Jul 4, 2024, 7:25:23 AMJul 4
to firebird...@googlegroups.com
Tomasz Dubiel wrote 04.07.2024 13:20:
> select 1 from mon$transactions; select 1 from mon$attachments; its enough for an
> error to appear.

Perhaps you have case of https://github.com/FirebirdSQL/firebird/issues/7396

--
WBR, SD.

Tomasz Dubiel

unread,
Jul 4, 2024, 7:26:40 AMJul 4
to firebird-support
How can I identify editing transactions without querying monitonig tables?

Dimitry Sibiryakov

unread,
Jul 4, 2024, 7:28:00 AMJul 4
to firebird...@googlegroups.com
Tomasz Dubiel wrote 04.07.2024 13:26:
> How can I identify editing transactions without querying monitonig tables?

What is "editing transactions" and why you need to identify them?

--
WBR, SD.

Tomasz Dubiel

unread,
Jul 4, 2024, 7:30:05 AMJul 4
to firebird-support
A transaction which modifies data and it is not commited. How do you call it? :-)

Virgo Pärna

unread,
Jul 4, 2024, 7:31:01 AMJul 4
to firebird...@googlegroups.com
On 04.07.2024 14:30, Tomasz Dubiel wrote:
> A transaction which modifies data and it is not commited. How do you
> call it? :-)
>

Pending transaction?

--
Virgo Pärna
Gaiasoft OÜ
vi...@gaiasoft.ee

Tomasz Dubiel

unread,
Jul 4, 2024, 7:34:10 AMJul 4
to firebird-support
Yes :-) I need to identify the transaction which modifies data for too long and it's not commited yet.

Dimitry Sibiryakov

unread,
Jul 4, 2024, 7:34:33 AMJul 4
to firebird...@googlegroups.com
Tomasz Dubiel wrote 04.07.2024 13:30:
> A transaction which modifies data and it is not commited. How do you call it? :-)

I don't need them so I don't call them.
You cannot get these from monitoring tables anyway because there is no
information in the tables that allow you to separate transactions that modified
data and transactions that didn't.
Trace and Audit service is useful for investigation of performance problems.

https://firebirdsql.org/rlsnotesh/rnfb25-trace.html

--
WBR, SD.

Tomasz Dubiel

unread,
Jul 4, 2024, 7:35:54 AMJul 4
to firebird-support
You surely don't understand me :-)
This query gives me all informations I need:
select MST.MON$SQL_TEXT, T.MON$TRANSACTION_ID, T.MON$TIMESTAMP as TRANS_START, A.MON$REMOTE_ADDRESS,
       A.MON$REMOTE_PROCESS, A.MON$REMOTE_PID as REMOTE_PID, A.MON$SERVER_PID as SERVER_PID,
       A.MON$TIMESTAMP as PROCES_START, S.MON$PAGE_READS as PAGE_READS, S.MON$PAGE_WRITES as PAGE_WRITES,
       S.MON$PAGE_FETCHES as PAGE_FETCHES, S.MON$PAGE_MARKS as PAGE_MARKS
from MON$TRANSACTIONS T
join MON$ATTACHMENTS A on (T.MON$ATTACHMENT_ID = A.MON$ATTACHMENT_ID)
join MON$IO_STATS S on (T.MON$STAT_ID = S.MON$STAT_ID)
left join MON$STATEMENTS MST on (T.MON$TRANSACTION_ID = MST.MON$TRANSACTION_ID)
where T.MON$READ_ONLY = 0
order by T.MON$TIMESTAMP

Dimitry Sibiryakov

unread,
Jul 4, 2024, 7:42:44 AMJul 4
to firebird...@googlegroups.com
Tomasz Dubiel wrote 04.07.2024 13:35:
> This query gives me all informations I need:

In this case go and update .NET client if you use it.
Alternatively you can rename all your computers, applications and application
directories to ASCII-only.

--
WBR, SD.

Tomasz Dubiel

unread,
Jul 4, 2024, 7:48:40 AMJul 4
to firebird-support
OK, thanks.
Best regards.

Dimitry Sibiryakov

unread,
Jul 4, 2024, 7:55:29 AMJul 4
to firebird...@googlegroups.com
Tomasz Dubiel wrote 04.07.2024 13:48:
> OK, thanks.

I can try to explain a little:

MON$ATTACHMENTS contain information that is sent by client library (.NET
driver etc). The problem is that this information is validated at monitoring
snapshot generation time instead of attach. So if some malwritten client library
sends malformed string as a host name, application name, etc, it can attach just
fine but any attempt to access monitoring tables end up in the error.
That's why renaming should solve the problem for sure.

--
WBR, SD.

Tomasz Dubiel

unread,
Jul 4, 2024, 8:11:55 AMJul 4
to firebird-support
OK, I understand. I will try to find a guilty .NET program. :-)
However, no client should be able to break monitoring tables, I think.
Best regards.

Mark Rotteveel

unread,
Jul 4, 2024, 10:08:35 AMJul 4
to firebird...@googlegroups.com
It sounds to me this should be addressed though by replacing such
malformed content by a placeholder value instead of throwing an error,
otherwise it is "pretty easy" for a malicious application to break the
monitoring tables.

Mark
--
Mark Rotteveel

Dimitry Sibiryakov

unread,
Jul 4, 2024, 10:13:07 AMJul 4
to firebird...@googlegroups.com
'Mark Rotteveel' via firebird-support wrote 04.07.2024 16:08:
> It sounds to me this should be addressed though by replacing such malformed
> content by a placeholder value instead of throwing an error, otherwise it is
> "pretty easy" for a malicious application to break the monitoring tables.

AFAIU from comments in tracker this issue is solved in v5 though I don't know
in which way.
For me a logical solution would be to validate the values on connect and
refuse attachment if they are invalid.

--
WBR, SD.

Reply all
Reply to author
Forward
0 new messages