[Xastir] problems with xastir

Tom Russo russo at bogodyn.org
Thu Dec 20 15:19:11 EST 2012


On Thu, Dec 20, 2012 at 12:52:05PM -0700, we recorded a bogon-computron collision of the <russo at bogodyn.org> flavor, containing:
> > >
> > > It *may* be possible to use these newer versions of BDB with Xastir --- if
> > > so, then all it will take is changing that loop, rebootstrapping, reconfiguring,
> > > and rebuilding.  But AFAIK nobody has tested it with such a new version.
> > >
> > > If you test Xastir and find that map caching works just fine with BDB 5.1,
> > > then I'll happily modify the acinclude.m4 file in CVS.
> > 
> > I did get a 'yes' to everything except GDAL at the end of the
> > configure script (left GDAL out on purpose).  Help about shows
> > 'map_caching' as one of the libraries used.
> 
> How odd.   I can't see how Xastir's configure would find that.
> 
> Look at your config.log --- when it reports that it found a BDB, does it 
> say it is using -ldb5.1 or something like it (search down for where it
> is probing for berkeley db, and it should say first:
> 
> checking for a library containing db_create
> 
> and much later something like:
> 
> result: -ldbXXX
> 
[...]
> The only question in my mind is whether maybe you ALSO have a 4.x version
> installed and it's finding that.  "Help->About" doesn't actually report the
> db version it found, only whether it found a usable one (in which case it
> reports "map_caching" as a "library used" which is misleading).

It gets worse than xastir's configure not just probing for 5.x versions.  The
map_cache.c code actually will NOT do anything right with version 5.x.  
It contains an ifdef set-up like this:

#if  (DB_VERSION_MAJOR<4)   /** DB_VERSION Check **/
#error DB_VERSION_MAJOR < 4 

#elif (DB_VERSION_MAJOR==4 && DB_VERSION_MINOR<=0 )

    if ((mc_ret = dbp->open(dbp,
            mc_database_filename , NULL, DB_CREATE, DB_BTREE, 0664)) != 0) {

        dbp->err(dbp, mc_ret, "%s", mc_database_filename);
        db_strerror(mc_ret); 
    }
#elif    (DB_VERSION_MAJOR==4 && DB_VERSION_MINOR>=1 )

    if ((mc_ret = dbp->open(dbp,
            NULL,mc_database_filename, NULL, DB_CREATE, DB_BTREE, 0664)) != 0) {

        dbp->err(dbp, mc_ret, "%s", mc_database_filename);
        db_strerror(mc_ret); 
    }

#endif  /** DB_VERSION Check **/

Thus, if DB_VERSION_MAJOR is less than 4, fail, if equal to 4, then do
some set-up based on minor version number (because 4.0 and 4.1 had slightly
different APIs), and if version is greater than 4, do absolutely nothing.

This pattern is followed *EVERYWHERE* that the "open" function of the db
library is called.  So if you're actually linking db5.1 in, then map caching
is NOT working, because it is never opening the database.  I can't see what
the code would actually do --- it looks like when it gets a pointer to
the database structure it tries to call "get" and "put" on things, and may
silently pass through and do nothing (not even output) if those fail.  One
has to turn on debug level 512 to see some output in case that get and put are
called and fail.

If you have map caching working, then it's because you also have a 4.x 
db installed.  If you're linked against 5.1 (and I can't see how you could be)
then map caching isn't working.

Someone will probably need to update the map_cache code to allow it to work
with db 5.x.  With the popularity of OSM tiles, I doubt very many people are 
using the old online maps that still use the map_cache code --- the OSM code
does NOT use it, and caches tiles without the aid of Berkeley DB.

-- 
Tom Russo    KM5VY   SAR502   DM64ux          http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236        http://kevan.org/brain.cgi?DDTNM
 echo "prpv_a'rfg_cnf_har_cvcr" | sed -e 's/_/ /g' | tr [a-m][n-z] [n-z][a-m]

 





More information about the Xastir mailing list