Hi Steve, <br>I could not reproduce the crashing bug in my pc. I have created the st table from data as you instructed. Here is the summary:<br><br>routing=# \d st;<br>                               Table "<a href="http://public.st">public.st</a>"<br>
  Column  |       Type       |                    Modifiers                     <br>----------+------------------+--------------------------------------------------<br> gid      | integer          | not null default nextval('st_gid_seq'::regclass)<br>
 id       | double precision | <br> source   | double precision | <br> target   | double precision | <br> cost     | numeric          | <br> rev_cost | numeric          | <br> the_geom | geometry         | <br>Indexes:<br>
    "st_pkey" PRIMARY KEY, btree (gid)<br>    "st_the_geom_gist" gist (the_geom)<br>Check constraints:<br>    "enforce_dims_the_geom" CHECK (st_ndims(the_geom) = 2)<br>    "enforce_geotype_the_geom" CHECK (geometrytype(the_geom) = 'MULTILINESTRING'::text OR the_geom IS NULL)<br>
    "enforce_srid_the_geom" CHECK (st_srid(the_geom) = 4326)<br><br>The table has 41580 rows. Then first I run the the following query and got the mentioned output<br><br>routing=# select * from bidir_dijkstra_shortest_path('select gid as id, source::integer, target::integer, cost::double precision as cost, rev_cost:: double precision as reverse_cost from st', 1187405, 1187508, true, true); <br>
 vertex_id | edge_id |       cost       <br>-----------+---------+------------------<br>   1187405 |   28874 | 11.3385436250298<br>   1187406 |   28819 |  16.928515840577<br>   1187508 |      -1 |                0<br>(3 rows)<br>
<br><br>After that I ran your query, just changing some of the variables, like gid in place of link_idand cost and rev_cost respectively in place of cost_time and rcost_time respectively. This query also returned the mentioned result without any problem. <br>
<br>routing=# select * from st, (select gid, the_geom from bidir_dijkstra_shortest_path('select gid as id, source::integer, target::integer, cost::double precision as cost, rev_cost:: double precision as reverse_cost from st a', 1187405, 1187508, true, true), st where edge_id = gid) as rt where st.gid = rt.gid; <br>
<br>  gid  |    id    | source  | target  |       cost       |     rev_cost     |                                                   the_geom                                                   |  gid  |                                                   the_geom                                                   <br>
-------+----------+---------+---------+------------------+------------------+--------------------------------------------------------------------------------------------------------------+-------+--------------------------------------------------------------------------------------------------------------<br>
 28819 | 25345248 | 1187508 | 1187406 |  16.928515840577 |  16.928515840577 | 0105000020E610000001000000010200000002000000B806B64AB038B4BFEF38454772C9494059A31EA2D11DB4BFBD5296218EC94940 | 28819 | 0105000020E610000001000000010200000002000000B806B64AB038B4BFEF38454772C9494059A31EA2D11DB4BFBD5296218EC94940<br>
 28874 | 25345111 | 1187405 | 1187406 | 11.3385436250298 | 11.3385436250298 | 0105000020E610000001000000010200000002000000F623456458C5B3BF44696FF085C9494059A31EA2D11DB4BFBD5296218EC94940 | 28874 | 0105000020E610000001000000010200000002000000F623456458C5B3BF44696FF085C9494059A31EA2D11DB4BFBD5296218EC94940<br>
(2 rows)<br><br>I have run several other queries with success.<br>I am not sure what is causing your server crash. It will be very helpul if you provide some more information on the server like memory etc. I am running ubuntu 12.04 on a core i5 processor with 4GB memory. Another thing may be helpful, running shortest_path instead of bidir_dijkstra_shortest_path first. If it runs correct, then we are sure that every other things are right with the query. Then just change the shortest_path to bidir_dijkstra_shortest_path.<br>
<br>I am still trying to break it. Please let me know if there are other ways to do it.<br><br>-Razequl<br><br><div class="gmail_quote">On Mon, Jul 2, 2012 at 6:51 PM, Razequl Islam <span dir="ltr"><<a href="mailto:ziboncsedu@gmail.com" target="_blank">ziboncsedu@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Steve,<br>I downloaded the csv file and used my test application. But it ran fine and produced the following output:<br>
<br>1187405 | 25345111 | 11.338544<br>1187406 | 25345248 | 16.928516<br>1187508 | -1  | 0.000000<br>
<br>I ran some other queries on the graph but could not crash the program. So I suspect the problem may lie in the wrapper classes. I will create a table and run the query.<span class="HOEnZb"><font color="#888888"><br><br>
-Razequl</font></span><div class="HOEnZb"><div class="h5"><br><br><br><div class="gmail_quote">
On Mon, Jul 2, 2012 at 10:25 AM, Stephen Woodbridge <span dir="ltr"><<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Argh! sorry my bad. Try:<br>
<br>
<a href="http://imaptools.com:8080/dl/test.tgz" target="_blank">http://imaptools.com:8080/dl/<u></u>test.tgz</a><br>
<br>
-Steve<div><br>
<br>
On 7/1/2012 11:45 PM, Razequl Islam wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Steve,<div><br>
I am trying to download the csv but ending up with 404 Not Found error.<br>
Please confirm the URL works. I am also getting the same problem with<br>
<a href="http://imaptools.com/dl/test.tgz" target="_blank">http://imaptools.com/dl/test.<u></u>tgz</a><br>
<br>
-Razequl<br>
<br>
On Sun, Jul 1, 2012 at 7:37 PM, Stephen Woodbridge<br></div><div><div>
<<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a> <mailto:<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.<u></u>com</a>>> wrote:<br>
<br>
    Razqequl,<br>
<br>
    I have not looked into the reason, but my intuition it that it may<br>
    be because this graph has about 50K edges so it will be larger than<br>
    most anything that you generated by hand, and the edge and node<br>
    numbers are very large because this is an extract from a 10s of<br>
    million of edges graph. There were no error message other than the<br>
    generic postgresql message the the server crashed. You will probably<br>
    fine you have a segv in your test program.<br>
<br>
    I can download a zipped copy of the csv file. The first row is the<br>
    column names.<br>
<br>
    <a href="http://imaptools.com/dl/bdsp-" target="_blank">http://imaptools.com/dl/bdsp-</a> big-bug.zip<br>
    <<a href="http://imaptools.com/dl/bdsp-big-bug.zip" target="_blank">http://imaptools.com/dl/bdsp-<u></u>big-bug.zip</a>><br>
<br>
    -Steve<br>
<br>
<br>
    On 7/1/2012 5:18 AM, Razequl Islam wrote:<br>
<br>
        Hi Steve,<br>
        Bad news :(<br>
<br>
        As I mentioned, I already have a test application to read from text<br>
        file, it will be very helpful if you send me a csv file<br>
        containing the<br>
        graph. Also please let me know if there is any error message. I am<br>
        looking into my code for a possible reason.<br>
<br>
        -Razequl<br>
<br>
        On Sun, Jul 1, 2012 at 3:19 AM, Stephen Woodbridge<br>
        <<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a> <mailto:<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.<u></u>com</a>><br></div></div>
        <mailto:<a href="mailto:woodbri@swoodbridge" target="_blank">woodbri@swoodbridge</a>. com<div><div><br>
        <mailto:<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.<u></u>com</a>>>> wrote:<br>
<br>
             Hi Razequl,<br>
<br>
             I tried a larger test and it crashed the server.<br>
<br>
             You can test it like this:<br>
<br>
             # fetch a test file from my server<br>
             wget <a href="http://imaptools.com/dl/test" target="_blank">http://imaptools.com/dl/test</a>. tgz<br>
             <<a href="http://imaptools.com/dl/test" target="_blank">http://imaptools.com/dl/test</a>. tgz<br>
        <<a href="http://imaptools.com/dl/test.tgz" target="_blank">http://imaptools.com/dl/test.<u></u>tgz</a>>><br>
<br>
             # extract the tarfile into directory test<br>
             tar xzf test.tgz<br>
<br>
             # load the file into your test database into table "st"<br>
             shp2pgsql -s 4326 -c -D -I -N skip test/bdsp-bug.shp st |<br>
        psql -U<br>
             user -h localhost mydatabase<br>
<br>
             # get into psql or pgadmin and run the following<br>
             psql -U user -h localhost mydatabase<br>
             SELECT * FROM st, (<br>
                            SELECT gid,the_geom<br>
                              FROM bidir_dijkstra_shortest_path(<br>
                                'SELECT link_id  as id,<br>
                                         source::integer,<br>
                                         target::integer,<br>
                                         cost_time::double precision as<br>
        cost ,<br>
                                         rcost_time as reverse_cost<br>
                                   FROM st a',<br>
                                1187405,<br>
                                1187508,<br>
                                true,<br>
                                true<br>
                       ), st where edge_id = link_id<br>
                  ) as rt<br>
                  WHERE st.gid=rt.gid;<br>
<br>
             This crashes my server!<br>
<br>
             If you want to write a testmain.cpp, I can provide the<br>
        graph data in<br>
             a csv file that you could read in and pass to your code<br>
        instead of<br>
             the query to get the data from table st.<br>
<br>
             -Steve<br>
             ______________________________ _________________<br>
             pgrouting-dev mailing list<br>
        <a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a><br>
        <mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.<u></u>osgeo.org</a>><br></div></div>
        <mailto:<a href="mailto:pgrouting-dev@lists" target="_blank">pgrouting-dev@lists</a>. <a href="http://osgeo.org" target="_blank">osgeo.org</a><div><br>
        <mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.<u></u>osgeo.org</a>>><br>
        <a href="http://lists.osgeo.org/" target="_blank">http://lists.osgeo.org/</a> mailman/listinfo/pgrouting-dev<br>
             <<a href="http://lists.osgeo.org/" target="_blank">http://lists.osgeo.org/</a> mailman/listinfo/pgrouting-dev<br></div>
        <<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/pgrouting-dev</a><u></u>> ><div><br>
<br>
<br>
<br>
<br>
<br>
        ______________________________ _________________<br>
        pgrouting-dev mailing list<br>
        <a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a> <mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.<u></u>osgeo.org</a>><br>


        <a href="http://lists.osgeo.org/" target="_blank">http://lists.osgeo.org/</a> mailman/listinfo/pgrouting-dev<br>
        <<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/pgrouting-dev</a><u></u>><br>
<br>
<br>
<br>
    ______________________________ _________________<br>
    pgrouting-dev mailing list<br>
    <a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a> <mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.<u></u>osgeo.org</a>><br>


    <a href="http://lists.osgeo.org/" target="_blank">http://lists.osgeo.org/</a> mailman/listinfo/pgrouting-dev<br>
    <<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/pgrouting-dev</a><u></u>><br>
<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
pgrouting-dev mailing list<br>
<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/pgrouting-dev</a><br>
<br>
</div></blockquote><div><div>
<br>
<br>
______________________________<u></u>_________________<br>
pgrouting-dev mailing list<br>
<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/pgrouting-dev</a><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>