RTimothyEdwards / XCircuit

XCircuit circuit drawing and schematic capture tool
GNU General Public License v2.0
97 stars 25 forks source link

Segmentation fault when editing a stair-like line. #2

Closed jabozzo closed 4 years ago

jabozzo commented 4 years ago

System: Ubuntu 18.04.3 LTS Version: Xcircuit v3.8 rev 78 (installed via apt) Bug: Xcircuit crashes when editing a stair-like line. Console says Segmentation fault (core dumped) Steps to reproduce:

Images are provided as an example. The red crosshair indicates where the cursor started. The blue crosshair indicates where the cursor ended and a click was performed.

0 - original line 1 - first click 2 - second click 3 - third click

RTimothyEdwards commented 4 years ago

I cannot reproduce the crash condition, but I can reproduce some aspects of the behavior; specifically, for me, if I do the above steps, I get into a state where clicking the left mouse button no longer moves to the next point; it's stuck on the same point. The segfault is probably somewhat OS (or gcc) dependent, and might be caused by use of an uninitialized variable or something like that. I will track down the problem that I see, and once I have that fixed, you can test and see if that also fixes the segfault (I should be able to tell once I've found the problem, if it could potentially cause a segfault).

Thanks for isolating the problem nicely.

Regards, Tim

RTimothyEdwards commented 4 years ago

If you can do two things for me: (1) Repeat this with Options->Elements->Polygon Edit set to "Normal Edit". (2) Run under the gdb debugger and report which line it crashes on (use gdb on xcircexec, since xcircuit itself is a script, not an executable).

The behavior with the point advance getting stuck on a point clearly has to do with the X vs. Y movement restriction of the "manhattan edit" mode. Since I can't make it crash on my computer, I'm wondering if the crash is related to the stuck position of the edit point, or if it is something different.

jabozzo commented 4 years ago

No problem, I'll test it as soon as I arrive home

jabozzo commented 4 years ago

I did (1), there were no problems even overlapping points on top of each other. For (2), the apt version of xcircuit ships without debugging symbols, so I'll have to first compile xcircuit and the test it.

This week I have some time-critical things to do so probably I will come back on the weekend with the results of (2).

RTimothyEdwards commented 4 years ago

I found the problem with getting stuck on degenerate points. I see nothing that would cause a segfault, though, so I am pushing the fix and will also wait and not close this issue until I have seen what you get from running under the debugger. The update will get mirrored to the git repo overnight (in about 6 hours).

RTimothyEdwards commented 4 years ago

Should I close this issue, or are you still seeing problems?

jabozzo commented 4 years ago

Sorry, I have not been able to test it yet. By tomorrow I'll be able to see if the problem persists.

jabozzo commented 4 years ago

I've tested it. It does not crash and it works :+1: