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

Segmentation Fault in GraphIO.writeGML #3

Open
Prezma opened this issue Jan 30, 2023 · 2 comments
Open

Segmentation Fault in GraphIO.writeGML #3

Prezma opened this issue Jan 30, 2023 · 2 comments

Comments

@Prezma
Copy link

Prezma commented Jan 30, 2023

The following code causes a segmentation fault:

from ogdf_python import ogdf

G = ogdf.Graph()
GA = ogdf.GraphAttributes(G, ogdf.GraphAttributes.all)
G.newNode()

ogdf.GraphIO.write(GA, "foo.gml", ogdf.GraphIO.writeGML)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In [1], line 8
      5 GA = ogdf.GraphAttributes(G, ogdf.GraphAttributes.all)
      6 G.newNode()
----> 8 ogdf.GraphIO.write(GA, "foo.gml", ogdf.GraphIO.writeGML)

TypeError: static bool ogdf::GraphIO::write(const ogdf::GraphAttributes& GA, const std::string& filename, ogdf::GraphIO::AttrWriterFunc writer = nullptr) =>
    TypeError: none of the 4 overloaded methods succeeded. Full details:
  static bool ogdf::GraphIO::writeGML(const ogdf::ClusterGraph& C, std::ostream& os) =>
    TypeError: could not convert argument 1
  static bool ogdf::GraphIO::writeGML(const ogdf::ClusterGraphAttributes& A, std::ostream& os) =>
    TypeError: could not convert argument 1
  static bool ogdf::GraphIO::writeGML(const ogdf::Graph& G, std::ostream& os) =>
    TypeError: could not convert argument 1
  static bool ogdf::GraphIO::writeGML(const ogdf::GraphAttributes& A, std::ostream& os) =>
    SegmentationViolation: segfault in C++; program state was reset
@N-Coder
Copy link
Member

N-Coder commented Oct 8, 2023

This even happens when the right overhead is selected manually (and no pythonizations are used)

ogdf.GraphIO.write(
    GA, "foo.gml", 
    #ogdf.GraphIO.writeGML.__wrapped__
    ogdf.GraphIO.writeGML.__wrapped__.__overload__("const ogdf::GraphAttributes&, std::ostream&")
)
SegmentationViolation: static bool ogdf::GraphIO::write(const ogdf::GraphAttributes& GA, const std::string& filename, ogdf::GraphIO::AttrWriterFunc writer = nullptr) =>
    SegmentationViolation: static bool ogdf::GraphIO::writeGML(const ogdf::GraphAttributes& A, std::ostream& os) =>
    SegmentationViolation: segfault in C++; program state was reset

@N-Coder
Copy link
Member

N-Coder commented Apr 2, 2024

Possibly related problem on MacOS when trying to display graphs:
Screenshot 2024-04-02 at 11 33 44

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