Skip to content

TinyOWS crash on post requests #50

Open

Description

@aperi2007

Hi,

Try-ing this GET request:

http://web.regione.toscana.it/wfsvector/com.rt.wfs.RTmap/wfs?service=WFS&version=1.1.0&request=GetFeature&typename=catasto:rt_cat.idcatbdfog.rt.bb&maxFeatures=10&Filter=<Filter xmlns:wfs="http://www.opengis.net/wfs"><PropertyIsEqualTo><PropertyName>comune</PropertyName><Literal>FIRENZE</Literal></PropertyIsEqualTo></Filter>

I have a good response .

Instead if I send the same request using a POST method Tiny will crash silently:

This is the post request I try

[Tue Dec 11 10:09:30 2012] [EVENT] == Filling Storage == [Tue Dec 11 10:09:30 2012] [QUERY] <?xml version="1.0" encoding="UTF-8"?> <wfs:GetFeature handle="GeoTools 2.7.4 WFS DataStore" outputFormat="text/xml; subtype=gml/3.1.1" resultType="results" service="WFS" version="1.1.0" xmlns="http://www.opengis.net/ogc" maxFeatures="10" xmlns:gml="http://www.opengis.net/gml" xmlns:ambiti_amministrativi="http://www.regione.toscana.it/" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ows="http://www.opengis.net/ows" xmlns:wfs="http://www.opengis.net/wfs"> <wfs:Query srsName="urn:ogc:def:crs:EPSG::25832" typeName="ambiti_amministrativi:idprovince"> <Filter> <PropertyIsEqualTo matchCase="true"> <PropertyName>nome</PropertyName> <Literal>FIRENZE</Literal> </PropertyIsEqualTo> </Filter> </wfs:Query> </wfs:GetFeature>
The log of tiny say nothing else.

Instead from the Tomcat Log I see this error:

INFO: cgi-tinyows: runCGI (stderr):wfs: src/struct/buffer.c:290: buffer_cmp: Assertion `buf' failed.

Activity

  1. ocourtin commented on Dec 12, 2012

    @ocourtin

    Andrea,

    I'm not able to reproduce this error.
    Which TinyOWS version do you use ?

    Is it 1.1.0 or trunk ?

  2. aperi2007 commented on Dec 12, 2012

    @aperi2007
    Author

    I'm using tinyows trunk version on a RedHat Enterprise 6 - 64bit.

  3. ocourtin commented on Dec 12, 2012

    @ocourtin

    Humm quite strange,
    could you load tinyows_demo and provide a sample using world or france layer ?

    On my own i've used this one for instance:

    <?xml version="1.0"?>
    <wfs:GetFeature xmlns="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" 
         xmlns:tows="http://www.tinyows.org/" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ows="http://www.opengis.net/ows" xmlns:wfs="http://www.opengis.net/wfs" outputFormat="text/xml; subtype=gml/3.1.1" resultType="results" service="WFS" version="1.1.0" maxFeatures="10">
      <wfs:Query srsName="urn:ogc:def:crs:EPSG::25832" typeName="tows:france">
        <Filter>
          <PropertyIsEqualTo matchCase="true">
            <PropertyName>nom_dept</PropertyName>
            <Literal>PARIS</Literal>
          </PropertyIsEqualTo>
        </Filter>
      </wfs:Query>
    </wfs:GetFeature>
    
  4. aperi2007 commented on Dec 13, 2012

    @aperi2007
    Author

    Hi,
    I guess this could be an issue of my installation.
    So I'm try-ing to trace the call the buffer_op with the buf variable null-ed.

    Can you say me in what file there is the calls for the GetFeature Requests.

    Thx,
    Andrea.

  5. aperi2007 commented on Dec 13, 2012

    @aperi2007
    Author

    Another information:
    the issue come only with a post request.
    It don't come with a get request.

  6. ocourtin commented on Dec 13, 2012

    @ocourtin

    You could use valgrind and tinyows debug script to help on this:

    ./test/unit-test YOUR_POST_REQUEST_FILE_PATH 2

  7. aperi2007 commented on Dec 26, 2012

    @aperi2007
    Author

    Hi,

    it was not so easy for me.
    However I found something.

    I see the issue is in the
    ows/ows_request.c (at 310 line about)

    I can see that before this line of code

    /* check if VERSION is set and init Version */
    or->version = ows_version_init();

    The 'cgi' variable is properly set.
    I check it with an "assert(cgi)".

    After this function (ows_version_init) the 'cgi' variable is null.
    This happened only when the request is with POST method.

    I don't know at now what happened in that function.

  8. aperi2007 commented on Dec 26, 2012

    @aperi2007
    Author

    mmhh..

    no. The function ows_request_check end correctly.
    I wrong interpret the flow.

  9. aperi2007 commented on Dec 26, 2012

    @aperi2007
    Author

    Perhaps I do a step forward the issue.
    In the "ows_layer.c"

    the function
    list *ows_layer_list_by_ns_prefix(ows_layer_list * ll, list * layer_name_prefix, buffer * ns_prefix)

    in this piece of code:

    for (ln = layer_name_prefix->first; ln ; ln = ln->next) {
    layer_ns_prefix = ows_layer_ns_prefix(ll, ln->value);

    seem to have always NULL the "layer_ns_prefix".

    Now I need to understand why this is always NULL on a POST request.

  10. aperi2007 commented on Dec 26, 2012

    @aperi2007
    Author

    found !

    The issue was in the name of the prefix.

    My config.xml was using:

    <layer ns_prefix='ambiti_amministrativi'
    ns_uri="http://www.regione.toscana.it/"

    The character "_" was not understand from tinyows.
    When I remove it using

    <layer ns_prefix='ambitiamministrativi'
    ns_uri="http://www.regione.toscana.it/"

    It begin to work.

    I guess is better open a specific ticket.

  11. aperi2007 commented on Dec 26, 2012

    @aperi2007
    Author

    opened the ticket #52

  12. aperi2007 commented on Dec 26, 2012

    @aperi2007
    Author

    I found another bug always on the lists of layer.
    Opened another ticket to explain it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ Proxy