You did the same thing on both servers and on one of them it worked and on
the other it didn't?!!
Do both servers have the same RAM size? (run free to know)
Also any luck with *strace* suggested by Zaid? please send us the output on
both servers.
On 4/5/07, Ala'a Ibrahim <[EMAIL PROTECTED]> wrote:
>
> hi thanks for the help
> i made
> $ mkdir -p
> {1,2,3,4,5,6,7,8,9,a,b,c,d,e,f}/{1,2,3,4,5,6,7,8,9,a,b,c,d,e,f}/{1,2,3,4,5,6,7,8,9,a,b,c,d,e,f}
> $ touch f{1,2,3,4,5,6,7,8,9,a,b,c,d,e,f}.txt
> $ touch
> {1,2,3,4,5,6,7,8,9,a,b,c,d,e,f}/f{1,2,3,4,5,6,7,8,9,a,b,c,d,e,f}.txt
> $ touch
> {1,2,3,4,5,6,7,8,9,a,b,c,d,e,f}/{1,2,3,4,5,6,7,8,9,a,b,c,d,e,f}/f{1,2,3,4,5,6,7,8,9,a,b,c,d,e,f}.txt
> $ for i in 1 2 3 4 5 6 7 8 9 a b c d e f
> > do
> > cd $i
> > touch
> {1,2,3,4,5,6,7,8,9,a,b,c,d,e,f}/{1,2,3,4,5,6,7,8,9,a,b,c,d,e,f}/f{1,2,3,4,5,6,7,8,9,a,b,c,d,e,f}.txt
>
> > cd ..
> > done
>
> I guess that is enough.
> I've ran it on another server (that should be identical to it) it worked,
> I ran it as a root on that server, it worked, I ran it as some other users,
> it didn't, giving the same problem. (I even created a new user).
>
> and
> $ cat /proc/version
> Linux version 2.6.9-22.ELsmp ([EMAIL PROTECTED]) (gcc
> version 3.4.4 20050721 (Red Hat 3.4.4-2)) #1 SMP Mon Sep 19 18:32:14 EDT
> 2005
>
> and no there is no SELinux running on it.
>
> On 4/5/07, Khamis Siksek <[EMAIL PROTECTED]> wrote:
> >
> > What is the distro you are using? Do you run SELinux on it?
> >
> > Also I would like you to check something for me, I want to isolate the
> > problem (in some machines there could be environmental issues, library
> > issues, filesystem issues, and hidden files and directories or even links)
> >
> > So please create a directory on your own, with some sub directories and
> > sub sub directories ( a total of 15 directories and their subs and sub subs
> > and sub sub subs and ... :-) ), and run your application on that directory.
> > Do the same on one of the servers that your application run on them.
> >
> > Waiting for the testing result.
> >
> > On 4/5/07, Ala'a Ibrahim < [EMAIL PROTECTED]> wrote:
> > >
> > > it's not even in the top, all what is in the top is httpd, mysqld,
> > > top, rsync
> > > also the application doesn't take that long i.e running time on the
> > > command
> > >
> > > root user (works fine):
> > > real 0m0.097s
> > > user 0m0.001s
> > > sys 0m0.059s
> > >
> > > another user (faulty):
> > > real 0m0.040s
> > > user 0m0.001s
> > > sys 0m0.031s
> > >
> > > On 4/5/07, Khamis Siksek < [EMAIL PROTECTED]> wrote:
> > >
> > > > The 2GB memory is free while your readdir is running?
> > > > run readdir and top (to monitor the system), check readdir status in
> > > > top and send us a snapshot of it.
> > > >
> > > > On 4/5/07, Ala'a Ibrahim <[EMAIL PROTECTED]> wrote:
> > > > >
> > > > > root:
> > > > > core file size (blocks, -c) 0
> > > > > data seg size (kbytes, -d) unlimited
> > > > > file size (blocks, -f) unlimited
> > > > > pending signals (-i) 1024
> > > > > max locked memory (kbytes, -l) 32
> > > > > max memory size (kbytes, -m) unlimited
> > > > > open files (-n) 1024
> > > > > pipe size (512 bytes, -p) 8
> > > > > POSIX message queues (bytes, -q) 819200
> > > > > stack size (kbytes, -s) 10240
> > > > > cpu time (seconds, -t) unlimited
> > > > > max user processes (-u) 74752
> > > > > virtual memory (kbytes, -v) unlimited
> > > > > file locks (-x) unlimited
> > > > > the other user:
> > > > > core file size (blocks, -c) 0
> > > > > data seg size (kbytes, -d) unlimited
> > > > > file size (blocks, -f) unlimited
> > > > > pending signals (-i) 1024
> > > > > max locked memory (kbytes, -l) 32
> > > > > max memory size (kbytes, -m) unlimited
> > > > > open files (-n) 1024
> > > > > pipe size (512 bytes, -p) 8
> > > > > POSIX message queues (bytes, -q) 819200
> > > > > stack size (kbytes, -s) 10240
> > > > > cpu time (seconds, -t) unlimited
> > > > > max user processes (-u) 74752
> > > > > virtual memory (kbytes, -v) unlimited
> > > > > file locks (-x) unlimited
> > > > >
> > > > > they are identical
> > > > >
> > > > > On 4/5/07, Yaman Saqqa <[EMAIL PROTECTED]> wrote:
> > > > > >
> > > > > > Do you mind sending the output of `ulimit -a` ran once as root
> > > > > > and once as the user you're running the code with.
> > > > > >
> > > > > > On 4/5/07, Ala'a Ibrahim < [EMAIL PROTECTED]> wrote:
> > > > > > >
> > > > > > > thanks Yaman,
> > > > > > > the error code it's returning is 12, which is Cannot allocate
> > > > > > > memory.
> > > > > > > I checked the ram there is 2 GB free there, and the folder is
> > > > > > > not that huge.
> > > > > > >
> > > > > > > On 4/5/07, Yaman Saqqa <[EMAIL PROTECTED]> wrote:
> > > > > > >
> > > > > > > > Let's start by modifying the code to check errno after the
> > > > > > > > NULL returns to figure out what exactly is the error.
> > > > > > > >
> > > > > > > > On 4/5/07, Ala'a Ibrahim < [EMAIL PROTECTED]> wrote:
> > > > > > > > >
> > > > > > > > > Hi All,
> > > > > > > > > I'm having this problems, a couple of days ago, one of the
> > > > > > > > > servers started to have some problems with readdir, I've
> > > > > > > > > written this code
> > > > > > > > > to test:
> > > > > > > > > #include <sys/types.h>
> > > > > > > > > #include <dirent.h>
> > > > > > > > > #include <string.h>
> > > > > > > > > #include <stdlib.h>
> > > > > > > > > #include <stdio.h>
> > > > > > > > >
> > > > > > > > > int thruDirectories (char *dirName) {
> > > > > > > > > DIR *directory;
> > > > > > > > > struct dirent *fileData;
> > > > > > > > > char newdirname[5000] = "";
> > > > > > > > > size_t leng;
> > > > > > > > > directory = opendir(dirName);
> > > > > > > > > while(fileData = readdir(directory)) {
> > > > > > > > > if(fileData->d_name[0] == '.') {
> > > > > > > > > continue;
> > > > > > > > > }
> > > > > > > > > if(fileData->d_type == 4) {
> > > > > > > > > leng = strlen(dirName) +
> > > > > > > > > strlen(fileData->d_name) + 2;
> > > > > > > > > newdirname[0]='\0';
> > > > > > > > > strcat(newdirname,dirName);
> > > > > > > > > strcat(newdirname,"/");
> > > > > > > > > strcat(newdirname,fileData->d_name);
> > > > > > > > > fprintf(stderr,"dirname is %s\n" ,newdirname);
> > > > > > > > > thruDirectories(newdirname);
> > > > > > > > > continue;
> > > > > > > > > }
> > > > > > > > > fprintf(stderr,"%s/%s\n",dirName,fileData->d_name
> > > > > > > > > );
> > > > > > > > > }
> > > > > > > > > closedir(directory);
> > > > > > > > > return 0;
> > > > > > > > > }
> > > > > > > > >
> > > > > > > > > main() {
> > > > > > > > > thruDirectories("Desktop");
> > > > > > > > > }
> > > > > > > > >
> > > > > > > > > this code is supposed to go through a directory, parse
> > > > > > > > > it's print it's content, if it's a directory, recursively
> > > > > > > > > parse it again.
> > > > > > > > > now if you are root, everything works fine.
> > > > > > > > > any other user, some of the subdirectories would not get
> > > > > > > > > parsed due to that readdir is returning NULL the first time
> > > > > > > > > it gets in (it
> > > > > > > > > even doesn't get the '.' and '..' folders).
> > > > > > > > >
> > > > > > > > > and yes I've checked the files permissions, ulimit, glibc,
> > > > > > > > > and now I'm out of ideas. and the problem only started a
> > > > > > > > > couple of days ago,
> > > > > > > > > it was running fine before. running the original code on
> > > > > > > > > other servers
> > > > > > > > > doesn't have a problem
> > > > > > > > > anybody have a clue ... please help me out. as now the
> > > > > > > > > only solution I have is to back up the server, and reinstall
> > > > > > > > > Linux, and I'm
> > > > > > > > > hoping not to reach that point.
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > Ala'a A. Ibrahim
> > > > > > > > > http://guru.alaa-ibrahim.com/
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > abulyomon
> > > > > > > >
> > > > > > > > www.KiLLTHeUPLiNK.com
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Ala'a A. Ibrahim
> > > > > > > http://guru.alaa-ibrahim.com/
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > abulyomon
> > > > > >
> > > > > > www.KiLLTHeUPLiNK.com
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Ala'a A. Ibrahim
> > > > > http://guru.alaa-ibrahim.com/
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > >
> > > > Khamis Siksek
> > > > http://saksoook.blogspot.com
> > > >
> > > >
> > >
> > >
> > > --
> > > Ala'a A. Ibrahim
> > > http://guru.alaa-ibrahim.com/
> > >
> > >
> >
> >
> > --
> >
> > Khamis Siksek
> > http://saksoook.blogspot.com
> >
> >
>
>
> --
> Ala'a A. Ibrahim
> http://guru.alaa-ibrahim.com/
> >
>
--
Khamis Siksek
http://saksoook.blogspot.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Jolug" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Jolug?hl=en-GB
-~----------~----~----~----~------~----~------~--~---