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
[crash] in making 2D offset of a circle #6538
Comments
Also happens in the Linux version. |
Even though I'm not familiar with the code base at all, I at least know where the crash occurs for me, but not the why. |
I did, left some GDB data there. This has to be an OCCT bug. |
This is a major show stopper in many cases. I'm kind of surprised that this wouldn't get more rapid care, or at least identify if it is indeed an OCCT bug. If that's the case, does it also affect arcs? I have not had the chance to test that case. |
The problem is that we cannot do much if it is an OCC bug. We reported many bugs to the OCC guys, even patches but they don't care much. I mean there are for example patches around for more than one year and there were not considered for OCC 7.6. |
I understand that, but knowing what the issue is can render a work-around. |
I had a look at this. It segfaults deep in OCC and there is probably nothing we can do. |
For now I have resorted to doing some python code to do what I need specificlly, however it's not for normal/regular use. That said... If it is deep inside OOC, there's a total possibility to do the size changes in python, and generate a new or replacement toposhape. It might be a bit of work to re-implement, but is totally possible. |
What do you mean? |
@donovaly that was my question. If a Windows binary compiled with SEH crashes, there are very few chances that we can recover from the segfault. So probably useless spending time trying to catch the fault in FreeCAD. ;) |
...and why I suggest writing it in Python ;-) |
The user can already draw a new circle. So there is a workaround. However, nothing we can do not -> removing it from the milestone |
@donovaly one thing we can probably do as we catch the first segfault is warn the user and advise to cancel in-progress operation, save open documents and restart FC. Is it worth? |
If we can avoid a crash, then yes. But I cannot judge before seeing it in action. |
In this case crash appears only on the 2nd call of the function, so yes, if user stops after 1st call, probably we can avoid the crash. |
This would be great. Even when it "only" cures the issue for Linux, a crash prevention is welcome. |
I did a PoC and admittedly, this is a complete failure. :) |
That's because the first call applies the changes to the exterior wires of the toposhape. The second call does any internal holes. |
Still, maybe we could report this OCC bug. There's always a chance that they will fix this one. |
Please x-post the OCC bug to this thread so we can discuss in more depth. Thanks! |
Yes, it's worth doing, especially if we can develop a DRAW.exe test case -- and in fact, including a patch is counterproductive, since they literally cannot use it (the submitter usually has not signed the CLA, and without the copyright assignment they simply can't use the supplied code). If we have a proof-of-concept patch I can manually re-write it (so the copyright is mine) and submit it as a PR to them, though, since I have signed the CLA. |
For reference, here's a backtrace of the failure on a debug build of OCCT 7.7.0dev:
|
FWIW Python workaround:
|
Only thought now is to figure out how the "work around" can be implemented within the resize function, or I could preprocess the wires if a circle would end up a bug tripper. |
Here's a brute force fix that basically takes @Roy-043 's workaround, and makes it happen in the makeOffset2D code. I don't know if this should proceed, or we just wait for the eventual upstream fix. |
Personally, for what I needed to do 2D stuff, I just convert to/from shapely, which humorously is faster than OCC, since it can leverage all 24 CPUs here. I was able to process 10,000, complex edge polygons (some containing 1000 edges) in under 3 seconds instead of the ridiculous 3 to 4 hours that it took OCC to do the same exact thing, and that included the conversion between the formats. |
Forums discussion
https://forum.freecadweb.org/viewtopic.php?p=577963#p577963
Version
0.20 (Development)
Full version info
Subproject(s) affected?
Part
Issue description
result: as soon as you entered "-0.1" and then click out of the line edit of the task dialog FC crashes with illegal storage access in "BRepOffsetAPI_MakeOffset"
The text was updated successfully, but these errors were encountered: