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

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

Closed
suljaxm opened this issue Aug 13, 2019 · 10 comments
Closed

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

suljaxm opened this issue Aug 13, 2019 · 10 comments

Comments

@suljaxm
Copy link

suljaxm commented Aug 13, 2019

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)
@willhunger
Copy link

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.

@willhunger
Copy link

willhunger commented Sep 28, 2019

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)

@stevenoh93
Copy link

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};

@knaaga
Copy link

knaaga commented May 6, 2020

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

@Abraxas707
Copy link

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

@Abraxas707
Copy link

Did someone else found the solution for this issue?

@ghost
Copy link

ghost commented Jul 2, 2020

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

@SudKul
Copy link
Contributor

SudKul commented Feb 23, 2021

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 Add dockerized Ubuntu environment #25

Thanks

@SudKul SudKul closed this as completed Feb 23, 2021
@xiongyu1988
Copy link

xiongyu1988 commented Jun 18, 2021

Same error here on my WSL Ubuntu bash.

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

@SudKul
Copy link
Contributor

SudKul commented Jun 18, 2021

@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

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

7 participants