Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 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 4 years ago.
test.dot (747 bytes) - added by anonymous 4 years ago.
dot file which yields exception

Download all attachments as: .zip

Change History (9)

Changed 4 years ago by anonymous

Attachment: boost-test.cpp added

Changed 4 years ago by anonymous

Attachment: test.dot added

dot file which yields exception

comment:1 in reply to:  description Changed 4 years ago by anonymous

exception message is:

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

comment:2 Changed 4 years ago by anonymous

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 Changed 4 years ago by anonymous

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 Changed 4 years ago by Jeremiah Willcock

Component: Nonegraph
Owner: set to Jeremiah Willcock

comment:5 Changed 4 years ago by Jeremiah Willcock

Resolution: fixed
Status: newclosed

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

comment:6 Changed 4 years ago by Jeremiah Willcock

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 Changed 4 years ago by anonymous

thank you!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jeremiah Willcock.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.