AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:<20080407140224.5c41c586@ripper.onstor.net>
CFG:
PT:0
S:andy.sharp@onstor.com
RQ:
SSV:onstor-exch02.onstor.net
NSV:
SSH:
R:<henry.lau@onstor.com>,<jobi.ariyamannil@onstor.com>
MAID:1
X-Sylpheed-Privacy-System:
X-Sylpheed-Sign:0
SCF:#mh/Mailbox/sent
RMID:#imap/andys@onstor.net@onstor-exch02.onstor.net/INBOX	0	BB375AF679D4A34E9CA8DFA650E2B04E05DA1D19@onstor-exch02.onstor.net
X-Sylpheed-End-Special-Headers: 1
Date: Mon, 7 Apr 2008 14:02:36 -0700
From: Andrew Sharp <andy.sharp@onstor.com>
To: "Henry Lau" <henry.lau@onstor.com>
Cc: "Jobi Ariyamannil" <jobi.ariyamannil@onstor.com>
Subject: Re: PERFORCE change 28718 for review
Message-ID: <20080407140236.1a06e52d@ripper.onstor.net>
In-Reply-To: <BB375AF679D4A34E9CA8DFA650E2B04E05DA1D19@onstor-exch02.onstor.net>
References: <20080407134925.5a6153f1@ripper.onstor.net>
	<BB375AF679D4A34E9CA8DFA650E2B04E05DA1D19@onstor-exch02.onstor.net>
Organization: Onstor
X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

In your change, quite a few lines are modified, but with no behavioral
changes to routine at all.  On top of that you changed 'done' to be a
byte wide, instead of an integer, for no apparent reason, but
with the result that it is slowing the whole routine down.

If you're getting segfaults, you're the only one.  Most likely you are
not running the code you think you are.



On Mon, 7 Apr 2008 13:54:00 -0700 "Henry Lau" <henry.lau@onstor.com>
wrote:

> HI Andy,
> 
> I hit this all the times in Bobcat, check the crash below. I need to
> understand what wrong with the changes.
> 
> 1 #0  0x50ac9b78 in mkpath (path=0x50ac2d88 "/mnt1", mode=493,
> dir_mode=493)
>   2     at fs.c:637
>   3     fs.c:637: No such file or directory.
>   4     (gdb) dir /mnt/ssc-genlib
>   5     Source directories searched: /mnt/ssc-genlib:$cdir:$cwd
>   6 632         while (!done) {
>   7     633             slash += strspn(slash, "/");
>   8     634             slash += strcspn(slash, "/");
>   9     635
>  10     636             done = (*slash == '\0');
>  11     637             *slash = '\0';
>  12     638
>  13     639             if (stat(path, &sb)) {
>  14     640                 if (errno != ENOENT ||
>  15     641                     (mkdir(path, done ? mode : dir_mode)
> && 16 (gdb) bt
>  17 #0  0x50ac9b78 in mkpath (path=0x50ac2d88 "/mnt1", mode=493,
> dir_mode=493)
>  18             at fs.c:637
>  19 #1  0x50ac9d98 in mkpath1 (path=0x50ac2d88 "/mnt1", mode=493) at
> fs.c:667
>  20 #2  0x50ac93d8 in modify_readonly_file (path=0x50ac2d88 "/mnt1",
>  21                 vfun=0x50ac9d30, arg=0x1ed) at fs.c:465
>  22 #3  0x50ac9e6c in ensure_dir_exists (path=0x50ac2d88 "/mnt1",
> mode=493)
>  23                     at fs.c:689
>  24 #4  0x50ae4fec in make_secondary_fstabs (verbose=1) at
> fs-vector.c:91
>  25 #5  0x5023cd3c in copy_to_secondary (
>  26                         files=0x500dd000 ".cshrc .profile
> 4.4BSD.dist
>  27                         altroot bin bsd dev etc home mnt root sbin
> txrx_bc
>  28                         .bin fp_bc.bin fc_bc.bin stand tmp usr
> onstor var
>  29                         version", tar_only=1 '\001') at
> cmd_flash.c:536
>  30 #6  0x5023d268 in do_copy_all (argc=0, argv=0x7ffff468) at
> cmd_flash.c:632
>  31 #7  0x501d7f84 in system_copy_all (self=0x50268998,
> vty=0x10047200, argc=0,
>  32                             argv=0x7ffff468) at cmd_system.c:2411
>  33 #8  0x5021ea70 in cmd_execute_command (vline=0x100e5080,
> vty=0x10047200,
>  34                                 cmd=0x7ffff530) at command.c:1912
>  35
> 
> -----Original Message-----
> From: Andy Sharp 
> Sent: Monday, April 07, 2008 1:49 PM
> To: Henry Lau
> Cc: Jobi Ariyamannil
> Subject: Re: PERFORCE change 28718 for review
> 
> On 7 Apr 2008 13:25:01 -0700 henryl <henry.lau@onstor.com> wrote:
> 
> > Change 28718 by henryl@henryl-linux on 2008/04/07 13:20:37
> > 
> > 	   Fixed segmentation fault like system copy all.
> > 	   In mkpath(), do not add any char to the string after
> > strcspn() once it reaches the end, ie done is set to TRUE. Reviewed
> > by Jobia.
> > 
> > Affected files ...
> > 
> > ... //depot/dev/nfx-tree/code/ssc-genlib/fs.c#9 edit
> 
> This change is quite broken, please revert it.  And please send the
> review to the right person in the future?
> 
> Thanks,
> 
> a
> 
