linphone-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Linphone-users] std::bad_cast exceptions in liblinphone/src/db/main


From: Jehan Monnier
Subject: Re: [Linphone-users] std::bad_cast exceptions in liblinphone/src/db/main-db.cpp (4.4.21)
Date: Wed, 31 Mar 2021 17:18:48 +0200

Hi Denis,

Thanks and congratulation for this deep analyze. 
Having common code for both sqlite and mysql is a design choice to maximize code reuse. It implies to make sure sql types are available on both backends.
From your analyse, I understand this is not the case for TINYINT UNSIGNED with current version of SOCI. I saw your patch for SOCi and I definitively think is the right approach as it does not really make sens to perform conversion from string to int at the Linphone level.

My only concern is to understand why never we found this issue? In your e-mail you stated « under certain circumstances» can you elaborate a bit more on such circontancies ?

Best regards


Le 6 mars 2021 à 10:24, Dennis Filder <d.filder@web.de> a écrit :

Hi,

while packaging Linphone Desktop 4.2.5 for Debian Bullseye we ran into
an issue which we want to bring to your attention.  When using an
sqlite3 database it can happen that the chat history is not restored
when the user opens a contact in the UI.  I tracked this down to
several calls to soci_row::get<int>(size_t) in
liblinphone/src/db/main-db.cpp throwing std::bad_cast exceptions.
SOCI's sqlite3 backend under certain circumstances fails to convert
the strings received from the sqlite3 routines to ints, doubles
etc. and passes them along as strings instead which then fails the
dynamic_cast attempt.

I looked at the current HEAD for liblinphone and SOCI and saw that the
issue persists there.  We addressed it from two sides in Debian: first
with explicit checks in main-db.cpp[1].  Secondly, we added the
information SOCI's sqlite3 backend needs to successfully perform the
conversion there[2].

I won't give more details here as they are available in the bug
reports linked below (the second contains a reproducer).

We're also interested in what you'd consider the right way to correct
this as we will have to convince our release team to approve a
last-minute fix.

Thanks in advance,
Dennis Filder.

1: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=983365
2: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=984534

N.B.: I tried to make a gitlab.linphone.org account to report this,
but so far haven't had success.  Is that not possible?

_______________________________________________
Linphone-users mailing list
Linphone-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/linphone-users


reply via email to

[Prev in Thread] Current Thread [Next in Thread]