View Issue Details

IDProjectCategoryView StatusLast Update
0000657FreeCADBugpublic2015-01-23 21:44
Reportermsynth Assigned To 
PrioritynormalSeveritycrashReproducibilityunable to reproduce
Status closedResolutionunable to reproduce 
Summary0000657: Fatal IO error 2 (No such file or directory) on X server :0.0
DescriptionFor an experiment I am calling FreeCAD.open too fast after each other and it causes a Fatal IO error.

The mystery is, that not every call to the open functions returns this error.

But it is not possible to detect the conditions which are reproducing this error, so an upstream bug report would be likely without success.
TagsNo tags attached.
FreeCAD Information

Activities

wmayer

2012-03-31 10:57

administrator   ~0001836

Can you describe in more details how are your steps? I guess you did that in python.

msynth

2012-04-02 04:22

reporter   ~0001843

Yes I am using Python. I am trying to reproduce the error with detailed circumstances. So, I will inform you afterward.

ms4py

2012-04-02 18:51

reporter   ~0001868

Enabling the log reveals the following info on closing a document (in one example run)

X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
  Major opcode: 53 (X_CreatePixmap)
  Resource id: 0x5000ca0
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
  Extension: 149 (RENDER)
  Minor opcode: 4 (RenderCreatePicture)
  Resource id: 0x5000ca1
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
  Major opcode: 53 (X_CreatePixmap)
  Resource id: 0x5000ca0
X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
  Extension: 149 (RENDER)
  Minor opcode: 4 (RenderCreatePicture)
  Resource id: 0x5000ca1
python2.6: ../../src/xcb_io.c:249: process_responses: Assertion `(((long) (dpy->last_request_read) - (long) (dpy->request)) <= 0)' failed.
Abnormal program termination...

Next call to FreeCAD.open produces then:

<unknown>: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.

Another run prints only on the open call:

<unknown>: Fatal IO error 2 (No such file or directory) on X server :0.0.

These errors are more or less randomly... I have no idea how to reproduce them with a small example.

wmayer

2012-04-03 05:55

administrator   ~0001869

So, if I got you right this happens:
1. At some point FreeCAD crashes due to an assert failure
2. You start FreeCAD again and type in 'FreeCAD.open' in the command line
Question: Do you simply do 'FreeCAD.open' or do you open a real file
3. Message: <unknown>: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.

Nevertheless, I assume there is something wrong with your X server configuration.

ms4py

2012-04-03 19:36

reporter   ~0001876

1. + 2. No, we have a long running Python script. Sometimes the first error (IO error 11) and sometimes the IO error 2 occurs, but this is more or less randomly.
3. No, definitely not. If I run the same code with the test execution tool "nosetests" it runs fine. Really mysterious... :-(

Here is maybe some interesting info from .xsession-errors:

OpenGL Warning: Failed to connect to host. Make sure 3D acceleration is enabled for this VM.
/usr/bin/compiz (core) - Fatal: Software rendering detected.
/usr/bin/compiz (core) - Error: Failed to manage screen: 0
/usr/bin/compiz (core) - Fatal: No manageable screens found on display :0.0

wmayer

2012-04-03 19:51

administrator   ~0001879

Do you have compiz enabled? Switch it off and retry. According to some forum postings the compiz is the reason for some problems on a couple of platforms.

ms4py

2012-04-03 20:42

reporter   ~0001881

Same error with compiz uninstalled. No useful information in .xsession-errors now.

It would say this is a synchronisation problem with threads, here is a similar problem: http://stackoverflow.com/questions/6172020/opengl-rendering-in-a-secondary-thread

ms4py

2012-04-03 20:50

reporter   ~0001882

A thread synchronisation error would be the best explanation for this randomness

wmayer

2012-04-04 04:27

administrator   ~0001883

For rendering we use Coin3D/SoQt and I don't think that this happens multi-threaded -- but I don't know. Or do you use threads in your script?

Another possible explanation could be that we have a memory leak and thus if removing objects from the document doesn't delete the tree items. After some time (in case you have several thousands objects created/deleted) your graphic memory leaks. Or maybe you have too many objects created at a time. How many do you have at a time?

Btw, when you run your script in command line mode (see FreeCADCmd) does it work there? I think it does, but who knows?

So, if checking the above doesn't lead to a solution would it be possible to share your script?

ms4py

2012-04-04 14:40

reporter   ~0001886

No, we don't use threads.

The external Module we are using is doing a lot of Gui stuff like selections etc. but we are not creating a lot of objects (in the case of the error maximal 10 in two files).

The problem is that - as already said - the external Module doing a lot of Gui stuff and so it is mandatory.

I will ask my supervisor about that. Maybe I can create a bundle that has minimal dependencies so you can run it more easily than the original version.

Another hint:
If I call QEventLoop().processEvents() manually in the Python code, the error raises (but only at the special point before opening a document). So it is probably somewhere in a callback function.

ms4py

2012-11-17 21:24

reporter   ~0002548

Just a short update here: Since we run every function accessing the FreeCAD API in a separate process everything is fine. So there is every indication that FreeCAD has (or had) somewhere a memory leak.

Jriegel

2012-12-20 19:26

administrator   ~0002692

Memory leaks in Gui are possible, but without some way to reproduce that
error the devs can't do a thing....

jmaustpc

2015-01-07 16:25

manager   ~0005561

Like Juergen said without some way to reproduce this nothing can be done...can it?

this is very old does it even still happen?

Can I just close this?

Issue History

Date Modified Username Field Change
2012-03-30 08:02 msynth New Issue
2012-03-31 10:57 wmayer Note Added: 0001836
2012-04-02 04:22 msynth Note Added: 0001843
2012-04-02 18:51 ms4py Note Added: 0001868
2012-04-03 05:55 wmayer Note Added: 0001869
2012-04-03 19:36 ms4py Note Added: 0001876
2012-04-03 19:51 wmayer Note Added: 0001879
2012-04-03 20:42 ms4py Note Added: 0001881
2012-04-03 20:50 ms4py Note Added: 0001882
2012-04-04 04:27 wmayer Note Added: 0001883
2012-04-04 14:40 ms4py Note Added: 0001886
2012-11-17 21:24 ms4py Note Added: 0002548
2012-12-20 19:26 Jriegel Note Added: 0002692
2012-12-20 19:26 Jriegel Status new => feedback
2015-01-07 16:25 jmaustpc Note Added: 0005561
2015-01-23 21:44 wmayer Status feedback => closed
2015-01-23 21:44 wmayer Resolution open => unable to reproduce