[Lazarus] strange linux problem

brian brian at meadows.pair.com
Mon Feb 24 08:54:03 CET 2014


On 02/19/2014 08:42 AM, brian wrote:
> On 02/19/2014 04:07 AM, Mattias Gaertner wrote:
>> On Wed, 19 Feb 2014 03:46:51 -0500
>> brian <brian at meadows.pair.com> wrote:
>>
>>> [...]
>>> on a network drive. This is using Debian 7.2, and a recent svn version
>>> of Lazarus (I actually use fpcup to do the downloads and builds). The
>>> information on the 'About' page is version 1.3, date 2014-02-12, fpc
>>> version 2.6.3, svn revision 44027, x86_64-linux-gtk 2
>>> [...]
>>> chmods and/or deletes on the files on the network drive.
>>> Stepping through with the debugger, some, but not all, of the
>>> attempted chmods return a status of -1. Some, but not all, of the
>>> calls to sysutils.deletefile return false. What is puzzling me is that
>>> if, instead of calling fpchmod and sysutils.deletefile I instead call
>>> fpsystem and do the operations that way, it works. I can also run up a
>>> command prompt and do the failed operations that way with no problem.
>>> [...]
>>
>> Is it reproducable on the same file?
>
> On the basis of two examples of each, yes.
>
>> Can you give an example file name?
>
> Two of the files which failed to delete are unknown.mp4 and video_ts.vob.
>
> Two files where the attempt to chmod them failed are
> The_Buddhas_Instruction_to_his_son.mp4 and
> Yogis_Of_Tibet_Rare_Documentary.mp4
>
> In all cases, the full paths are made up of
> ['A'..'Z','a'..'z','0'..'9','_'] only
>
> (well, also '/' and '.', obviously!)
>
>
>> What kind of network share?
>>
> It's a Western Digital 4TB "My Cloud" drive, with the shared /nfs
> directory on the drive mounted to a root-level directory on my PC.
>
> Nobody else is using the drive - I've only two PCs on the LAN, and my
> wife's machine was switched off. The drive is hanging off one of the
> ports of my four-port Linksys router.
>
>> Special characters, wrong encoding, server lock, faulty network.
>>
>
> Definitely not the first. I've written out the full paths to a log
> file, and they are correct - editing the logs and putting an 'ls ' in
> front of the file names provides the expected results. The drive is
> powered down overnight, and I'm the only user, so I can't see how
> there could be a server lock unless there's something wrong with the
> drive. I've seen nothing else to indicate a faulty router.
>
>
> I know this all sounds crazy. I wouldn't have believed it had I not
> been seeing it for myself. The only thing I could come up with (and
> the reason for my post here) was that single-stepping under the
> debugger somehow caused the problem.
>
> I'm not asking anybody to do any amount of research on this - it's
> trivial for me to tweak the program so that it writes commands to a
> file rather than tries to run the chmods and deletes, and I can just
> run the resulting file from the CLI.
>


I'm sorry for the delay in replying, folks. Programming is now just a 
hobby for me, and other things got in the way.


Mattias:

I was single stepping in the debugger just to check I'd not made any 
mistakes in the code - I didn't have the nerve to run the program in 
its entirety yet, it would be a lot of work if I'd made a mistake 
somewhere and had to rebuild all the network drive stuff.

What I did was to write a small test application, all it is is a 
button on a form (I wanted to stick with the GUI, as that's what the 
real program is) and the OnClick tries to chmod and delete those two 
pairs of files which I mentioned above. I compiled this and then ran 
it outside of the IDE (I can send you the project if you wish, but it 
really is that simple). The program worked just fine.



Mark:

The directory and file ownerships, permissions etc was the first thing 
I checked, they're not symlinks, and no, nothing else had them open.


Bart and Reinier:

It's an NFS share, no Samba involved.


Waldo:

I think you've got the answer. I added the suggested delay (0.25 
second) before each of the chmod and delete operations, and while the 
deletions are done, I let the chmods all run again, and got no errors 
whatsoever. It does begin to look like the drive couldn't keep pace 
with it all. I don't have enough experience with this sort of 
configuration to know whether that's something to expect or whether 
it's a problem with my particular setup, but since I now have three 
workrounds that work (add a delay, use an fpSystem call instead or 
write a script) then that's fine by me.


Thanks for the suggestions, all.


Brian.



Thanks for the assistance, folks.




More information about the Lazarus mailing list