Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#8681 closed Bugs (fixed)

read_graphviz throws exception with file that dot program reads successfully

Reported by: anonymous Owned by: Jeremiah Willcock
Milestone: To Be Determined Component: graph
Version: Boost 1.49.0 Severity: Showstopper
Keywords: read_graphviz Cc:

Description

program exhibiting behavior attached as boost-test.cpp. compiled on g++ (Debian 4.7.2-5) 4.7.2.

compile with "g++ -Wall -std=c++11 -O2 -lboost_system -lboost_graph -o boost-test boost-test.cpp"

dot file attached as test.dot, and pasted below: digraph "flow_graph" {

graph [ ]; node [

shape = "box"

]; edge [ ]; "0" [

label = "_WinMainCRTStartup:\lpush ebp\lmov ebp, esp\lsub esp, 18h\land esp, 0FFFFFFF0h\lmov [esp+18h+var_18], offset _main\lcall _cygwin_crt0\lmov [esp+18h+var_10], 0\lmov [esp+18h+var_14], 0\lmov [esp+18h+var_18], 0\lcall _cygwin_premain0\lmov [esp+18h+var_10], 0\lmov [esp+18h+var_14], 0\lmov [esp+18h+var_18], 0\lcall _cygwin_premain1\lmov [esp+18h+var_10], 0\lmov [esp+18h+var_14], 0\lmov [esp+18h+var_18], 0\lcall _cygwin_premain2\lmov [esp+18h+var_10], 0\lmov [esp+18h+var_14], 0\lmov [esp+18h+var_18], 0\lcall _cygwin_premain3\lleave\lretn\l"

];

node 0 }

Attachments (2)

boost-test.cpp (6.5 KB ) - added by anonymous 9 years ago.
test.dot (747 bytes ) - added by anonymous 9 years ago.
dot file which yields exception

Download all attachments as: .zip

Change History (9)

by anonymous, 9 years ago

Attachment: boost-test.cpp added

by anonymous, 9 years ago

Attachment: test.dot added

dot file which yields exception

in reply to:  description comment:1 by anonymous, 9 years ago

exception message is:

Invalid start token for statement (token is "<eof> ")

comment:2 by anonymous, 9 years ago

the comment at boost-test.cpp:5 is incorrect- test_dot was not null-terminated. (std::string was constructed from it using begin and end iterators).

comment:3 by anonymous, 9 years ago

from some experimentation, it appears that deleting line 12 in test.dot (i.e. the line containing a comment) causes the exception to not be thrown from read_graphviz.

comment:4 by Jeremiah Willcock, 9 years ago

Component: Nonegraph
Owner: set to Jeremiah Willcock

comment:5 by Jeremiah Willcock, 9 years ago

Resolution: fixed
Status: newclosed

(In [84725]) Changed comments to be non-greedy; fixes #8681

comment:6 by Jeremiah Willcock, 9 years ago

I fixed that issue. Your code still breaks because you do not define a "shape" property in your dynamic_properties object, but the file appears to parse correctly.

comment:7 by anonymous, 9 years ago

thank you!

Note: See TracTickets for help on using tickets.