Changes between Version 1 and Version 2 of Ticket #4979, comment 5


Ignore:
Timestamp:
08/22/21 02:36:13 (3 years ago)
Author:
ezimanyi

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #4979, comment 5

    v1 v2  
    2323
    2424{{{
    25 Breakpoint 1, geography_in (fcinfo=0x55f900000001) at geography_inout.c:138
     25esteban@DESKTOP-9FBND60:~/src/postgis-3.1.3$ sudo gdb -p 19989
     26GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
     27Copyright (C) 2020 Free Software Foundation, Inc.
     28License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
     29This is free software: you are free to change and redistribute it.
     30There is NO WARRANTY, to the extent permitted by law.
     31Type "show copying" and "show warranty" for details.
     32This GDB was configured as "x86_64-linux-gnu".
     33Type "show configuration" for configuration details.
     34For bug reporting instructions, please see:
     35<http://www.gnu.org/software/gdb/bugs/>.
     36Find the GDB manual and other documentation resources online at:
     37    <http://www.gnu.org/software/gdb/documentation/>.
     38
     39For help, type "help".
     40Type "apropos word" to search for commands related to "word".
     41Attaching to process 19989
     42Reading symbols from /usr/local/pgsql/13/bin/postgres...
     43Reading symbols from /lib/x86_64-linux-gnu/libpthread.so.0...
     44Reading symbols from /usr/lib/debug/.build-id/e5/4761f7b554d0fcc1562959665d93dffbebdaf0.debug...
     45[Thread debugging using libthread_db enabled]
     46Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
     47Reading symbols from /lib/x86_64-linux-gnu/libxml2.so.2...
     48(No debugging symbols found in /lib/x86_64-linux-gnu/libxml2.so.2)
     49Reading symbols from /lib/x86_64-linux-gnu/librt.so.1...
     50Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/librt-2.31.so...
     51Reading symbols from /lib/x86_64-linux-gnu/libdl.so.2...
     52Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libdl-2.31.so...
     53Reading symbols from /lib/x86_64-linux-gnu/libm.so.6...
     54Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libm-2.31.so...
     55--Type <RET> for more, q to quit, c to continue without paging--c
     56Reading symbols from /lib/x86_64-linux-gnu/libc.so.6...
     57Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libc-2.31.so...
     58Reading symbols from /lib64/ld-linux-x86-64.so.2...
     59(No debugging symbols found in /lib64/ld-linux-x86-64.so.2)
     60Reading symbols from /lib/x86_64-linux-gnu/libicuuc.so.66...
     61(No debugging symbols found in /lib/x86_64-linux-gnu/libicuuc.so.66)
     62Reading symbols from /lib/x86_64-linux-gnu/libz.so.1...
     63(No debugging symbols found in /lib/x86_64-linux-gnu/libz.so.1)
     64Reading symbols from /lib/x86_64-linux-gnu/liblzma.so.5...
     65(No debugging symbols found in /lib/x86_64-linux-gnu/liblzma.so.5)
     66Reading symbols from /lib/x86_64-linux-gnu/libicudata.so.66...
     67(No debugging symbols found in /lib/x86_64-linux-gnu/libicudata.so.66)
     68Reading symbols from /lib/x86_64-linux-gnu/libstdc++.so.6...
     69(No debugging symbols found in /lib/x86_64-linux-gnu/libstdc++.so.6)
     70Reading symbols from /lib/x86_64-linux-gnu/libgcc_s.so.1...
     71(No debugging symbols found in /lib/x86_64-linux-gnu/libgcc_s.so.1)
     72Reading symbols from /usr/local/pgsql/13/lib/postgis-2.5.so...
     73Reading symbols from /lib/x86_64-linux-gnu/libgeos_c.so.1...
     74(No debugging symbols found in /lib/x86_64-linux-gnu/libgeos_c.so.1)
     75Reading symbols from /lib/x86_64-linux-gnu/libproj.so.15...
     76(No debugging symbols found in /lib/x86_64-linux-gnu/libproj.so.15)
     77Reading symbols from /lib/x86_64-linux-gnu/libjson-c.so.4...
     78(No debugging symbols found in /lib/x86_64-linux-gnu/libjson-c.so.4)
     79Reading symbols from /lib/x86_64-linux-gnu/libprotobuf-c.so.1...
     80(No debugging symbols found in /lib/x86_64-linux-gnu/libprotobuf-c.so.1)
     81Reading symbols from /lib/x86_64-linux-gnu/libgeos-3.8.0.so...
     82(No debugging symbols found in /lib/x86_64-linux-gnu/libgeos-3.8.0.so)
     83Reading symbols from /lib/x86_64-linux-gnu/libsqlite3.so.0...
     84(No debugging symbols found in /lib/x86_64-linux-gnu/libsqlite3.so.0)
     85Reading symbols from /lib/x86_64-linux-gnu/libnss_files.so.2...
     86Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libnss_files-2.31.so...
     87Reading symbols from /usr/local/pgsql/13/lib/postgis-3.so...
     880x00007f590d7eb58a in epoll_wait (epfd=4, events=0x560fce736e80, maxevents=1, timeout=-1) at ../sysdeps/unix/sysv/linux/epoll_wait.c:30
     8930      ../sysdeps/unix/sysv/linux/epoll_wait.c: No such file or directory.
     90(gdb) b geography_in
     91Breakpoint 1 at 0x7f58a5863b5a: geography_in. (2 locations)
     92(gdb) p sizeof(LWGEOM)
     93$1 = 32
     94(gdb) p sizeof(LWPOINT)
     95$2 = 32
     96(gdb) c
     97Continuing.
     98
     99Breakpoint 1, geography_in (fcinfo=0x560f00000001) at geography_inout.c:138
    26100138     {
    27101(gdb) n
     
    49123(gdb)
    50124175             srid_check_latlong(lwgeom->srid);
    51 (gdb) p lwg_parser_result
    52 $11 = {wkinput = 0x55f954a87f00 "Point(1 1)", serialized_lwgeom = 0x0, size = 0, geom = 0x55f954a88638, message = 0x0,
    53   errcode = 0, errlocation = 0, parser_check_flags = 7}
    54125(gdb) p *lwgeom
    55 $12 = {bbox = 0x0, data = 0x55f954a885b8, srid = 0, flags = 0, type = 1 '\001', pad = ""}
     126$3 = {bbox = 0x0, data = 0x560fce6f55d8, srid = 0, flags = 0, type = 1 '\001', pad = ""}
    56127(gdb) p *((LWPOINT *)lwgeom)
    57 $13 = {type = 0 '\000', flags = 0 '\000', bbox = 0x55f954a885b8, srid = 0, point = 0x0}
     128$4 = {type = 0 '\000', flags = 0 '\000', bbox = 0x560fce6f55d8, srid = 0, point = 0x0}
    58129(gdb) p sizeof(LWGEOM)
    59 $14 = 24
     130$5 = 24
    60131(gdb) p sizeof(LWPOINT)
    61 $15 = 32
     132$6 = 32
    62133(gdb) n
    63134178             g_ser = gserialized_geography_from_lwgeom(lwgeom, geog_typmod);
    64135(gdb) s
    65 gserialized_geography_from_lwgeom (lwgeom=0xc2ecd637, geog_typmod=1) at geography_inout.c:90
     136gserialized_geography_from_lwgeom (lwgeom=0xa58fe637, geog_typmod=1) at geography_inout.c:90
    6613790      {
    67138(gdb) n
     
    7014194              lwgeom_set_geodetic(lwgeom, true);
    71142(gdb) s
    72 lwgeom_set_geodetic (geom=0x55f954a885a0, value=32767) at lwgeom.c:953
     143lwgeom_set_geodetic (geom=0x560fce6f55c0, value=32765) at lwgeom.c:953
    73144953     {
    74145(gdb) n
    75146960             FLAGS_SET_GEODETIC(geom->flags, value);
    76 (gdb)
     147(gdb) p *geom
     148$7 = {type = 0 '\000', flags = 0 '\000', bbox = 0x560fce6f55d8, srid = 0, data = 0x0}
     149(gdb) n
    77150961             if ( geom->bbox )
    78151(gdb)
     
    80153(gdb)
    81154964             switch(geom->type)
    82 (gdb) p geom->type
    83 $16 = 0 '\000'
    84 (gdb) p *geom
    85 $17 = {type = 0 '\000', flags = 8 '\b', bbox = 0x55f954a885b8, srid = 0, data = 0x0}
     155(gdb)
     156990                             lwerror("lwgeom_set_geodetic: unsupported geom type: %s", lwtype_name(geom->type));
    86157(gdb)
    87158}}}
    88 What is strange are the sizes of LWGEOM vs LWPOINT reported (24 vs 32). Is there a problem with the alignment ? Is this a consequence of Ubuntu 20.04?
     159
     160The problem are the sizes of LWGEOM vs LWPOINT reported at the beginning (both 32) and after (24 vs 32). Therefore, the definitions of liblwgeom.h from 2.5.5 that are still in my system at /usr/local/include from the previous installation from PostGIS 2.5.5
     161{{{
     162/* POINTYPE */
     163typedef struct
     164{
     165        uint8_t type; /* POINTTYPE */
     166        uint8_t flags;
     167        GBOX *bbox;
     168        int32_t srid;
     169        POINTARRAY *point;  /* hide 2d/3d (this will be an array of 1 point) */
     170}
     171LWPOINT; /* "light-weight point" */
     172}}}
     173are conflicting with the new ones from PostGIS 3.1.3
     174{{{
     175/* POINTYPE */
     176typedef struct
     177{
     178        GBOX *bbox;
     179        POINTARRAY *point;  /* hide 2d/3d (this will be an array of 1 point) */
     180        int32_t srid;
     181        lwflags_t flags;
     182        uint8_t type; /* POINTTYPE */
     183        char pad[1]; /* Padding to 24 bytes (unused) */
     184}
     185LWPOINT; /* "light-weight point" */
     186}}}
     187Maybe the installation for PostGIS 3.x should remove the old versions 2.5.x installed in the system.
     188
     189