udacity/CppND-Route-Planning-Project

terminate called after throwing an instance of 'std::logic_error'

suljaxm opened this issue ยท 10 comments

When I finished the code as required, I don't understand why it can't parse the xml file, especially since I was working before.

../bin/CppND-Route-Planning-Project-master ../map.osm 
Enter start x btw. 0 - 99: 8
Enter start y btw. 0 - 99: 8
Enter end x btw. 0 - 99: 7
Enter end y btw. 0 - 99: 7
terminate called after throwing an instance of 'std::logic_error'
  what():  failed to parse the xml file
Aborted (core dumped)

I caught a similar error like yours.
After compiling, there is an executable file ./OSM_A_star_search in the build directory.

  1. When I execute ./OSM_A_star_search ../map.osm, I got this
./OSM_A_star_search ../map.osm
terminate called after throwing an instance of 'std::logic_error'
  what():  failed to parse the xml file
Aborted (core dumped)
  1. But when adding the parameters -f, I got this
 ./OSM_A_star_search -f ../map.osm
Reading OpenStreetMap data from the following file: ../map.osm
Distance: 0 meters.
terminate called after throwing an instance of 'std::system_error'
  what():  Input/output error
Aborted (core dumped)
  1. Also, I didn't figure out why my ./build/bin directory is empty after building.

By the way, It got segmentation fault during the testing.
After execute ./test in build directory, The test results are below.

Running main() from /home/will/repo/CppND-Route-Planning-Project/thirdparty/googletest/googletest/src/gtest_main.cc
[==========] Running 4 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 4 tests from RoutePlannerTest
[ RUN      ] RoutePlannerTest.TestCalculateHValue
/home/will/repo/CppND-Route-Planning-Project/test/utest_rp_a_star_search.cpp:66: Failure
Expected equality of these values:
  route_planner.CalculateHValue(start_node)
    Which is: 0.031656995
  1.1329799
/home/will/repo/CppND-Route-Planning-Project/test/utest_rp_a_star_search.cpp:67: Failure
Expected equality of these values:
  route_planner.CalculateHValue(end_node)
    Which is: 4.6308042e+27
  0.0f
    Which is: 0
/home/will/repo/CppND-Route-Planning-Project/test/utest_rp_a_star_search.cpp:68: Failure
Expected equality of these values:
  route_planner.CalculateHValue(mid_node)
    Which is: 4.6308042e+27
  0.58903033
[  FAILED  ] RoutePlannerTest.TestCalculateHValue (128 ms)
[ RUN      ] RoutePlannerTest.TestAddNeighbors
/home/will/repo/CppND-Route-Planning-Project/test/utest_rp_a_star_search.cpp:82: Failure
Expected equality of these values:
  neighbors.size()
    Which is: 0
  4
[  FAILED  ] RoutePlannerTest.TestAddNeighbors (142 ms)
[ RUN      ] RoutePlannerTest.TestConstructFinalPath
/home/will/repo/CppND-Route-Planning-Project/test/utest_rp_a_star_search.cpp:102: Failure
Expected equality of these values:
  path.size()
    Which is: 0
  3
Segmentation fault (core dumped)

Any updates on this issue? I'm running into the same problem on my local machine. I'm using Windows, but using the Ubuntu Windows app to run these commands. I stepped with gdb and found that line 79 of main.cpp is throwing this error:
auto display = io2d::output_surface{400, 400, io2d::format::argb32, io2d::scaling::none, io2d::refresh_style::fixed, 30};

Any idea on how to fix this? I get the same error. Running on the Ubuntu windows 10 app

Hi @willhunger did you find a solution, I have exactly the same problem like you :/

Did someone else found the solution for this issue?

Any updates on this? I am having the same problem.

Hi @dbaros and Participants,
This issue is specific for users working on WSL.
We suggest you:

  1. Refer to the Knowledge hub and reach out to your assigned mentor.
  2. Alternatively, you can use a containerized environment, as suggested here #25

Thanks

Same error here on my WSL Ubuntu bash.

too many errors when you are trying to run the project on your local system.

@xiongyu1988 - It seems like an issue with WSL.
We suggest you use either of the following options:

  • Udacity Workspace - Don't forget to reset your workspace before you start.
  • Linux in a VirtualBox
  • Any Linux machine /virtual machine