AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:<20070425132650.6fe9cf8d@ripper.onstor.net>
CFG:
PT:0
S:andy.sharp@onstor.com
RQ:
SSV:onstor-exch02.onstor.net
NSV:
SSH:
R:<maxim.kozlovsky@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	BB375AF679D4A34E9CA8DFA650E2B04E036D306A@onstor-exch02.onstor.net
X-Sylpheed-End-Special-Headers: 1
Date: Wed, 25 Apr 2007 13:27:10 -0700
From: Andrew Sharp <andy.sharp@onstor.com>
To: "Maxim Kozlovsky" <maxim.kozlovsky@onstor.com>
Subject: Re: Puhleeze reeevue
Message-ID: <20070425132710.6c328922@ripper.onstor.net>
In-Reply-To: <BB375AF679D4A34E9CA8DFA650E2B04E036D306A@onstor-exch02.onstor.net>
References: <20070425110122.6c306c49@ripper.onstor.net>
	<BB375AF679D4A34E9CA8DFA650E2B04E036D2FEB@onstor-exch02.onstor.net>
	<20070425112039.15243d9e@ripper.onstor.net>
	<BB375AF679D4A34E9CA8DFA650E2B04E036D3010@onstor-exch02.onstor.net>
	<20070425114446.4b5f4df9@ripper.onstor.net>
	<BB375AF679D4A34E9CA8DFA650E2B04E036D306A@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

The code seems perfectly clear to me.  Here, I'll comment it.

I've made a couple of more changes.  Tell me what you think now.

a

On Wed, 25 Apr 2007 11:48:13 -0700 "Maxim Kozlovsky"
<maxim.kozlovsky@onstor.com> wrote:

> The change to memset is for code clarity, not for fixing the problem.
> The change from * to [] fixes the problem.
> 
> -----Original Message-----
> From: Andy Sharp 
> Sent: Wednesday, April 25, 2007 11:45 AM
> To: Maxim Kozlovsky
> Subject: Re: Puhleeze reeevue
> 
> It segfault the very first time the "*on++ = ' ';" line attempts to
> execute.
> 
> If you change to memset, it just segfaults inside memset.
> 
> 
> On Wed, 25 Apr 2007 11:22:58 -0700 "Maxim Kozlovsky"
> <maxim.kozlovsky@onstor.com> wrote:
> 
> > Ok. 
> > 
> > Can you change this code:
> > 
> > 				if (on) {
> > 					int s = 6;
> > 
> > 					while (s--) {
> > 						*on++ = ' ';
> > 					}
> > 				}
> > 
> > To 
> > 	If (on) {
> > 		Memset(on, ' ', strlen("onstor"));
> > 	}
> > 
> > Hard to figure if you set the required number of spaces correctly
> > with all those -- and ++.
> > 
> > -----Original Message-----
> > From: Andy Sharp 
> > Sent: Wednesday, April 25, 2007 11:21 AM
> > To: Maxim Kozlovsky
> > Subject: Re: Puhleeze reeevue
> > 
> > I guess it was placing the string in const memory area.  So when
> > code attempting to modify it was executed, it segfaulted.
> > 
> > 
> > On Wed, 25 Apr 2007 11:11:00 -0700 "Maxim Kozlovsky"
> > <maxim.kozlovsky@onstor.com> wrote:
> > 
> > > What exactly was the reason for segfaulting? 
> > > 
> > > -----Original Message-----
> > > From: Andy Sharp 
> > > Sent: Wednesday, April 25, 2007 11:01 AM
> > > To: Maxim Kozlovsky
> > > Subject: Puhleeze reeevue
> > > 
> > > change 23713 branch FB-DELOREAN client ripper
> > > 
> > > Fix for segfault when doing a system copy all from new flash
> > > layout to old flash layout.
> > > 
> > > Somewhere, somehow, this code used to work, and now in Delorean
> > > rc13 it is segfaulting when trying to modify a character array
> > > created this way:
> > > 
> > > char *foo = "bar";
> > > 
> > > but is not segfaulting if I change it to
> > > 
> > > char foo[] = "bar";
> > > 
> > > for obvious reasons, so that's what I did.  In the meantime, code
> > > scanning revealed a couple of other bug fixes that I threw in.
> > > 
> > > Would like your opinion on why this worked once and suddenly
> > > stopped working in Delorean rc13.
