Bug 553959 - Blender can't save over /tmp/quit.blend
Summary: Blender can't save over /tmp/quit.blend
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: blender
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jochen Schmitt
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-01-09 18:50 UTC by Andrew Clayton
Modified: 2010-01-26 00:54 UTC (History)
2 users (show)

Fixed In Version: 2.49b-5.fc12
Clone Of:
Environment:
Last Closed: 2010-01-26 00:54:14 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Andrew Clayton 2010-01-09 18:50:59 UTC
Description of problem:

Blender is unable to save over an existing /tmp/quit.blend
 
Version-Release number of selected component (if applicable):

blender-2.49b-1.fc12.x86_64

How reproducible:

100%

Steps to Reproduce:
1. Start blender with no /tmp/quit.blend file
2. Do some change, e.g x then enter (to delete the cube)
3. Quit
4. Repeat the above with the /tmp/quit.blend file

  
Actual results:

Quitting on the second run results in error dialogue say it can't save to /tmp/quit.blend, check you have permissions. 

Expected results:

Save to /tmp/quit.blend and don't give any error.

Additional info:

This seems to be due to blender opening the file as

21265 open("/tmp/quit.blend", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC, 0666) = -1 EEXIST (File exists)

The combination of O_CREAT and O_EXCL on an already existing file is an error.

I'm guessing this is from some patch applied to the Fedora Blender package as Blender 2.49b from upstream doesn't have this problem.

29128 open("/tmp/quit.blend", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 5


Cheers,
Andrew

Comment 1 Jochen Schmitt 2010-01-12 15:16:33 UTC
This change was make to fix BZ #444535 where a rece condition was reported.

It may be nice if you can tell me, which file permission the /tmp/quit.blend file has on your system after you have finished blender.

From my point of view O_EXCL means, that nobody may open the file during the time where the file is opened. but after the end of the application the file shound be accessable.

Comment 2 Andrew Clayton 2010-01-12 17:03:08 UTC
I was just reading the man page.

O_EXCL Ensure that this call creates the file: if this flag  is  speci-
              fied  in  conjunction with O_CREAT, and pathname already exists,
              then open() will fail.


Hopefully the following helps.

$ umask
0007
$ ls -l /tmp/quit.blend
ls: cannot access /tmp/quit.blend: No such file or directory
$ blender

(make some change, quit)

$ ls -l /tmp/quit.blend
-rw-rw---- 1 andrew andrew 54884 Jan 12 16:58 /tmp/quit.blend
$ blender

(make some change quit)

Get the error message.

This is due (according to the man page) to O_EXCL|O_CREAT being used an existing file.

Comment 3 Andrew Clayton 2010-01-12 17:07:14 UTC
Oh yeah, forgot to mention that blender is actually segfaulting at this point.

$ blender
Compiled with Python version 2.6.2.
Checking for installed Python... got it!
mywinset 29555: doesn't exist
/usr/bin/blender: line 92: 35589 Segmentation fault      /usr/bin/${blend}.bin $@

and in dmesg

blender.bin[35589] general protection ip:554a38 sp:7fff0a79a4c8 error:0 in blender.bin[400000+b98000]

If you don't have an existing /tmp/quit.blend you get a clean exit

$ blender
Compiled with Python version 2.6.2.
Checking for installed Python... got it!
Saved session recovery to /tmp/quit.blend

Blender quit

Comment 4 Andrew Clayton 2010-01-12 17:14:06 UTC
Maybe it needs to be a bit more more clever and check for the existence of the file first, it if exists and is a regular file owned by the user running blender then do something like save the quit.blend as something like (random file name) quit.blend-tmpxdsa13 and then do a rename over quit.blend.

If there's a quit.blend owned by another user, then I don't know.

Comment 5 Jochen Schmitt 2010-01-13 19:40:30 UTC
It may be nice, if you can try out blender-2.49b-5.fc13, which should be available in rawhide in the next days.

Comment 6 Fedora Update System 2010-01-18 17:29:56 UTC
blender-2.49b-5.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/blender-2.49b-5.fc12

Comment 7 Fedora Update System 2010-01-19 19:33:02 UTC
blender-2.49b-5.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update blender'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2010-0753

Comment 8 Andrew Clayton 2010-01-23 02:25:13 UTC
Yes, that update seems to have fixed the issue.

Cheers,
Andrew

Comment 9 Fedora Update System 2010-01-26 00:54:10 UTC
blender-2.49b-5.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.