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

plot may run off end of data #31

Open
rgobbel opened this issue Mar 19, 2021 · 0 comments
Open

plot may run off end of data #31

rgobbel opened this issue Mar 19, 2021 · 0 comments

Comments

@rgobbel
Copy link

rgobbel commented Mar 19, 2021

If the table driving a plot shrinks, Plot2D.GenPlotXY can run off the end of the data, causing a segfault. The problematic code (that I know of) is at line 205 of xyplot.go:

199	// Use string labels for X axis if X is a string
200	xc := pl.Table.Table.Cols[xi]
201	if xc.DataType() == etensor.STRING {
202		xcs := xc.(*etensor.String)
203		vals := make([]string, pl.Table.Len())
204		for i, dx := range pl.Table.Idxs {
205			vals[i] = xcs.Values[dx]
206		}
207		plt.NominalX(vals...)
208	}

In the case that I've seen, the table had 15 entries for the first phase of a run, and was then resized to only 10 rows for the second phase. I've worked around the issue in the calling code by calling IdxView.DeleteInvalid after shrinking the data source table, but I really think there should be a check somewhere in etable itself.

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

1 participant