Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TinyOWS crash on post requests #50

Open
aperi2007 opened this issue Dec 11, 2012 · 12 comments
Open

TinyOWS crash on post requests #50

aperi2007 opened this issue Dec 11, 2012 · 12 comments

Comments

@aperi2007
Copy link

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.

@ocourtin
Copy link

Andrea,

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

Is it 1.1.0 or trunk ?

@aperi2007
Copy link
Author

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

@ocourtin
Copy link

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>

@aperi2007
Copy link
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.

@aperi2007
Copy link
Author

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

@ocourtin
Copy link

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

./test/unit-test YOUR_POST_REQUEST_FILE_PATH 2

@aperi2007
Copy link
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.

@aperi2007
Copy link
Author

mmhh..

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

@aperi2007
Copy link
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.

@aperi2007
Copy link
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.

@aperi2007
Copy link
Author

opened the ticket #52

@aperi2007
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants