Julien ÉLIE julien at trigofacile.com
Tue Dec 22 08:08:09 UTC 2020

Hi Bo,

>> * In ovsqlite/ovsqlite.c, the ovsqlite_open() function does not use
>> its argument "mode". Is it expected?  (for read-only or writable
>> mode)
> The current version doesn't care about the mode.  The right thing to
> do here is to include it in the initial handshake and let the server
> process ignore it.

OK, thanks for the addition.

>> I do not manage to link innd:
>> 21:47 iulius at denver ~/work/inn/trunk/innd% ../libtool --mode=link /home/iulius/work/gcc/gcc-10.1.0/bin/gcc -pie -Wl,-z,relro -Wl,-z,now -o innd art.o cc.o chan.o icd.o innd.o keywords.o lc.o nc.o newsfeeds.o ng.o perl.o proc.o python.o rc.o site.o status.o  util.o wip.o 
> /home/iulius/work/inn/trunk/storage/libstorage.la/home/iulius/work/inn/trunk/history/libinnhist.la/home/iulius/work/inn/trunk/lib/libinn.la  
> -ldb -lz /home/iulius/work/inn/trunk/lib/perl.o -Wl,-E  
> -fstack-protector -L/usr/local/lib  
> -L/usr/lib/x86_64-linux-gnu/perl/5.20/CORE -lperl -ldl -lm -lpthread 
> -lcrypt -L/usr/lib -lpython2.7 -lpthread -ldl -lutil -lm -L/usr/lib -lz 
> -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro
>> /home/iulius/work/inn/trunk/storage/.libs/libstorage.so: undefined reference to `unpack_now'
>> /home/iulius/work/inn/trunk/storage/.libs/libstorage.so: undefined reference to `unpack_later'
>> /home/iulius/work/inn/trunk/storage/.libs/libstorage.so: undefined reference to `pack_later'
>> /home/iulius/work/inn/trunk/storage/.libs/libstorage.so: undefined reference to `pack_now'
> That is strange.  The pack_* and unpack_* functions are defined
> in ovsqlite-private.c, which should be in METHOD_SOURCES.

Works fine now...  I don't know why it did not work yesterday, but well, 
let's consider it's now fixed.

> I've collected fixes for the issues discussed so far:
>   * #ifdef HAVE_SQLITE3 in ovsqlite-private.c
>   * unused mode in ovsqlite_open
>   * static fill_search_buffer
>   * cast alignment warnings
> Delta patch attached to this message (in git diff format, complain if that
> doesn't work for you).

Applied without problem, thanks!

Also, a minor patch to silent other warnings:

--- storage/ovsqlite/ovsqlite-server.c.OLD	2020-12-22 08:33:16.513653482 
+++ storage/ovsqlite/ovsqlite-server.c	2020-12-22 08:35:06.608337788 +0100
@@ -185,7 +185,7 @@

-client_t *add_client(
+static client_t *add_client(
      int sock)
      client_t *result;
@@ -215,7 +215,7 @@
      return result;

-void del_client(
+static void del_client(
      client_t *client)
      size_t ix;
@@ -1766,12 +1766,10 @@
  static void do_finish_expire(
      client_t *client)
-    buffer_t *reqbuf;
      int changes;
      int64_t groupid = 0;

-    reqbuf = client->request;
      if (!finish_request(client))

I'm now encountering two shift-negative-value errors (building with 
"make warnings"):

ovsqlite/ovsqlite-server.c: Dans la fonction « pack_length »:
ovsqlite/ovsqlite-server.c:482:27: erreur: décalage vers la gauche d'une 
valeur négative [-Werror=shift-negative-value]
   482 |     *--walk = length | (~0<<(9-lenlen));
       |                           ^~
ovsqlite/ovsqlite-server.c: Dans la fonction « unpack_length »:
ovsqlite/ovsqlite-server.c:501:20: erreur: décalage vers la gauche d'une 
valeur négative [-Werror=shift-negative-value]
   501 |     length = c&~(~0<<(8-lenlen));
       |                    ^~
ovsqlite/ovsqlite-server.c: Dans la fonction « open_db »:
ovsqlite/ovsqlite-server.c:591:9: erreur: « SQLITE_PREPARE_PERSISTENT » 
non déclaré (première utilisation dans cette fonction)
       |         ^~~~~~~~~~~~~~~~~~~~~~~~~

For this last one, it seems that SQLITE_PREPARE_PERSISTENT was 
introduced in SQLite 3.20.0.
Should INN require that recent version (August 2017) at configure time?
Or #if SQLITE_VERSION_NUMBER >= 3020000 added there?
And also around sqlite3_prepare_v3 in sqlite-helper.c and use 
sqlite3_prepare_v2 before 3.20.0?

If I do not take into account the first 2 warnings, and manually use 
sqlite3_prepare_v2, the remaining of the build works fine with SQLite from Debian Jessie.  Good news!

Julien ÉLIE

« – Ouvre l'œil, et le bon !
   – L'autre, je peux pas encore l'ouvrir, je risque pas de me
     tromper ! » (Astérix)

More information about the inn-workers mailing list