[Tile-serving] [openstreetmap/osm2pgsql] Test failure in bdd-flex with 1.9.0 (Issue #2041)

Tom Hughes notifications at github.com
Wed Aug 16 10:21:24 UTC 2023


I'm seeing a failure in the bdd-flex test building 1.9.0 on anything other than x86_64 with a failure as follows:

```
  Scenario: Minzoom value in expire output definition has to be in range  # flex/lua-expire-output-definitions.feature:110
    Given the input file 'liechtenstein-2013-08-03.osm.pbf'               # steps/steps_osm_data.py:12
    And the lua style                                                     # steps/steps_execute.py:131
      """
      osm2pgsql.define_expire_output({
          name = 'foo',
          maxzoom = 12,
          minzoom = -3,
          filename = 'somewhere'
      })
      """
    Then running osm2pgsql flex fails                                     # steps/steps_execute.py:163
    And the error output contains                                         # steps/steps_execute.py:193
      """
      Value of 'minzoom' field must be between 1 and 'maxzoom'.
      """
      Assertion Failed: Output 'Value of 'minzoom' field must be between 1 and 'maxzoom'.' not found in error output:
      2023-08-16 09:49:54  osm2pgsql version 1.9.0
      2023-08-16 09:49:54  Database version: 15.3
      2023-08-16 09:49:54  PostGIS version: 3.3
      2023-08-16 09:49:54  Storing properties to table '"public"."osm2pgsql_properties"'.
      2023-08-16 09:49:54  ERROR: No tables defined in Lua config. Nothing to do!
```

I think the problem is that https://github.com/openstreetmap/osm2pgsql/blob/5b3f1c4d6500187b62af63f5e83a08956cc1e18d/src/flex-lua-expire-output.cpp#L61 is fetching the zoom value as unsigned which obviously causes problems with a signed value.

I don't really understand why x86_64 behaves differently though - as far as I can work out `lua_tonumber` returns a double and coercing `-3.0` to `uint32_t` gives zero and then https://github.com/openstreetmap/osm2pgsql/blob/5b3f1c4d6500187b62af63f5e83a08956cc1e18d/src/flex-lua-expire-output.cpp#L65 ought to skip reporting an error on all platforms.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/issues/2041
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/osm2pgsql/issues/2041 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20230816/44773d35/attachment.htm>


More information about the Tile-serving mailing list