I just want to report a problem I saw on linux 2.5.70:
(since I have a workaround, I do not intend to debug this further)
the following program locks up the computer.
sometimes this has happened after about 16MB,
sometimes after about 64MB...
main()
{
int f = open("/dev/hda1", O_RDWR);
char buffer[8192];
for(i=0;1;i++) {
printf("%d\r", i);
write(f, buffer, sizeof(buffer);
/* fsync(f); */
}
close(f)
}
when using adding the fsync(), all goes fine!
_________________________________________________________________
Receive your Hotmail & Messenger messages on your mobile phone with MSN
Mobile http://www.msn.be/gsm/smsservices
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Wednesday 06 August 2003 14:32, lode leroy wrote:
> main()
> {
> int f = open("/dev/hda1", O_RDWR);
> char buffer[8192];
> for(i=0;1;i++) {
> printf("%d\r", i);
> write(f, buffer, sizeof(buffer);
Shouldn't this be:
write(f, buffer, sizeof(buffer) / sizeof(buffer[0]));
And what are you thying to do with the code?
> /* fsync(f); */
> }
> close(f)
> }
- --
Regards Michael Buesch [ http://www.8ung.at/tuxsoft ]
Penguin on this machine: Linux 2.6.0-test2 - i386
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE/MPjvoxoigfggmSgRAkhNAJ40TUOftJfk/wa+g6B6gFiRSEdsNwCeJ/Tc
YH8xVddWCQZzozFNlIxT14o=
=x0ge
-----END PGP SIGNATURE-----
On Wed, 2003-08-06 at 14:32, lode leroy wrote:
> I just want to report a problem I saw on linux 2.5.70:
> (since I have a workaround, I do not intend to debug this further)
>
> the following program locks up the computer.
> sometimes this has happened after about 16MB,
> sometimes after about 64MB...
Don't you think 2.5.70 is a little bit obsolete now? ;-)
I recoomend you testing this on 2.6.0-test2-latest. Using the latest
available kernel will probably help mantainers to nail down any problem.
Michael Buesch <[email protected]> writes:
|> On Wednesday 06 August 2003 14:32, lode leroy wrote:
|> > main()
|> > {
|> > int f = open("/dev/hda1", O_RDWR);
|> > char buffer[8192];
|> > for(i=0;1;i++) {
|> > printf("%d\r", i);
|> > write(f, buffer, sizeof(buffer);
|>
|> Shouldn't this be:
|> write(f, buffer, sizeof(buffer) / sizeof(buffer[0]));
sizeof(char) == 1, always and everywhere.
Andreas.
--
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 N?rnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Actually, you're right... i don't see this on 2.6.0-test2 .
I should have tried upgrading first!
>From: Felipe Alfaro Solana <[email protected]>
>To: lode leroy <[email protected]>
>CC: LKML <[email protected]>
>Subject: Re: 2.5.70 lockup while write()ing to /dev/hda1
>Date: Wed, 06 Aug 2003 15:05:06 +0200
>
>On Wed, 2003-08-06 at 14:32, lode leroy wrote:
> > I just want to report a problem I saw on linux 2.5.70:
> > (since I have a workaround, I do not intend to debug this further)
> >
> > the following program locks up the computer.
> > sometimes this has happened after about 16MB,
> > sometimes after about 64MB...
>
>Don't you think 2.5.70 is a little bit obsolete now? ;-)
>I recoomend you testing this on 2.6.0-test2-latest. Using the latest
>available kernel will probably help mantainers to nail down any problem.
>
_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail