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

Better handling of empty/corrupt data #693

Closed
springmeyer opened this issue Aug 7, 2013 · 2 comments
Closed

Better handling of empty/corrupt data #693

springmeyer opened this issue Aug 7, 2013 · 2 comments

Comments

@springmeyer
Copy link
Contributor

I created a set of blank data like:

touch blank.hsgr
touch blank.nodes
...

and a server.ini that pointed to them:

hsgrData=blank.hsgr
nodesData=blank.nodes
edgesData=blank.edges
ramIndex=blank.ramIndex
fileIndex=blank.fileIndex
namesData=blank.names
timestamp=blank.timestamp

I am trying to simulate a failure writing these files and then a server process dynamically trying to read from them. On OS X via node-osrm this should throw at engine initialization but does not. I see suspiciously normal output like:

[i /Users/dane/projects/Project-OSRM/Server/DataStructures/QueryObjectsStorage.cpp:34] loading graph data
[i /Users/dane/projects/Project-OSRM/Server/DataStructures/QueryObjectsStorage.cpp:50] Data checksum is 0
[i /Users/dane/projects/Project-OSRM/Server/DataStructures/QueryObjectsStorage.cpp:56] Loading Timestamp
[i /Users/dane/projects/Project-OSRM/Server/DataStructures/QueryObjectsStorage.cpp:70] Loading auxiliary information
[i /Users/dane/projects/Project-OSRM/Server/DataStructures/QueryObjectsStorage.cpp:82] Loading names index
[i /Users/dane/projects/Project-OSRM/Server/DataStructures/QueryObjectsStorage.cpp:100] All query data structures loaded
[plugin] hello
[plugin] locate
[plugin] nearest
[plugin] timestamp
[plugin] viaroute

Then I can query the engine, which leads to a SIGSEGV:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libOSRM.dylib                   0x000000010241f672 StaticRTree<EdgeBasedGraphFactory::EdgeBasedNode>::RectangleInt2D::GetMinDist(_Coordinate const&) const + 18
1   libOSRM.dylib                   0x000000010241eb1b StaticRTree<EdgeBasedGraphFactory::EdgeBasedNode>::FindPhantomNodeForCoordinate(_Coordinate const&, PhantomNode&, unsigned int) + 123
2   libOSRM.dylib                   0x000000010240b38d ViaRoutePlugin::HandleRequest(RouteParameters const&, http::Reply&) + 2349
3   libOSRM.dylib                   0x0000000102405630 OSRM::RunQuery(RouteParameters&, http::Reply&) + 352
4   _osrm.node                      0x0000000100ad0e1f node_osrm::Engine::runSync(v8::Arguments const&) + 533 (node_osrm.cpp:189)
5   _osrm.node                      0x0000000100ad072b node_osrm::Engine::run(v8::Arguments const&) + 45 (node_osrm.cpp:207)
6   node                            0x0000000100170bdc v8::internal::Builtin_HandleApiCall(v8::internal::(anonymous namespace)::BuiltinArguments<(v8::internal::BuiltinExtraArguments)1>, v8::internal::Isolate*) + 460
@DennisOSRM
Copy link
Collaborator

This is now implemented. Each of the file is checked for existence and file size 0. Errors will be caught like this:

$ ./osrm-routed blank.ini 
[warn] starting up engines, compiled at Aug  9 2013, 16:42:17
[info] loading graph data
[info] Data checksum is 1917857639
. 10% . 20% . 30% . 40% . 50% . 60% . 70% . 80% . 90% . 100% [info] Loading Timestamp
[info] Loading auxiliary information
[fatal error] exception: edges file is empty

As usual, will be running tests now and push shortly afterwards.

@springmeyer
Copy link
Contributor Author

tested, this is working now, closing. Thanks!

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