opensocsysarch / CoreGenPortal

OpenSoC System Architect CoreGen Portal Graphical User Interface
http://www.systemarchitect.tech/
Apache License 2.0
1 stars 0 forks source link

UI seg faults when loading malformed yaml #59

Closed fconlon closed 4 years ago

jleidel commented 4 years ago

Do you have a test case for this?

fconlon commented 4 years ago

One that I saw was when the endpoints were saving as

Endpoints: [ ]

There were a couple of others that I saw as I was fixing the edit/add node functionality, but I was going to use that one for testing.

jleidel commented 4 years ago

One that I saw was when the endpoints were saving as

Endpoints: [ ]

There were a couple of others that I saw as I was fixing the edit/add node functionality, but I was going to use that one for testing.

This is reflected in the Yaml reader test 90: https://github.com/opensocsysarch/CoreGen/blob/devel/test/Yaml/Reader/TEST90.yaml

This currently passes without an issue.

fconlon commented 4 years ago

It is possible that Changes since I made this issue may have already fixed it. I was planning to look into this issue when I got home from work tonight. Another test case that gave me issues before was when I messed up the indentation on the YAML. Some of the test cases looked like they loaded ok, but didn't properly fill the DAG and then seg faulted when I tried to reload it or inspect a node info node. I think the endpoints was a case of the former. It didn't load properly and then seg faulted when I clicked the load button to try to load a file I knew was correct.

fconlon commented 4 years ago

In general I think what I noticed before is that if a an error is generated on the backend during reading the UI will look like it loads, but the data loaded is incomplete or non-existent. If you try to open the file again or inspect nodes when malformed yaml was loaded it would seg fault. I still have to look into this, but I believe that anything that generates a CG error on the backend during reading should cause this problem. If the issue has been fixed by changes that were made since I created it then I may be able to close this without making any changes.

fconlon commented 4 years ago

I have tried several things that I saw causing this to seg fault before and do not appear to be able to recreate the issue. This appears to have been fixed by other fixes that were added to the either the backend or the portal. I'm going to move this into the test column of the project board for the time being. I'll leave it there for a couple days to see if I can run back into the issue while I'm working then if I don't run into I'll move this to done

fconlon commented 4 years ago

@jleidel I just saw this https://github.com/opensocsysarch/CoreGenPortal/pull/114 . Are these fixes for this issue?

jleidel commented 4 years ago

Those fixes were targeted at stopping the seg faults. For valid Yaml, i think we may be good. However, if there issues in the indentation, then the yaml is technically invalid. It would be cool if there was some sort of Lit routine to ensure the yaml is valid with respect to indentation prior to sending it through yaml-cpp. We can open an issue on the CoreGen repo for this as a future enhancement

fconlon commented 4 years ago

On the front end this morning the indentation issue appeared to place a log into the logpane that said that the yaml couldn't be loaded. Everything that I was doing before that caused the faults appeared to put a message into the log pane and cause no futher issues. The message was very generic though. Do we want to add more targeted messages to the logpane to let the user know exactly what was wrong with the yaml? It could log output from the lint routine if we add that to the backend.

jleidel commented 4 years ago

We can add this to the Lit enhancement (see below).
https://github.com/opensocsysarch/CoreGen/issues/195

jleidel commented 4 years ago

I can't get this to fail with issues in the indentation. I need a test case that fails

fconlon commented 4 years ago

I haven't been able to reproduce this in the last week or so either. I think it may have been fixed in commits that have been pushed to either the UI or Backend since I made the issue. I know for sure I saw it with the endpoints issue I mentioned before. The seg fault occured when I loaded something that would trigger a CoreGenError. It wouldn't load properly and would seg fault when I clicked open to try to reopen it. I suspected it was segfaulting when it was trying to delete things when the open click attempted to close the project and delete the old dag. The UI was segfaulting in the exact same way when I was producing incorrect yaml as I was figuring out the add/edit node functionality. There I noticed that it was producing these faults when a coregen error caused the yamlreader to return false. It would fault when it reopened the file after closing and then saving it. The last several times that I have attempted to reproduce this though it has correctly displayed an error message in the log pane and allowed me to try to reopen a file without seg faulting. If you can't reproduce it either at this point then I would feel fairly confident in saying that some other commit has had a side effect of fixing this issue. If that's the case then I'll move this from test to done, but I'm not sure what other commit might have fixed it.

jleidel commented 4 years ago

https://github.com/opensocsysarch/CoreGen/issues/195 has been closed

jleidel commented 4 years ago

I believe this issue is complete.