View Issue Details

IDProjectCategoryView StatusLast Update
0000234FreeCADBugpublic2018-01-21 09:50
Reportermyier Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionnot fixable 
Product Version0.12 
Summary0000234: Save picture fails to create a picture
DescriptionThe "Save picture..." tool crashes with the following console message:

Exception (Sun Jan 9 13:20:03 2011): Offscreen rendering failed
Stack Trace: Traceback (most recent call last):
  File "<string>", line 1, in <module>

Very useful message indeed. Is there a specific dependency to install to use this feature, or is it not implemented, or what did I wrong?

Thank you for all previous fixes, very useful to me :)
TagsNo tags attached.
FreeCAD Information

Activities

wmayer

2011-01-10 10:52

administrator   ~0000495

Everything is fine here. Do you have general OpenGL problems?

myier

2011-01-10 12:43

reporter   ~0000499

OpenGL is fine, except bug 0000196 which seems to be normal. Maybe this is related to the file I'm trying to export, I will test with simpler examples asap.

myier

2011-01-11 08:55

reporter   ~0000502

Even with a single cube in the scene, it still fails to proceed to the offscreen rendering. Any ideas on how I can hunt down the bug?

wmayer

2011-01-11 10:40

administrator   ~0000505

we use Coin's SoOffscreenRenderer class for this which provides the method render(). This method returns a boolean and in case the value is "false" we throw an exception which you'll see in the output window.

So, to check what is happening you should debug SoOffscreenRenderer::render() and check where exactly it returns false and whether there are further error information.

wmayer

2011-01-11 10:46

administrator   ~0000506

Studying the code there are only two possibilities that the offscreen rendering can fail, i.e. returns false:
1. No win-system GL binding was found (whatever this means)
2. No GL context could be activated

Jriegel

2011-01-13 14:53

administrator   ~0000511

Works for me too. If no other report this problem I would say a glich
in the OpenGL subsystem (again) and close this bug. Since noone of the
developer can reproduce it.

myier

2011-01-16 12:10

reporter   ~0000526

I'm not able to put a breakpoint on SoOffscreenRenderer::render, can you tell me in which file it is, so that I can put a break on the function calling it?
I found the function SoFCOffscreenRenderer::writeToImageFile whose name looks quite interesting, but I'm not able to have a break on it either.
I see that debug is on by default in FreeCAD, and still gdb says there are no symbols, that might be the problem, although when I break the program, I can see stack symbols. I think I'll recompile forcing the -g. Thanks

unauthenticated

2011-01-16 19:05

viewer   ~0000527

First of all before doing anything else start FreeCAD from a shell and look there if you'll find any error messages when making a screenshot.

If there is nothing related to your error then you can follow these steps:
1. Get the sources for Coin3D (it's best to use the same version as you have on your system)
2. Unpack the tarball and run ./configure --prefix=/tmp/coin --enable-debug
3. make & make install
4. Copy the file /tmp/coin/lib/libCoin.so.60 (in my case) to the lib directory where FreeCAD is so that it uses this version of Coin.
5. Now start with FreeCAD with gdb and set the breakpoint to SoOffScreenRenderer::render()

NOTE: If you have problems (as I had) to use gdb directly you can use an IDE like Qt Creator and build FreeCAD there. Then load the file SoOffscreenRenderer from the Coin sources and set the breakpoints with the GUI. Run the debugger and continue as usual... You should be able to debug step by step to see what's happening.

myier

2011-01-16 21:12

reporter   ~0000530

Ok, so I finally recompiled coin and freecad, forcing them to have debugging (adding -g too), and when I was able to have the breakpoint recognized by gdb, I could have THE message:

Coin info in SoOffscreenRenderer::getNumWriteFiletypes(): You need simage v1.1 for this functionality.

I actually never looked at your compilation page on which are listed FreeCAD's dependencies, I used the dependencies written in my distrib's package page. I'll inform them that simage is an optional dependency that has to be documented. Sorry for the inconvenience. I'll compile it and try.

wmayer

2011-01-16 21:20

administrator   ~0000532

After installing simage has the problem gone or what?

myier

2011-01-16 21:45

reporter   ~0000533

No. I don't know what I did wrong, but now that I installed it, I still have the error message I wrote in the bug report, and gdb fails to break at any render method or getNumWriteFiletypes from SoOffscreenRenderer. I don't understand why, since gdb itself completed the name of the method why I placed the breakpoint. Maybe there is a problem before executing these functions.

As I said before, could you tell me from what FreeCAD file or method is called the render() method or where is located the menu callback, so that I can break on it and then execute it step by step, please?

unauthenticated

2011-01-16 23:16

viewer   ~0000535

AFAIK siamge only provides further image formats to save the buffer into. Actually, it has not any effect to the off-screen rendering itself. The render() method is used in View3DInventorViewer::savePicture(const char*, int, int, int, const char*) in file View3DInventorViewer.cpp

myier

2011-01-17 17:42

reporter   ~0000539

Thanks. I think I will just give up. I'm not able to properly break in this file or on SoOffScreenRenderer::render() calls. I guess gdb doesn't like the dynamic loading. It displays this message when putting a breakpoint on the render() method that it is able to complete when I press 'TAB' (the View3DInventorViewer only completes to the .h':

Make breakpoint pending on future shared library load? (y or [n]) y

But it never breaks. I'll try Qt creator some day, when I have time to learn how to use it.

wmayer

2011-01-18 09:07

administrator   ~0000540

That's exactly the same problem I ran into and that's why I tried Qt Creator. Doing it with this IDE is quite straightforward. You can install it from your package repo of your distribution. If there is no package you can also get an installer from Trolltech directly for Linux.

First, try to build FreeCAD with cmake instead of automake. If everything goes fine you are ready to build also with Qt Creator. Once you have it installed go to File > Open project and load the CMakeLists.txt file from the FreeCAD root directory. A dialog comes up where to add some argument for cmake. Type: -DCMAKE_BUILD_TYPE=Debug and continue. Now, you can build all sources with CTRL+B.

After around ten minutes the build is done and you can start the debugger with F5. Set a breakpoint to the functions above and if the app stops at one you can continue with F10 (step over) or F11 (step inside).

It's actually quite easy to use.

Jriegel

2011-01-31 15:10

administrator   ~0000565

No further info from caller....

myier

2011-02-02 19:26

reporter   ~0000573

I finally could test Qt Creator, and I have to admit it's pretty nice.
I was able to break in the View3DInventorViewer::savePicture() method and execute step by step but the debugger is not able to step inside the SoOffscreenRenderer::render() method since it's in Coin, and thus I can't see what's wrong. References to the renderer and the root are not NULL, that's all I can say.

Would you have any knowledge on how to integrate my Coin source tree into the FreeCAD project or the debugger? In Qt Creator, it seems that the project is read-only, the 'Add Existing Files' contextual menu is disabled.
Thanks.

myier

2011-02-02 22:25

reporter   ~0000574

Ok, I tried an alternate method, the good old printf in Coin's code (I don't know why I'm not able to have Coin's debug message either, but nevermind).

I located the error in Coin-3.1.3/src/glue/gl.cpp line 4668, the call to glxglue_context_pbuffer_max returns true but a zero size. I replaced the debug messages of the method by printfs and here is what I have:

pbuffer max dimensions, width==0, height==0, pixels==0
clamped max dimensions==<0, 0>

So the main faulty line should be the glXGetFBConfigAttrib at Coin-3.1.3/src/glue/gl_glx.cpp:1071.

Do you know about it? I did not search yet.

wmayer

2011-02-03 19:29

administrator   ~0000575

Sorry, my knowledge of OpenGL is very limited. But you may ask this directly at the mailing list of Coin3d. These people there should have an idea what's going on there.

unauthenticated

2011-02-05 09:36

viewer   ~0000577

I asked on the Coin ml, and it seems to be a 3D driver issue:
https://mailman.coin3d.org/pipermail/coin-discuss/2011-February/018225.html

And thus it is not related to FreeCAD.

Thanks anyway.

wmayer

2011-02-05 09:58

administrator   ~0000578

According to https://mailman.coin3d.org/pipermail/coin-discuss/2011-February/018230.html it's a driver issue.

Issue History

Date Modified Username Field Change
2011-01-09 11:27 myier New Issue
2011-01-10 10:52 wmayer Note Added: 0000495
2011-01-10 12:43 myier Note Added: 0000499
2011-01-11 08:55 myier Note Added: 0000502
2011-01-11 10:40 wmayer Note Added: 0000505
2011-01-11 10:46 wmayer Note Added: 0000506
2011-01-13 14:53 Jriegel Note Added: 0000511
2011-01-13 14:53 Jriegel Status new => feedback
2011-01-16 12:10 myier Note Added: 0000526
2011-01-16 19:05 unauthenticated Note Added: 0000527
2011-01-16 21:12 myier Note Added: 0000530
2011-01-16 21:20 wmayer Note Added: 0000532
2011-01-16 21:45 myier Note Added: 0000533
2011-01-16 23:16 unauthenticated Note Added: 0000535
2011-01-17 17:42 myier Note Added: 0000539
2011-01-18 09:07 wmayer Note Added: 0000540
2011-01-31 15:10 Jriegel Note Added: 0000565
2011-01-31 15:10 Jriegel Status feedback => closed
2011-01-31 15:10 Jriegel Resolution open => unable to reproduce
2011-02-02 19:26 myier Note Added: 0000573
2011-02-02 19:26 myier Status closed => feedback
2011-02-02 19:26 myier Resolution unable to reproduce => reopened
2011-02-02 22:25 myier Note Added: 0000574
2011-02-03 19:29 wmayer Note Added: 0000575
2011-02-05 09:36 unauthenticated Note Added: 0000577
2011-02-05 09:58 wmayer Note Added: 0000578
2011-02-05 09:58 wmayer Status feedback => closed
2011-02-05 09:58 wmayer Resolution reopened => not fixable