X-MimeOLE: Produced By Microsoft Exchange V6.5
Received: by onstor-exch02.onstor.net 
	id <01C7876A.469484AB@onstor-exch02.onstor.net>; Wed, 25 Apr 2007 11:48:12 -0700
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Content-class: urn:content-classes:message
Subject: RE: Puhleeze reeevue
Date: Wed, 25 Apr 2007 11:48:13 -0700
Message-ID: <BB375AF679D4A34E9CA8DFA650E2B04E036D306A@onstor-exch02.onstor.net>
In-Reply-To: <20070425114446.4b5f4df9@ripper.onstor.net>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: Puhleeze reeevue
Thread-Index: AceHacvtl7ltS0TjTBixXkm7DUt7NgAABWBw
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>
From: "Maxim Kozlovsky" <maxim.kozlovsky@onstor.com>
To: "Andy Sharp" <andy.sharp@onstor.com>

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=20
Sent: Wednesday, April 25, 2007 11:45 AM
To: Maxim Kozlovsky
Subject: Re: Puhleeze reeevue

It segfault the very first time the "*on++ =3D ' ';" 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.=20
>=20
> Can you change this code:
>=20
> 				if (on) {
> 					int s =3D 6;
>=20
> 					while (s--) {
> 						*on++ =3D ' ';
> 					}
> 				}
>=20
> To=20
> 	If (on) {
> 		Memset(on, ' ', strlen("onstor"));
> 	}
>=20
> Hard to figure if you set the required number of spaces correctly with
> all those -- and ++.
>=20
> -----Original Message-----
> From: Andy Sharp=20
> Sent: Wednesday, April 25, 2007 11:21 AM
> To: Maxim Kozlovsky
> Subject: Re: Puhleeze reeevue
>=20
> I guess it was placing the string in const memory area.  So when code
> attempting to modify it was executed, it segfaulted.
>=20
>=20
> On Wed, 25 Apr 2007 11:11:00 -0700 "Maxim Kozlovsky"
> <maxim.kozlovsky@onstor.com> wrote:
>=20
> > What exactly was the reason for segfaulting?=20
> >=20
> > -----Original Message-----
> > From: Andy Sharp=20
> > Sent: Wednesday, April 25, 2007 11:01 AM
> > To: Maxim Kozlovsky
> > Subject: Puhleeze reeevue
> >=20
> > change 23713 branch FB-DELOREAN client ripper
> >=20
> > Fix for segfault when doing a system copy all from new flash layout
> > to old flash layout.
> >=20
> > 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:
> >=20
> > char *foo =3D "bar";
> >=20
> > but is not segfaulting if I change it to
> >=20
> > char foo[] =3D "bar";
> >=20
> > 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.
> >=20
> > Would like your opinion on why this worked once and suddenly stopped
> > working in Delorean rc13.
