View Issue Details

IDProjectCategoryView StatusLast Update
0001835ArchBugpublic2015-01-16 19:59
ReporterrocknAssigned Toyorik 
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionreopened 
PlatformLinux UbuntuOS14.04OS Version64 bits
Product Version 
Target VersionFixed in Version0.15 
Summary0001835: Crash when inserting window without support
DescriptionFreeCAD crash when I add Arch window when there is no support (no other object in the Document and when I set the placement to 0 mm,0 mm,0 mm by the taskpanel.

jo@jo-desktop-trusty:~/Logiciels/FreeCAD/free-cad-code/woodgalaxy_freecad/cutplane2_build$ gdb ./bin/FreeCAD
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./bin/FreeCAD...(no debugging symbols found)...done.
(gdb) run
Starting program: /home/jo/Logiciels/FreeCAD/free-cad-code/woodgalaxy_freecad/cutplane2_build/bin/FreeCAD
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
FreeCAD 0.15, Libs: 0.15R4196 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2014
  ##### #### ### ####
  # # # # # #
  # ## #### #### # # # # #
  #### # # # # # # # ##### # #
  # # #### #### # # # # #
  # # # # # # # # # ## ## ##
  # # #### #### ### # # #### ## ## ##

[New Thread 0x7fffde7ee700 (LWP 5445)]
[New Thread 0x7fffddfed700 (LWP 5446)]
[New Thread 0x7fffd550a700 (LWP 5447)]
[New Thread 0x7fffd4d09700 (LWP 5448)]
[New Thread 0x7fffcbfff700 (LWP 5450)]
[Thread 0x7fffcbfff700 (LWP 5450) exited]
Cannot find icon: icons/animation.png
[New Thread 0x7fffcbfff700 (LWP 5452)]
[New Thread 0x7fff61405700 (LWP 5453)]
[New Thread 0x7fff5e3c9700 (LWP 5454)]
[New Thread 0x7fff57fff700 (LWP 5455)]
[New Thread 0x7fff577fe700 (LWP 5456)]
[New Thread 0x7fff56ffd700 (LWP 5457)]
Arch workbench activated
[Thread 0x7fffd4d09700 (LWP 5448) exited]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff4e25607 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
(gdb) quit
A debugging session is active.

    Inferior 1 [process 5441] will be killed.

Quit anyway? (y or n) y

Steps To ReproduceOpen FC
New Doc
-> Arch WB
Clic window button
Set something else than From Scratch (or not)
Clic on the X placement in the taskpanel,
Set x = 0 mm,
Press Enter,
Set y = 0 mm,
Press Enter,
Set z = 0 mm.
Press Enter,
-> FreeCAD crash
Additional InformationOS: Ubuntu 14.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.15.4196 (Git)
Branch: arch-window
Hash: 86a1757c2049e9e028525297636a2b1fdfce6006
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.7.0
TagsNo tags attached.

Activities

yorik

2014-11-21 14:43

administrator   ~0005336

Indeed it crashes for me too. I'll have a look.

yorik

2015-01-03 16:57

administrator   ~0005488

This doesn't crash anymore for me. Using the "Create from Scratch" without selecting a face simply closes the tool while doing nothing, while selecting one of the presets correctly places the window on screen without parent.

Probably one of the other modifications I did solved this together...

Is this still crashing for you rockn?

rockn

2015-01-03 18:38

developer   ~0005491

No, now it's okay ;)

yorik

2015-01-03 19:13

administrator   ~0005493

Ok! Closing then...

rockn

2015-01-04 09:31

developer   ~0005496

It seem it's come back with latest build. Look like "From scratch" don't crash (and provide nothing) but presets crash with the following message.

./bin/FreeCAD
FreeCAD 0.15, Libs: 0.15R4387 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2014
  ##### #### ### ####
  # # # # # #
  # ## #### #### # # # # #
  #### # # # # # # # ##### # #
  # # #### #### # # # # #
  # # # # # # # # # ## ## ##
  # # #### #### ### # # #### ## ## ##

Arch workbench activated
Choisissez une face sur un objet existant, ou sélectionnez un paramètre prédéfini *** Abort *** an exception was raised, but no catch was found.
    ... The exception is:SIGSEGV 'segmentation violation' detected. Address ffffffffffffffff

wmayer

2015-01-04 10:40

administrator   ~0005498

FYI, for me the behaviour is that there is raised an exception which causes the event loop to leave. Qt prints this message:
"""
Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt. You must
reimplement QApplication::notify() and catch all exceptions there.
"""

wmayer

2015-01-04 10:47

administrator   ~0005499

The problem here seems that the 'receiver' of "GUIApplication::notify (QObject * receiver, QEvent * event)" is a dangling pointer and causes all kind of problems.

wmayer

2015-01-04 11:28

administrator   ~0005500

The basic problem is the way how you handle the returnedPressed() signal of the third InputField in the dialog. This is connected somehow with closeDialog() of the task panel which destroys the dialog and all its sub-widgets which makes the pointer to the above InputField a dangling pointer with undefined behaviour.

However, I couldn't locate where in your source code returnedPressed() and closeDialog() are connected.

wmayer

2015-01-04 12:34

administrator   ~0005501

Last edited: 2015-01-04 12:34

View 2 revisions

The culprit is the line
FreeCADGui.Control.closeDialog()
in the method getPoint() of ArchWindow.py. Actually it's possible to remove this line because the task panel gets closed anyway.

If for any reason you need to close the task panel explicitly then you should use the todo.delay function.

from DraftGui import todo
todo.delay(FreeCADGui.Control.closeDialog,None)

yorik

2015-01-04 17:06

administrator   ~0005507

Thanks for the pointers Werner... I couldn't reproduce the crash again, but indeed this closeDialog() line is unnecessary. I removed it now, let's see if it works...

rockn

2015-01-04 23:07

developer   ~0005518

Now, when you clic (on a wall) to add a "Create from scratch" window, FreeCAD is asking if I want to close this Dialog because A dialog is already open in the task panel.
If I clic No.
FreeCAD switch to Sketcher WB, but not in the edit mode of the sketch.
I get : Coin error in SoEventManager::processEvent(): Recursive invocation detected. Delay processing event until the current event is finished processing.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
<class 'Base.FreeCADError'>: Failed to set object 'Sketch' in edit mode
Stack Trace: Traceback (most recent call last):
  File "<string>", line 1, in <module>

Coin warning in SoChildList::traverse(): Detected modification of scene graph layout during action traversal. This is considered to be hazardous and error prone, and we strongly advice you to change your code and/or reorganize your scene graph so that this is not necessary.



If I clic Yes:
FreeCAD crash with the following message :
Choisissez une face sur un objet existant, ou sélectionnez un paramètre prédéfini Arch workbench deactivated
Coin error in SoEventManager::processEvent(): Recursive invocation detected. Delay processing event until the current event is finished processing.
*** Abort *** an exception was raised, but no catch was found.
    ... The exception is:SIGSEGV 'segmentation violation' detected. Address 0

yorik

2015-01-16 19:01

administrator   ~0005662

Hmm this is really hard to solve... The task dialog now gets correctly closed by the Draft GUI itself, but this messes the "create sketch" command that is ran afterwards which gives the problems above.

I wonder if it's not easier to simply remove the "create from scratch option"... After all it's not a big deal for the user to create his sketch manually, then run the Arch window command...

rockn

2015-01-16 19:05

developer   ~0005663

Yes it's a good idea. We have already the ability to "create from scratch" if we have a face selected before run the Arch window command...

Issue History

Date Modified Username Field Change
2014-11-21 10:13 rockn New Issue
2014-11-21 14:43 yorik Note Added: 0005336
2014-11-21 14:43 yorik Assigned To => yorik
2014-11-21 14:43 yorik Status new => assigned
2015-01-03 16:57 yorik Note Added: 0005488
2015-01-03 16:57 yorik Status assigned => feedback
2015-01-03 18:38 rockn Note Added: 0005491
2015-01-03 18:38 rockn Status feedback => assigned
2015-01-03 19:13 yorik Note Added: 0005493
2015-01-03 19:13 yorik Status assigned => closed
2015-01-03 19:13 yorik Resolution open => fixed
2015-01-03 19:13 yorik Fixed in Version => 0.15
2015-01-04 09:31 rockn Note Added: 0005496
2015-01-04 09:31 rockn Status closed => feedback
2015-01-04 09:31 rockn Resolution fixed => reopened
2015-01-04 10:40 wmayer Note Added: 0005498
2015-01-04 10:47 wmayer Note Added: 0005499
2015-01-04 11:28 wmayer Note Added: 0005500
2015-01-04 12:34 wmayer Note Added: 0005501
2015-01-04 12:34 wmayer Note Edited: 0005501 View Revisions
2015-01-04 17:06 yorik Note Added: 0005507
2015-01-04 17:19 yorik Changeset attached => FreeCAD Master master a7b3b85a
2015-01-04 17:19 yorik Status feedback => closed
2015-01-04 23:07 rockn Note Added: 0005518
2015-01-04 23:07 rockn Status closed => feedback
2015-01-16 19:01 yorik Note Added: 0005662
2015-01-16 19:05 rockn Note Added: 0005663
2015-01-16 19:05 rockn Status feedback => assigned
2015-01-16 19:59 yorik Changeset attached => FreeCAD Master master 90540deb
2015-01-16 19:59 yorik Status assigned => closed