{"action":"created","issue":{"url":"https://api.github.com/repos/cyang-kth/fmm/issues/9","repository_url":"https://api.github.com/repos/cyang-kth/fmm","labels_url":"https://api.github.com/repos/cyang-kth/fmm/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/cyang-kth/fmm/issues/9/comments","events_url":"https://api.github.com/repos/cyang-kth/fmm/issues/9/events","html_url":"https://github.com/cyang-kth/fmm/issues/9","id":304018201,"number":9,"title":"Segfault when running fmm","user":{"login":"skinkie","id":502394,"avatar_url":"https://avatars3.githubusercontent.com/u/502394?v=4","gravatar_id":"","url":"https://api.github.com/users/skinkie","html_url":"https://github.com/skinkie","followers_url":"https://api.github.com/users/skinkie/followers","following_url":"https://api.github.com/users/skinkie/following{/other_user}","gists_url":"https://api.github.com/users/skinkie/gists{/gist_id}","starred_url":"https://api.github.com/users/skinkie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skinkie/subscriptions","organizations_url":"https://api.github.com/users/skinkie/orgs","repos_url":"https://api.github.com/users/skinkie/repos","events_url":"https://api.github.com/users/skinkie/events{/privacy}","received_events_url":"https://api.github.com/users/skinkie/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-03-10T00:03:54Z","updated_at":"2018-03-10T20:45:54Z","closed_at":null,"author_association":"NONE","body":"```\r\nProgram received signal SIGSEGV, Segmentation fault.\r\nMM::TransitionGraph::viterbi (this=0x7fffffffe290, pf=0) at app/../src/transition_graph.hpp:126\r\n126             while ((track_cand=track_cand->prev)!=NULL)\r\n(gdb) bt\r\n#0  MM::TransitionGraph::viterbi (this=0x7fffffffe290, pf=0) at app/../src/transition_graph.hpp:126\r\n#1  0x00005555555590ca in main (argc=<optimized out>, argv=<optimized out>) at app/fmm.cpp:105\r\n(gdb) print track_cand\r\n$1 = (MM::Candidate *) 0x0\r\n```\r\nI have used a secondary open dataset (top10nl, with a bit preprocessing) as ubodt input. Then I run nwb-renumbered as GPS on top of it.\r\n\r\n```<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<fmm_config>\r\n    <input>\r\n        <ubodt>\r\n            <file>ubodt-top10nl-500.txt</file>\r\n            <nhash>999983</nhash>\r\n            <multiplier>1815275</multiplier>\r\n        </ubodt>\r\n        <network>\r\n            <file>top10_edges2.shp</file>\r\n            <id>lokaalid</id>\r\n            <source>x</source>\r\n            <target>y</target>\r\n        </network>\r\n        <gps>\r\n            <file>wegvakken_renumbered_28992.shp</file>\r\n            <id>WVK_ID</id>\r\n        </gps>\r\n    </input>\r\n    <parameters>\r\n        <k>4</k>\r\n        <r>100</r>\r\n        <pf>0</pf>\r\n        <gps_error>0.5</gps_error>\r\n    </parameters>\r\n    <output>\r\n        <mode>1</mode>\r\n        <file>mr.txt</file>\r\n    </output>\r\n</fmm_config>\r\n```\r\n\r\nI have validated that the concept below does not result in a segfault, so I would not say it is the GPS input:\r\n```\r\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<fmm_config>\r\n    <input>\r\n        <ubodt>\r\n            <file>ubodt-nwb.txt</file>\r\n            <nhash>999983</nhash>\r\n            <multiplier>1815275</multiplier>\r\n        </ubodt>\r\n        <network>\r\n            <file>wegvakken_renumbered_28992.shp</file>\r\n            <id>WVK_ID</id>\r\n            <source>JTE_ID_BEG</source>\r\n            <target>JTE_ID_END</target>\r\n        </network>\r\n        <gps>\r\n            <file>wegvakken_renumbered_28992.shp</file>\r\n            <id>WVK_ID</id>\r\n        </gps>\r\n    </input>\r\n    <parameters>\r\n        <k>4</k>\r\n        <r>100</r>\r\n        <pf>0</pf>\r\n        <gps_error>0.5</gps_error>\r\n    </parameters>\r\n    <output>\r\n        <mode>1</mode>\r\n        <file>mr.txt</file>\r\n    </output>\r\n</fmm_config>\r\n```"},"comment":{"url":"https://api.github.com/repos/cyang-kth/fmm/issues/comments/372065036","html_url":"https://github.com/cyang-kth/fmm/issues/9#issuecomment-372065036","issue_url":"https://api.github.com/repos/cyang-kth/fmm/issues/9","id":372065036,"user":{"login":"cyang-kth","id":6810084,"avatar_url":"https://avatars2.githubusercontent.com/u/6810084?v=4","gravatar_id":"","url":"https://api.github.com/users/cyang-kth","html_url":"https://github.com/cyang-kth","followers_url":"https://api.github.com/users/cyang-kth/followers","following_url":"https://api.github.com/users/cyang-kth/following{/other_user}","gists_url":"https://api.github.com/users/cyang-kth/gists{/gist_id}","starred_url":"https://api.github.com/users/cyang-kth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyang-kth/subscriptions","organizations_url":"https://api.github.com/users/cyang-kth/orgs","repos_url":"https://api.github.com/users/cyang-kth/repos","events_url":"https://api.github.com/users/cyang-kth/events{/privacy}","received_events_url":"https://api.github.com/users/cyang-kth/received_events","type":"User","site_admin":false},"created_at":"2018-03-10T20:45:54Z","updated_at":"2018-03-10T20:45:54Z","author_association":"OWNER","body":"I think the problem is that **the gps error you used is too small** as you use 0.5 but now the unit is meter. It assumes a normal distribution with standard deviation of 0.5 meter but when the GPS point are far away from the road, the probability is rather small and results in underflow in the optimal path inference in fmm. \r\n\r\n```\r\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<fmm_config>\r\n    <parameters>\r\n        <k>4</k>\r\n        <r>100</r>\r\n        <pf>0</pf>\r\n        <gps_error>0.5</gps_error>\r\n    </parameters>\r\n</fmm_config>\r\n```\r\nI have extracted that first problematic trajectory and the debug shows\r\n```\r\nViterbi start!\r\nstep;from;to;sp;eu;tran_prob;e_prob;cumu_prob\r\n0;127747071;127747071;43.3789;32.2959;0.744508;9.27885e-103;6.90818e-103\r\n0;127747071;127747037;987.845;32.2959;0.0326933;0;0\r\n0;127747071;124480907;66.6335;32.2959;0.48468;0;0\r\n0;127747071;127746785;899.334;32.2959;0.0359109;0;0\r\n0;127746940;127747071;5000;32.2959;0.00645919;9.27885e-103;5.99339e-105\r\n0;127746940;127747037;270.198;32.2959;0.119527;0;0\r\n0;127746940;124480907;273.288;32.2959;0.118175;0;0\r\n0;127746940;127746785;181.687;32.2959;0.177756;0;0\r\n0;127747037;127747071;5000;32.2959;0.00645919;9.27885e-103;5.99339e-105\r\n0;127747037;127747037;18.1256;32.2959;0.561233;0;0\r\n0;127747037;124480907;21.2156;32.2959;0.656912;0;0\r\n0;127747037;127746785;853.916;32.2959;0.037821;0;0\r\n0;124480907;127747071;5000;32.2959;0.00645919;9.27885e-103;5.99339e-105\r\n0;124480907;127747037;921.212;32.2959;0.0350581;0;0\r\n0;124480907;124480907;0;32.2959;0;0;0\r\n0;124480907;127746785;832.7;32.2959;0.0387846;0;0\r\n1;127747071;127747071;11.4288;9.76362;0.854299;6.64191e-204;5.67418e-204\r\n1;127747071;127747037;936.997;9.76362;0.0104201;1.13868e-279;1.18652e-281\r\n1;127747071;124480907;23.2546;9.76362;0.419858;0;0\r\n1;127747071;127746785;861.258;9.76362;0.0113365;0;0\r\n1;127747037;127747071;5000;9.76362;0.00195272;6.64191e-204;1.29698e-206\r\n1;127747037;127747037;916.833;9.76362;0.0106493;1.13868e-279;1.21261e-281\r\n1;127747037;124480907;3.09004;9.76362;0.316485;0;0\r\n1;127747037;127746785;841.094;9.76362;0.0116082;0;0\r\n1;124480907;127747071;5000;9.76362;0.00195272;6.64191e-204;1.29698e-206\r\n1;124480907;127747037;913.742;9.76362;0.0106853;1.13868e-279;1.21672e-281\r\n1;124480907;124480907;0;9.76362;0;0;0\r\n1;124480907;127746785;838.003;9.76362;0.0116511;0;0\r\n1;127746785;127747071;5000;9.76362;0.00195272;6.64191e-204;1.29698e-206\r\n1;127746785;127747037;81.0416;9.76362;0.120477;1.13868e-279;1.37184e-280\r\n1;127746785;124480907;91.6008;9.76362;0.106589;0;0\r\n1;127746785;127746785;5.30283;9.76362;0.543121;0;0\r\nFind last optimal candidate\r\nBack tracking\r\nSegmentation fault (core dumped)\r\n```\r\nAfter setting the GPS error to 50 meters, the problem is addressed\r\n```\r\nViterbi start!\r\nstep;from;to;sp;eu;tran_prob;e_prob;cumu_prob\r\n0;127747071;127747071;43.3789;32.2959;0.744508;0.97678;1.69252\r\n0;127747071;127747037;987.845;32.2959;0.0326933;0.889398;0.99438\r\n0;127747071;124480907;66.6335;32.2959;0.48468;0.884968;1.39423\r\n0;127747071;127746785;899.334;32.2959;0.0359109;0.323589;0.976923\r\n0;127746940;127747071;5000;32.2959;0.00645919;0.97678;0.606027\r\n0;127746940;127747037;270.198;32.2959;0.119527;0.889398;0.706024\r\n0;127746940;124480907;273.288;32.2959;0.118175;0.884968;0.704299\r\n0;127746940;127746785;181.687;32.2959;0.177756;0.323589;0.657237\r\n0;127747037;127747071;5000;32.2959;0.00645919;0.97678;0.601456\r\n0;127747037;127747037;18.1256;32.2959;0.561233;0.889398;1.09431\r\n0;127747037;124480907;21.2156;32.2959;0.656912;0.884968;1.17649\r\n0;127747037;127746785;853.916;32.2959;0.037821;0.323589;0.607386\r\n0;124480907;127747071;5000;32.2959;0.00645919;0.97678;0.546786\r\n0;124480907;127747037;921.212;32.2959;0.0350581;0.889398;0.571658\r\n0;124480907;124480907;0;32.2959;0;0.884968;0.540477\r\n0;124480907;127746785;832.7;32.2959;0.0387846;0.323589;0.553027\r\n1;127747071;127747071;11.4288;9.76362;0.854299;0.954294;2.50778\r\n1;127747071;127747037;936.997;9.76362;0.0104201;0.93779;1.70229\r\n1;127747071;124480907;23.2546;9.76362;0.419858;0.91508;2.07673\r\n1;127747071;127746785;861.258;9.76362;0.0113365;0.408435;1.69715\r\n1;127747037;127747071;5000;9.76362;0.00195272;0.954294;1.09617\r\n1;127747037;127747037;916.833;9.76362;0.0106493;0.93779;1.10429\r\n1;127747037;124480907;3.09004;9.76362;0.316485;0.91508;1.38392\r\n1;127747037;127746785;841.094;9.76362;0.0116082;0.408435;1.09905\r\n1;124480907;127747071;5000;9.76362;0.00195272;0.954294;1.39609\r\n1;124480907;127747037;913.742;9.76362;0.0106853;0.93779;1.40425\r\n1;124480907;124480907;0;9.76362;0;0.91508;1.39423\r\n1;124480907;127746785;838.003;9.76362;0.0116511;0.408435;1.39899\r\n1;127746785;127747071;5000;9.76362;0.00195272;0.954294;0.978787\r\n1;127746785;127747037;81.0416;9.76362;0.120477;0.93779;1.0899\r\n1;127746785;124480907;91.6008;9.76362;0.106589;0.91508;1.07446\r\n1;127746785;127746785;5.30283;9.76362;0.543121;0.408435;1.19875\r\nFind last optimal candidate\r\nBack tracking\r\nOptimal Path candidate index 2 edge id 127747071\r\nOptimal Path candidate index 1 edge_id 127747071\r\nOptimal Path candidate index 0 edge_id 127747071\r\nViterbi ends\r\n```\r\n\r\n\r\n"}}
{"actor":{"display_login":"cyang-kth"}}