FAR kills edited file on shared drive (macosx related?)

Here you can report bugs found in Far Manager.
pitt66
Posts: 12
Joined: Fri 26 Aug, 2011 18:10

FAR kills edited file on shared drive (macosx related?)

Post by pitt66 »

Hi All,

I have a problem with FAR under Wndows XP SP3 ran on VirtualBox where host is a MacOSX Lion.
On MacOSX machine I have shared a folder, then in Windows I have mounted it as a drive.

When I try to save an edited file (that is placed on that shared folder), FAR says something like:
"File exists. Cannot save the file aaaa.txt", then I press Retry, and the next message appears:
"Server can perform certain the operation. Cannot save the file aaaa.txt" - If I press Retry
one more time - the file is saved, but when I press Cancel - the file is gone.
Similarly if press Cancel on the first message box and exit without saving - the file is gone too.
The file is removed just after I press F2 (Save)... when the 1st message box is present,
the file is already gone.

I had no problem with FAR 1.7 on WinXP hosted on MacOSX Snow Leopard. After upgrade to MacOSX Lion I experience
the problem. I know that Apple has changed something regards Samba, they have their own implementation shares
or sth like that. I have checked the newest FAR 2, but the problem is still present.

The edited file permissions as visible on macosx:
ls -laO aaaa.txt
-rw------- 1 owner staff - 6 26 Aug 19:12 aaaa.txt

and on Windows there is no other attributes than Archive.

I have checked whether other programs have similar problem ('edit' from cmd, notepad) and they work without problems.
So, I guess, the switch of macosx to Lion causes the problem, but since other programs do not have such problem,
I suspect that there's something wrong with FAR...
I know that it can be hard to reproduce the problem, but I can help you to investigate it - just tell me how can I help you.

Details of apps/OSes:
Windows XP SP3 - the newest patches applied
MacOSX Lion 10.7
FAR 1.7 and 2 (newest stable)

Thanks,
Piotr
User avatar
DrKnS
Posts: 6114
Joined: Thu 04 Aug, 2005 06:44
Location: Kyiv
Has thanked: 12 times
Been thanked: 426 times

Re: FAR kills edited file on shared drive (macosx related?)

Post by DrKnS »

Does it work if you save file with another name via ShiftF2?
Maximus5
Posts: 3295
Joined: Sun 11 Nov, 2007 02:03
Been thanked: 10 times
Contact:

Re: FAR kills edited file on shared drive (macosx related?)

Post by Maximus5 »

Minidump may help to find problem:
run Far2bis and create process memory dump file by ProcessExplorer of far.exe at the moment, when first error box appears
pitt66
Posts: 12
Joined: Fri 26 Aug, 2011 18:10

Re: FAR kills edited file on shared drive (macosx related?)

Post by pitt66 »

DrKnS wrote:Does it work if you save file with another name via ShiftF2?
It works when I save with another name via Shift-F2. Also, when I create a new file via Shift-F4
and save, then it works - but only once. Second attempt fails.
Maximus5 wrote:Minidump may help to find problem:
run Far2bis and create process memory dump file by ProcessExplorer of far.exe at the moment, when first error box appears
Minidump done on x86 version of the attached FAR - you can find it in the attachment. I was trying to create testtest.txt and save it (first attempt succeeded, the second one failed - then I create the minidump).
Attachments
Far-dmp.zip
Minidump of FAR
(91.95 KiB) Downloaded 212 times
pitt66
Posts: 12
Joined: Fri 26 Aug, 2011 18:10

Re: FAR kills edited file on shared drive (macosx related?)

Post by pitt66 »

BTW, in my first post, there is a small mistake in the 2nd message box:
"Server can perform certain the operation. Cannot save the file aaaa.txt"

It should be of course "Server cannot perform certain operation" - although, this message I guess
was originating from Windows and it was written in Polish, so this is my very basic translation to English.
User avatar
DrKnS
Posts: 6114
Joined: Thu 04 Aug, 2005 06:44
Location: Kyiv
Has thanked: 12 times
Been thanked: 426 times

Re: FAR kills edited file on shared drive (macosx related?)

Post by DrKnS »

ok, i try to guess.

when far saves the file, it doesn't deletes old and creates new with same name, instead of this it truncates existing file to zero and fill it with new data. This is necessary to preserve metadata that may be associated with an existing file.
Seems that "Server cannot perform certain operation" means that your server or virtual machine unable to correctly handle TRUNCATE_EXISTING flag of CreateFile function.

Try to apply this patch to far.exe to be sure:

000453F6: 8D 68
000453F7: 0C 02
000453F8: 8D 00
000453F9: 01 00
000453FB: 00 90
000453FC: 00 90
000453FD: 51 90
pitt66
Posts: 12
Joined: Fri 26 Aug, 2011 18:10

Re: FAR kills edited file on shared drive (macosx related?)

Post by pitt66 »

@DrKnS

Thanks for a quick reaction. I have applied your patch on Far.exe v2.0.1807 (latest stable, as the offset matched),
and I see no difference - a mini dump of this version just when the message box appeared is in the attachment (far2-0-1807-drkns.zip).

Thanks
Attachments
far2-0-1807-drkns.zip
minidump of patched version
(216.75 KiB) Downloaded 231 times
pitt66
Posts: 12
Joined: Fri 26 Aug, 2011 18:10

Re: FAR kills edited file on shared drive (macosx related?)

Post by pitt66 »

@Maximus5

I have checked the version, it still fails :/
F2 causes a red message box, pressing retry saves the file, but pressing cancel and then exit without saving leaves no file on shared drive.
Minidump from execution available as an attachment.
Attachments
debug.32.vc.110828.far.zip
minidump from execution of Maximus5 version
(99.33 KiB) Downloaded 217 times
Maximus5
Posts: 3295
Joined: Sun 11 Nov, 2007 02:03
Been thanked: 10 times
Contact:

Re: FAR kills edited file on shared drive (macosx related?)

Post by Maximus5 »

Seems to me, this is not CreateFile (EditFile.Open) problem. When it's fails - GUI MessageBox must appears.
Maximus5
Posts: 3295
Joined: Sun 11 Nov, 2007 02:03
Been thanked: 10 times
Contact:

Re: FAR kills edited file on shared drive (macosx related?)

Post by Maximus5 »

Try this version, "Assert" MessageBox must appear. Take mindump at that moment.
pitt66
Posts: 12
Joined: Fri 26 Aug, 2011 18:10

Re: FAR kills edited file on shared drive (macosx related?)

Post by pitt66 »

In a minute I will check the next version, but in the meantime, I paste here debug log messages from smb on macosx side when failing Save operation was done (aaa.txt was the name of file I tried to save):

Code: Select all

smb1_dispatch_one [smb_dispatch.cpp:377] dispatching SMB_COM_TRANSACTION2
transaction_dispatch [transact.cpp:282] dispatching TRANS2_QUERY_PATH_INFORMATION (function 5)
create_file [create_file.cpp:482] opening name ./aaa.txt
smb1_dispatch_one [smb_dispatch.cpp:377] dispatching SMB_COM_NT_CREATE_ANDX
create_file [create_file.cpp:482] opening name ./.
file_create [create_file.cpp:155] created file handle with FID 0x3
smb1_dispatch_ntcreate [create_file.cpp:216] FIXME request oplock with flags 0x16
smb1_dispatch_one [smb_dispatch.cpp:377] dispatching SMB_COM_TRANSACTION2
transaction_dispatch [transact.cpp:282] dispatching TRANS2_FIND_FIRST2 (function 1)
create_file [create_file.cpp:482] opening name ./.
smb1_dispatch_one [smb_dispatch.cpp:377] dispatching SMB_COM_CLOSE
smb1_dispatch_one [smb_dispatch.cpp:377] dispatching SMB_COM_NT_CREATE_ANDX
create_file [create_file.cpp:482] opening name ./aaa.txt
file_create [create_file.cpp:155] created file handle with FID 0x3
smb1_dispatch_ntcreate [create_file.cpp:216] FIXME request oplock with flags 0x16
smb1_dispatch_one [smb_dispatch.cpp:377] dispatching SMB_COM_TRANSACTION2
transaction_dispatch [transact.cpp:282] dispatching TRANS2_QUERY_FILE_INFORMATION (function 7)
smb1_dispatch_one [smb_dispatch.cpp:377] dispatching SMB_COM_TRANSACTION2
transaction_dispatch [transact.cpp:282] dispatching TRANS2_SET_FILE_INFORMATION (function 8)
smb1_dispatch_one [smb_dispatch.cpp:377] dispatching SMB_COM_TRANSACTION2
transaction_dispatch [transact.cpp:282] dispatching TRANS2_QUERY_FS_INFORMATION (function 3)
trans2_query_filesystem [query_filesystem.cpp:142] info level == 0x1
smb1_dispatch_one [smb_dispatch.cpp:377] dispatching SMB_COM_WRITE
smb1_dispatch_write [write_file.cpp:237] extending EOF from 5 to 8
smb1_dispatch_one [smb_dispatch.cpp:377] dispatching SMB_COM_CLOSE
smb1_dispatch_one [smb_dispatch.cpp:377] dispatching SMB_COM_NT_CREATE_ANDX
create_file [create_file.cpp:482] opening name ./aaa.txt
file_create [create_file.cpp:155] created file handle with FID 0x3
smb1_dispatch_one [smb_dispatch.cpp:377] dispatching SMB_COM_TRANSACTION2
transaction_dispatch [transact.cpp:282] dispatching TRANS2_SET_FILE_INFORMATION (function 8)
smb1_dispatch_one [smb_dispatch.cpp:377] dispatching SMB_COM_CLOSE
smb1_dispatch_completion [smb_dispatch.cpp:600] dispatching SMB_COM_NT_TRANSACT
smb1_dispatch_completion [smb_dispatch.cpp:600] dispatching SMB_COM_NT_TRANSACT
smb1_dispatch_one [smb_dispatch.cpp:377] dispatching SMB_COM_NT_TRANSACT
transaction_dispatch [transact.cpp:282] dispatching NT_TRANSACT_NOTIFY_CHANGE (function 4)
kqueue_monitor [darwin_notify.cpp:36] ignoring recursive flag
smb1_dispatch_one [smb_dispatch.cpp:377] dispatching SMB_COM_NT_TRANSACT
transaction_dispatch [transact.cpp:282] dispatching NT_TRANSACT_NOTIFY_CHANGE (function 4)
kqueue_monitor [darwin_notify.cpp:36] ignoring recursive flag
smb1_dispatch_one [smb_dispatch.cpp:377] dispatching SMB_COM_NT_CREATE_ANDX
create_file [create_file.cpp:482] opening name ./.
file_create [create_file.cpp:155] created file handle with FID 0x3
smb1_dispatch_ntcreate [create_file.cpp:216] FIXME request oplock with flags 0x16
smb1_dispatch_one [smb_dispatch.cpp:377] dispatching SMB_COM_TRANSACTION2
transaction_dispatch [transact.cpp:282] dispatching TRANS2_FIND_FIRST2 (function 1)
create_file [create_file.cpp:482] opening name ./.
query_attribute_list [darwin_getattrlist.hpp:614] getattrlist failed on name=aaa.txt: No such file or directory
smb1_dispatch_one [smb_dispatch.cpp:377] dispatching SMB_COM_CLOSE
smb1_dispatch_one [smb_dispatch.cpp:377] dispatching SMB_COM_TRANSACTION2
transaction_dispatch [transact.cpp:282] dispatching TRANS2_QUERY_PATH_INFORMATION (function 5)
query_attribute_list [darwin_getattrlist.hpp:614] getattrlist failed on name=aaa.txt: No such file or directory
create_file [create_file.cpp:482] opening name ./aaa.txt
smb1_dispatch_one [smb_dispatch.cpp:377] dispatching SMB_COM_TRANSACTION2
transaction_dispatch [transact.cpp:282] dispatching TRANS2_QUERY_PATH_INFORMATION (function 5)
query_attribute_list [darwin_getattrlist.hpp:614] getattrlist failed on name=aaa.txt: No such file or directory
create_file [create_file.cpp:482] opening name ./aaa.txt
smb1_dispatch_one [smb_dispatch.cpp:377] dispatching SMB_COM_TRANSACTION2
transaction_dispatch [transact.cpp:282] dispatching TRANS2_FIND_FIRST2 (function 1)
pitt66
Posts: 12
Joined: Fri 26 Aug, 2011 18:10

Re: FAR kills edited file on shared drive (macosx related?)

Post by pitt66 »

Ok, Assertion has appeared. Minidump in the attachment.
Attachments
debug.asset.far.zip
Minidump when assertion triggered.
(100.17 KiB) Downloaded 229 times
pitt66
Posts: 12
Joined: Fri 26 Aug, 2011 18:10

Re: FAR kills edited file on shared drive (macosx related?)

Post by pitt66 »

In the attachment.

This time I've seen 3 asserts, so I've made 3 subsequent minidumps:
2nd-1st-assert_debug.asset.far.dmp
2nd-2nd-assert_debug.asset.far.dmp
2nd-3rd-assert_debug.asset.far.dmp

Have a good luck!
Attachments
2nd-3rd-assert_debug.asset.far.zip
assert #3
(100.39 KiB) Downloaded 234 times
2nd-2nd-assert_debug.asset.far.zip
assert #2
(100.49 KiB) Downloaded 226 times
2nd-1st-assert_debug.asset.far.zip
assert #1
(100.61 KiB) Downloaded 219 times
Last edited by pitt66 on Mon 29 Aug, 2011 23:09, edited 1 time in total.
Post Reply

Return to “Bug Reports”