C++ exception when rotating large objects #2394

Closed
kurthuwig opened this Issue Dec 3, 2014 · 10 comments

Projects

None yet

3 participants

@kurthuwig
Thread 64 terminated abnormally:
Caught C++ exception of type or derived from 'std::exception': vector::_M_range_check
at Slic3r-1.2.1/lib/std/Slic3r/Print/Object.pm line 489.
@alexrj
Owner
alexrj commented Dec 8, 2014

Incomplete report. You haven't read the guidelines :(

@alexrj
Owner
alexrj commented Dec 12, 2014

@kurthuwig, can you please supply the missing information? Thank you

@a4jp-com

Kurthuwig what system are you running? Also please upload the config file and a model so the problem can be checked.

@kurthuwig

I am sorry for being so unprecise.

version was 1.2.1 on Ubuntu 14.04 LTS amd64

The error happens when I rotate an object while slicer is still working on the last rotate. While I do this, I've got these error messages:

Scalars leaked: 1
[56424.379836] slic3r[6150]: segfault at 3 ip 00007fe7d1309297 sp 00007fe7b981db40 error 4 in libglib-2.0.so.0.4002.0[7fe7d12a5000+106000]
slic3r: Fatal IO error 11 (The ressource is currently unavailable) on X server :0.
Xlib: request 10 length 24 would exceed buffer size.

This error happens with all STL files that I've tested, some of my own, some from AutoCad and some from Thingiverse both simple and complicated ones.

I was able to create a core dump. You can download it from

http://www.huwig.de/slic3r/slic3r-core.7z

and the config from

http://www.huwig.de/slic3r/config.ini

@alexrj
Owner
alexrj commented Dec 12, 2014

Thank you @kurthuwig, I can't reproduce this on OS X. I'll try on my Linux dev machine as soon as I can. As I understand, you're using the packaged 1.2.1 binary executable, and you can reproduce the error by clicking on a rotate button while Slic3r is processing the object in background. Is this right? Also, can you tell approximately what's the status message displayed when you click on the Rotate button? (i.e. "Processing triangle mesh…", "Generating perimeters…")

@alexrj alexrj added this to the 1.2.2 milestone Dec 12, 2014
@alexrj alexrj added a commit that referenced this issue Dec 12, 2014
@alexrj Require a recent threads.pm version because of upstream bug 85140 pot…
…entially causing deadlocks when stopping running threads. #2394

https://rt.cpan.org/Ticket/Display.html?id=85140
84760b8
@alexrj
Owner
alexrj commented Dec 12, 2014

I think this might be somehow related to a bug in the upstream threads.pm module, fixed some time ago. I now pulled the new version and made it a requirement for Slic3r. At least, it should fix other problems with threading people have been reporting on Windows. A bit unsure about this particular issue though.

@alexrj
Owner
alexrj commented Dec 12, 2014

Note to self: well, in the above commit I also changed the order in which threads are killed. It was FIFO before, and now it's recursive thus LIFO. This should be more robust. But it's still unclear to me how a child thread might be trying to access a layer that doesn't exist anymore.

@kurthuwig

If you have another debian package, I am happy to test it.

The segmentation fault happens in an X window function:

Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `bin/slic3r'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007ff4daf69b47 in XRenderCompositeTrapezoids () from /usr/lib/x86_64-linux-gnu/libXrender.so.1
(gdb) bt
#0  0x00007ff4daf69b47 in XRenderCompositeTrapezoids () from /usr/lib/x86_64-linux-gnu/libXrender.so.1
#1  0x00007ff4dcc6d3ed in ?? () from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#2  0x00007ff4dcc56c74 in ?? () from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#3  0x00007ff4dcc57e13 in ?? () from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#4  0x00007ff4dcc00a64 in ?? () from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#5  0x00007ff4dcc71a1d in ?? () from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#6  0x00007ff4dcc45412 in ?? () from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#7  0x00007ff4dcc081e2 in ?? () from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#8  0x00007ff4dcc02169 in ?? () from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#9  0x00007ff4dcbfb995 in cairo_stroke () from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#10 0x00007ff4d6bd646c in ?? () from /usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/engines/libmurrine.so
#11 0x00007ff4d6bd8577 in ?? () from /usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/engines/libmurrine.so
#12 0x00007ff4d6bcaf7e in ?? () from /usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/engines/libmurrine.so
#13 0x00007ff4ddaae57b in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#14 0x00007ff4ddb61815 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#15 0x00007ff4dc999332 in g_closure_invoke () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#16 0x00007ff4dc9aaafb in ?? () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#17 0x00007ff4dc9b26f9 in g_signal_emit_valist () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#18 0x00007ff4dc9b2ce2 in g_signal_emit () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#19 0x00007ff4ddc71724 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#20 0x00007ff4ddaea5b8 in gtk_container_propagate_expose () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#21 0x00007ff4ddab6cfa in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#22 0x00007ff4ddae9144 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#23 0x00007ff4ddb61815 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#24 0x00007ff4dc999332 in g_closure_invoke () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#25 0x00007ff4dc9aaafb in ?? () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#26 0x00007ff4dc9b26f9 in g_signal_emit_valist () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#27 0x00007ff4dc9b2ce2 in g_signal_emit () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#28 0x00007ff4ddc71724 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#29 0x00007ff4ddaea5b8 in gtk_container_propagate_expose () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#30 0x00007ff4ddc1e3a8 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#31 0x00007ff4ddb61815 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#32 0x00007ff4dc999332 in g_closure_invoke () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#33 0x00007ff4dc9aaafb in ?? () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#34 0x00007ff4dc9b26f9 in g_signal_emit_valist () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#35 0x00007ff4dc9b2ce2 in g_signal_emit () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#36 0x00007ff4ddc71724 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#37 0x00007ff4ddaea5b8 in gtk_container_propagate_expose () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#38 0x00007ff4ddadf261 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#39 0x00007ff4ddb61815 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#40 0x00007ff4dc999332 in g_closure_invoke () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#41 0x00007ff4dc9aaafb in ?? () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#42 0x00007ff4dc9b26f9 in g_signal_emit_valist () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#43 0x00007ff4dc9b2ce2 in g_signal_emit () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#44 0x00007ff4ddc71724 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#45 0x00007ff4ddaea5b8 in gtk_container_propagate_expose () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#46 0x00007ff4ddb20c08 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#47 0x00007ff4ddae9144 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#48 0x00007ff4ddb61815 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#49 0x00007ff4dc9993b8 in g_closure_invoke () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#50 0x00007ff4dc9aaafb in ?? () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#51 0x00007ff4dc9b26f9 in g_signal_emit_valist () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#52 0x00007ff4dc9b2ce2 in g_signal_emit () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#53 0x00007ff4ddc71724 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#54 0x00007ff4ddb60610 in gtk_main_do_event () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#55 0x00007ff4dd7c2edf in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0
#56 0x00007ff4dd7c2e85 in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0
#57 0x00007ff4dd7c2e85 in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0
#58 0x00007ff4dd7bfb5a in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0
#59 0x00007ff4dd7c0438 in gdk_window_process_all_updates () from /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0
#60 0x00007ff4ddae8e31 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#61 0x00007ff4dd79fce7 in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0
#62 0x00007ff4dc2c3ce5 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#63 0x00007ff4dc2c4048 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#64 0x00007ff4dc2c430a in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#65 0x00007ff4ddb5f447 in gtk_main () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#66 0x00007ff4de756f7b in wxGUIEventLoop::Run() () from /home/kurt/Software/Slic3r-1.2.1/bin/../dll/libwx_gtk2u_core-2.9.so.3
#67 0x00007ff4de0dcca6 in wxAppConsoleBase::MainLoop() () from /home/kurt/Software/Slic3r-1.2.1/bin/../dll/libwx_baseu-2.9.so.3
---Type <return> to continue, or q <return> to quit---
#68 0x00007ff4df28c031 in wxPliApp::MainLoop() () from /home/kurt/Software/Slic3r-1.2.1/lib/vrt/8b57d08e0d55cfe6498642b59ecf5ad1/Wx.so
#69 0x00007ff4df24a3c2 in XS_Wx__App_MainLoop(interpreter*, cv*) ()
   from /home/kurt/Software/Slic3r-1.2.1/lib/vrt/8b57d08e0d55cfe6498642b59ecf5ad1/Wx.so
#70 0x00007ff4e3df3db3 in Perl_pp_entersub () from /home/kurt/Software/Slic3r-1.2.1/bin/../dll/libperl.so
#71 0x00007ff4e3df23fe in Perl_runops_standard () from /home/kurt/Software/Slic3r-1.2.1/bin/../dll/libperl.so
#72 0x00007ff4e3d8cba3 in perl_run () from /home/kurt/Software/Slic3r-1.2.1/bin/../dll/libperl.so
#73 0x0000000000403064 in ?? ()
#74 0x00007ff4e2c23ec5 in __libc_start_main (main=0x402df0, argc=1, argv=0x7fffd22c85b8, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7fffd22c85a8) at libc-start.c:287
#75 0x0000000000401b69 in ?? ()
#76 0x00007fffd22c85a8 in ?? ()
#77 0x000000000000001c in ?? ()
#78 0x0000000000000001 in ?? ()
#79 0x00007fffd22c9148 in ?? ()
#80 0x0000000000000000 in ?? ()
@alexrj
Owner
alexrj commented Dec 13, 2014

I just tested on Ubuntu, before and after my changes from yesterday. I could reproduce some hangs and crashes, and they seems to be fixed. I couldn't reproduce the particular error you reported in the original message. I need to fix some more things before releasing 1.2.2.

@alexrj alexrj added a commit that referenced this issue Dec 13, 2014
@alexrj Use a semaphore to synchronize threads instead of blocking with join(…
…). Lock threads array in order to ensure all of them are signalled. #2394
e9166a8
@alexrj
Owner
alexrj commented Dec 13, 2014

I was finally able to reproduce the error you reported. Under certain circumstances, not all threads were correctly terminated. I now implemented a better mechanism that also avoids some long pauses on Windows. Looks good now.
Thank you for your report and help.

@alexrj alexrj closed this Dec 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment