Ultimaker / Cura

3D printer / slicing GUI built on top of the Uranium framework
GNU Lesser General Public License v3.0
6.11k stars 2.06k forks source link

Slicing hangs with certain STL's on macOS when using version 4.8.0 #9072

Open coatezy opened 3 years ago

coatezy commented 3 years ago

When slicing certain STL's on macOS, CuraEngine is crashing.

Application version 4.8.0

Platform macOS Catalina 10.15.6

Printer Creality Ender 3

Reproduction steps

Actual results Slicing hangs

Log file Process: CuraEngine [22538] Path: /Applications/Ultimaker Cura.app/Contents/MacOS/CuraEngine Identifier: CuraEngine Version: 0 Code Type: X86-64 (Native) Parent Process: cura [393] Responsible: cura [393] User ID: 501

Date/Time: 2021-01-04 20:35:32.129 +0000 OS Version: Mac OS X 10.15.6 (19G2021) Report Version: 12 Anonymous UUID: 4C425F56-C5F7-720C-CFA6-CCF0EC7E7307

Time Awake Since Boot: 3600 seconds

System Integrity Protection: enabled

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY

Application Specific Information: dyld2 mode abort() called terminating with uncaught exception of type std::length_error: vector

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x00007fff68d8233a pthread_kill + 10 1 libsystem_pthread.dylib 0x00007fff68e3ee60 pthread_kill + 430 2 libsystem_c.dylib 0x00007fff68d09808 abort + 120 3 libc++abi.dylib 0x00007fff65f68458 abort_message + 231 4 libc++abi.dylib 0x00007fff65f598a7 demangling_terminate_handler() + 238 5 libobjc.A.dylib 0x00007fff67a945b1 _objc_terminate() + 104 6 libc++abi.dylib 0x00007fff65f67887 std::terminate(void (*)()) + 8 7 libc++abi.dylib 0x00007fff65f6a1a2 cxxabiv1::failed_throw(cxxabiv1::cxa_exception*) + 27 8 libc++abi.dylib 0x00007fff65f6a169 __cxa_throw + 113 9 libc++.1.dylib 0x00007fff65f3cae8 std::1::throw_length_error(char const*) + 56 10 libc++.1.dylib 0x00007fff65f44ed6 std::1::vector_base_common::throw_length_error() const + 16 11 CuraEngine 0x0000000104e7e1a6 cura::Infill::generateLinearBasedInfill(int, cura::Polygons&, int, cura::PointMatrix const&, cura::ZigzagConnectorProcessor&, bool, long long) + 1270 12 CuraEngine 0x0000000104e7ad55 cura::Infill::generateLineInfill(cura::Polygons&, int, double const&, long long) + 357 13 CuraEngine 0x0000000104e7951f cura::Infill::_generate(cura::Polygons&, cura::Polygons&, cura::SierpinskiFillProvider const, cura::SliceMeshStorage const) + 303 14 CuraEngine 0x0000000104e78bd9 cura::Infill::generate(cura::Polygons&, cura::Polygons&, cura::SierpinskiFillProvider const, cura::SliceMeshStorage const) + 457 15 CuraEngine 0x0000000104e56b66 cura::FffGcodeWriter::processSkinPrintFeature(cura::SliceDataStorage const&, cura::LayerPlan&, cura::SliceMeshStorage const&, unsigned long, cura::Polygons const&, cura::GCodePathConfig const&, cura::EFillMethod, cura::AngleDegrees, long long, cura::Ratio, cura::Polygons, bool&, double) const + 486 16 CuraEngine 0x0000000104e56766 cura::FffGcodeWriter::processTopBottom(cura::SliceDataStorage const&, cura::LayerPlan&, cura::SliceMeshStorage const&, unsigned long, cura::PathConfigStorage::MeshPathConfigs const&, cura::SkinPart const&, cura::Polygons&, bool&) const + 2998 17 CuraEngine 0x0000000104e54ec3 cura::FffGcodeWriter::processSkinPart(cura::SliceDataStorage const&, cura::LayerPlan&, cura::SliceMeshStorage const&, unsigned long, cura::PathConfigStorage::MeshPathConfigs const&, cura::SkinPart const&) const + 195 18 CuraEngine 0x0000000104e50fef cura::FffGcodeWriter::processSkinAndPerimeterGaps(cura::SliceDataStorage const&, cura::LayerPlan&, cura::SliceMeshStorage const&, unsigned long, cura::PathConfigStorage::MeshPathConfigs const&, cura::SliceLayerPart const&) const + 1215 19 CuraEngine 0x0000000104e4d4a7 cura::FffGcodeWriter::addMeshPartToGCode(cura::SliceDataStorage const&, cura::SliceMeshStorage const&, unsigned long, cura::PathConfigStorage::MeshPathConfigs const&, cura::SliceLayerPart const&, cura::LayerPlan&) const + 615 20 CuraEngine 0x0000000104e4c586 cura::FffGcodeWriter::addMeshLayerToGCode(cura::SliceDataStorage const&, cura::SliceMeshStorage const&, unsigned long, cura::PathConfigStorage::MeshPathConfigs const&, cura::LayerPlan&) const + 966 21 CuraEngine 0x0000000104e4a24a cura::FffGcodeWriter::processLayer(cura::SliceDataStorage const&, cura::LayerIndex, unsigned long) const + 2938 22 CuraEngine 0x0000000104e5b2ca std::1::function::__func<cura::FffGcodeWriter::writeGCode(cura::SliceDataStorage&, cura::TimeKeeper&)::$_0, std::__1::allocator<cura::FffGcodeWriter::writeGCode(cura::SliceDataStorage&, cura::TimeKeeper&)::$_0>, cura::LayerPlan (int)>::operator()(int&&) + 26 23 CuraEngine 0x0000000104e5ecb8 cura::GcodeLayerThreader::act() + 120 24 CuraEngine 0x0000000104e41c64 cura::FffGcodeWriter::writeGCode(cura::SliceDataStorage&, cura::TimeKeeper&) + 1668 25 CuraEngine 0x0000000104eb189c cura::Scene::processMeshGroup(cura::MeshGroup&) + 972 26 CuraEngine 0x0000000104ebdd3b cura::Slice::compute() + 91 27 CuraEngine 0x0000000104eff12a cura::ArcusCommunication::sliceNext() + 394 28 CuraEngine 0x0000000104e3eadd cura::Application::run(unsigned long, char**) + 589 29 CuraEngine 0x0000000104e3e041 main + 81 30 libdyld.dylib 0x00007fff68c3acc9 start + 1

Thread 1: 0 libsystem_kernel.dylib 0x00007fff68d7f3a6 recvfrom + 10 1 CuraEngine 0x0000000104fae07e Arcus::Private::PlatformSocket::readUInt32(unsigned int) + 46 2 CuraEngine 0x0000000104fa7fd4 Arcus::Socket::Private::receiveNextMessage() + 180 3 CuraEngine 0x0000000104fa749d Arcus::Socket::Private::run() + 733 4 CuraEngine 0x0000000104fa96a4 void std::1::thread_proxy<std::1::tuple<Arcus::Socket::connect(std::1::basic_string<char, std::1::char_traits, std::__1::allocator > const&, int)::$_0> >(void*) + 100 5 libsystem_pthread.dylib 0x00007fff68e3f109 _pthread_start + 148 6 libsystem_pthread.dylib 0x00007fff68e3ab8b thread_start + 15

Thread 0 crashed with X86 Thread State (64-bit): rax: 0x0000000000000000 rbx: 0x0000000107e44dc0 rcx: 0x00007ffeeadc1278 rdx: 0x0000000000000000 rdi: 0x0000000000000307 rsi: 0x0000000000000006 rbp: 0x00007ffeeadc12a0 rsp: 0x00007ffeeadc1278 r8: 0x00007ffeeadc1140 r9: 0x00007ffeeadc1310 r10: 0x0000000107e44dc0 r11: 0x0000000000000246 r12: 0x0000000000000307 r13: 0x0000003000000008 r14: 0x0000000000000006 r15: 0x0000000000000016 rip: 0x00007fff68d8233a rfl: 0x0000000000000246 cr2: 0x00007ffeeadbfff8

Logical CPU: 0 Error Code: 0x02000148 Trap Number: 133

Binary Images: 0x104e3c000 - 0x1050afffb +CuraEngine (0) <356DB0DA-4FAC-3FCE-8159-DE4653720499> /Applications/Ultimaker Cura.app/Contents/MacOS/CuraEngine 0x107d7a000 - 0x107e0bf47 dyld (750.6) /usr/lib/dyld 0x7fff65c1f000 - 0x7fff65c20fff libSystem.B.dylib (1281.100.1) /usr/lib/libSystem.B.dylib 0x7fff65f05000 - 0x7fff65f57fff libc++.1.dylib (902.1) <59A8239F-C28A-3B59-B8FA-11340DC85EDC> /usr/lib/libc++.1.dylib 0x7fff65f58000 - 0x7fff65f6dffb libc++abi.dylib (902) /usr/lib/libc++abi.dylib 0x7fff67a7f000 - 0x7fff67ab2fde libobjc.A.dylib (787.1) <6DF81160-5E7F-3E31-AA1E-C875E3B98AF6> /usr/lib/libobjc.A.dylib 0x7fff68a1c000 - 0x7fff68a21ff3 libcache.dylib (83) /usr/lib/system/libcache.dylib 0x7fff68a22000 - 0x7fff68a2dfff libcommonCrypto.dylib (60165.120.1) /usr/lib/system/libcommonCrypto.dylib 0x7fff68a2e000 - 0x7fff68a35fff libcompiler_rt.dylib (101.2) <49B8F644-5705-3F16-BBE0-6FFF9B17C36E> /usr/lib/system/libcompiler_rt.dylib 0x7fff68a36000 - 0x7fff68a3fff7 libcopyfile.dylib (166.40.1) <3C481225-21E7-370A-A30E-0CCFDD64A92C> /usr/lib/system/libcopyfile.dylib 0x7fff68a40000 - 0x7fff68ad2fdb libcorecrypto.dylib (866.140.1) <60567BF8-80FA-359A-B2F3-A3BAEFB288FD> /usr/lib/system/libcorecrypto.dylib 0x7fff68bdf000 - 0x7fff68c1fff0 libdispatch.dylib (1173.100.2) /usr/lib/system/libdispatch.dylib 0x7fff68c20000 - 0x7fff68c56fff libdyld.dylib (750.6) <789A18C2-8AC7-3C88-813D-CD674376585D> /usr/lib/system/libdyld.dylib 0x7fff68c57000 - 0x7fff68c57ffb libkeymgr.dylib (30) /usr/lib/system/libkeymgr.dylib 0x7fff68c65000 - 0x7fff68c65ff7 liblaunch.dylib (1738.140.1) /usr/lib/system/liblaunch.dylib 0x7fff68c66000 - 0x7fff68c6bff7 libmacho.dylib (959.0.1) /usr/lib/system/libmacho.dylib 0x7fff68c6c000 - 0x7fff68c6eff3 libquarantine.dylib (110.40.3) /usr/lib/system/libquarantine.dylib 0x7fff68c6f000 - 0x7fff68c70ff7 libremovefile.dylib (48) <7C7EFC79-BD24-33EF-B073-06AED234593E> /usr/lib/system/libremovefile.dylib 0x7fff68c71000 - 0x7fff68c88ff3 libsystem_asl.dylib (377.60.2) <1563EE02-0657-3B78-99BE-A947C24122EF> /usr/lib/system/libsystem_asl.dylib 0x7fff68c89000 - 0x7fff68c89ff7 libsystem_blocks.dylib (74) <0D53847E-AF5F-3ACF-B51F-A15DEA4DEC58> /usr/lib/system/libsystem_blocks.dylib 0x7fff68c8a000 - 0x7fff68d11fff libsystem_c.dylib (1353.100.2) /usr/lib/system/libsystem_c.dylib 0x7fff68d12000 - 0x7fff68d15ffb libsystem_configuration.dylib (1061.141.1) <0EE84C33-64FD-372B-974A-AF7A136F2068> /usr/lib/system/libsystem_configuration.dylib 0x7fff68d16000 - 0x7fff68d19fff libsystem_coreservices.dylib (114) /usr/lib/system/libsystem_coreservices.dylib 0x7fff68d1a000 - 0x7fff68d22fff libsystem_darwin.dylib (1353.100.2) <5B12B5DB-3F30-37C1-8ECC-49A66B1F2864> /usr/lib/system/libsystem_darwin.dylib 0x7fff68d23000 - 0x7fff68d2afff libsystem_dnssd.dylib (1096.100.3) /usr/lib/system/libsystem_dnssd.dylib 0x7fff68d2b000 - 0x7fff68d2cffb libsystem_featureflags.dylib (17) <29FD922A-EC2C-3F25-BCCC-B58D716E60EC> /usr/lib/system/libsystem_featureflags.dylib 0x7fff68d2d000 - 0x7fff68d7aff7 libsystem_info.dylib (538) <8A321605-5480-330B-AF9E-64E65DE61747> /usr/lib/system/libsystem_info.dylib 0x7fff68d7b000 - 0x7fff68da7ff7 libsystem_kernel.dylib (6153.141.1) <2B6311E6-6240-3EF7-8C87-475B66F7452C> /usr/lib/system/libsystem_kernel.dylib 0x7fff68da8000 - 0x7fff68deffff libsystem_m.dylib (3178) <00F331F1-0D09-39B3-8736-1FE90E64E903> /usr/lib/system/libsystem_m.dylib 0x7fff68df0000 - 0x7fff68e17fff libsystem_malloc.dylib (283.100.6) <8549294E-4C53-36EB-99F3-584A7393D8D5> /usr/lib/system/libsystem_malloc.dylib 0x7fff68e18000 - 0x7fff68e25ffb libsystem_networkextension.dylib (1095.140.2) /usr/lib/system/libsystem_networkextension.dylib 0x7fff68e26000 - 0x7fff68e2fff7 libsystem_notify.dylib (241.100.2) /usr/lib/system/libsystem_notify.dylib 0x7fff68e30000 - 0x7fff68e38fef libsystem_platform.dylib (220.100.1) <009A7C1F-313A-318E-B9F2-30F4C06FEA5C> /usr/lib/system/libsystem_platform.dylib 0x7fff68e39000 - 0x7fff68e43fff libsystem_pthread.dylib (416.100.3) <62CB1A98-0B8F-31E7-A02B-A1139927F61D> /usr/lib/system/libsystem_pthread.dylib 0x7fff68e44000 - 0x7fff68e48ff3 libsystem_sandbox.dylib (1217.141.1) <6DE13684-5A67-3009-A53A-C9086CF241C3> /usr/lib/system/libsystem_sandbox.dylib 0x7fff68e49000 - 0x7fff68e4bfff libsystem_secinit.dylib (62.100.2) /usr/lib/system/libsystem_secinit.dylib 0x7fff68e4c000 - 0x7fff68e53ffb libsystem_symptoms.dylib (1238.120.1) <5820A2AF-CE72-3AB3-ABCC-273A3419FB55> /usr/lib/system/libsystem_symptoms.dylib 0x7fff68e54000 - 0x7fff68e6aff2 libsystem_trace.dylib (1147.120) <04B47629-847B-3D74-8ABE-C05EF9DEEFE4> /usr/lib/system/libsystem_trace.dylib 0x7fff68e6c000 - 0x7fff68e71ff7 libunwind.dylib (35.4) <42B7B509-BAFE-365B-893A-72414C92F5BF> /usr/lib/system/libunwind.dylib 0x7fff68e72000 - 0x7fff68ea7ffe libxpc.dylib (1738.140.1) <3E243A41-030F-38E3-9FD2-7B38C66C35B1> /usr/lib/system/libxpc.dylib

External Modification Summary: Calls made by other processes targeting this process: task_for_pid: 20 thread_create: 0 thread_set_state: 0 Calls made by this process: task_for_pid: 0 thread_create: 0 thread_set_state: 0 Calls made by all processes on this machine: task_for_pid: 335033 thread_create: 0 thread_set_state: 0

VM Region Summary: ReadOnly portion of Libraries: Total=397.0M resident=0K(0%) swapped_out_or_unallocated=397.0M(100%) Writable regions: Total=157.7M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=157.7M(100%)

                            VIRTUAL   REGION 

REGION TYPE SIZE COUNT (non-coalesced) =========== ======= ======= Kernel Alloc Once 8K 1 MALLOC 149.0M 49 MALLOC guard page 16K 4 STACK GUARD 56.0M 2 Stack 8712K 2 DATA 640K 41 DATA_CONST 20K 1 LINKEDIT 389.9M 3 OBJC_RO 32.3M 1 __OBJC_RW 1908K 2 __TEXT 7260K 40 shared memory 8K 2 =========== ======= ======= TOTAL 645.3M 148

Additional information Also tested on a PC running Ubuntu and a fresh install of Cura and exact same thing happens. Works in Windows but I am seeing some add defects in the print.

Also saw issue with another of the files (Ender-3_Display_Cover_with_bell) whereby the slice completes but the print time is estimated at 4 days and 17 hours. When inspecting the preview I noticed this.

Screenshot 2021-01-04 at 21 43 59 Screenshot 2021-01-04 at 19 50 23
coatezy commented 3 years ago

Another quick observation, the Ender-3_Display_Cover_factory_srews_with_bell_closed_3connectors STL file appears to slice fine on MacOS.

coatezy commented 3 years ago

I can confirm Cura slices as expected when using version 4.7.1. No crashing on no 4 day prints. 😄

Ghostkeeper commented 3 years ago

I'm not able to reproduce this crash, using Ubuntu. Not with the default settings for the Ender 3 anyway. It slices fine and takes 3.5 hours to print. image

I haven't yet seen slicing crashes that are operating system specific.

Perhaps you could share a project file? There could be some things with the precise location of the object, or maybe any of the profiles were changed.

coatezy commented 3 years ago

Thanks for looking in to this, @Ghostkeeper. I will run it again on Ubuntu and post the logs along with the project. There are others on Thingiverse that are also having the same problem and a thread under comment:

Cura keeps getting stuck slicking this model. Any idea why?

One suggestion was to rotate the model 90 degrees. When I did this on the MacOS version using Ender-3_Display_Cover_factory_srews_with_bell_closed.STL it sliced but I ended up with the long line causing the print to take ~5 days.

coatezy commented 3 years ago

Attached is two projects - one with the STL imported as is and the other rotated 90 degrees.

Cura Project.zip

coatezy commented 3 years ago

Updated zip with an extra project with the model rotated upwards 15 degrees at the front. It slices perfectly in this orientation with a print time of 3hours 51 (with no supports). Of course I wouldn't want to print in this way. 😆

Cura Project.zip

fvrmr commented 3 years ago

Thanks for your project files, we can reproduce this on an Windows and Linux with your files. So we are gonna look into this.

coatezy commented 3 years ago

Glad the project files helped. 🙌 Let me know if you need anything else or if I can help in any way, testing etc.

jellespijker commented 3 years ago

It fails on my computer (Arch Linux) for the 4.8 branch. When it is exporting the GCode it is terminated with a SigAbort

Starting export...
Multithreading GcodeLayerThreader with 1 threads.
terminate called after throwing an instance of 'std::length_error'
  what():  vector::_M_default_append
Signal: SIGABRT (Aborted)

Good thing is that it slices correctly on Master so it should be fixed (for this model at least) in the 4.9 release

I will have to dive into it a little deeper to see what the root cause is.

In the mean time you could try it out with our new experimental Alpha Arachne release, since this is based on Master after 4.8 was released. I personally have no problems slicing the model in that pre-release. See https://github.com/Ultimaker/Cura/releases/tag/Arachne_engine_alpha

ne2pit commented 3 years ago

Reproduced slicer crash on MacOS Sierra. Tried every file in this thingiverse package. Only one sliced fine Ender-3_Display_Cover_factory_srews_with_bell_closed_3connectors.STL.

Used some online STL fixer. It does not find any critical errors. But made some corrections. Fixer log:

-> Analysed your file: --> 0 Naked edges (?) --> 0 Planar holes (?) --> 0 Non-planar holes (?) --> 0 Non-manifold edges (?) --> 0 Inverted faces (?) --> 0 Degenerate faces (?) --> 0 Duplicate faces (?) --> 0 Disjoint shells (?) -> Repairing: 100.00% ----- Repair completed in 14772ms ------ -> Vertex count changed from 13088 to 14185 (+1097) -> Triangle count changed from 26196 to 28398 (+2202)

Here is original and fixed version of Ender-3_Display_Cover_factory_srews_with_bell_closed.STL: Ender-3_Display_Cover_hang_and_fixed_stl.zip

Ghostkeeper commented 3 years ago

@ne2pit Which version of Cura were you using?

ne2pit commented 3 years ago

@Ghostkeeper I used MacOS Cura version 4.8.0. The same version as topic starter used. Unfortunately I can not check 4.9.0 right now due to new MacOS version limit in Cura.