vi: odd behaviour when editing files (was: vi segfaults (bb 1.8.2))

2007-12-15 Thread Cristian Ionescu-Idbohrn
This is bb from svn HEAD. On Sat, 8 Dec 2007, Denys Vlasenko wrote: > It's simpler than that. Programs should not make assumptions that > BUFSIZ is bigger than some fixed number. (Well, probably you can > be sure that it is bigger than, say, 63 :) ). I configured bb with very small buffers: C

Re: [solved?] Re: vi segfaults (bb 1.8.2)

2007-12-10 Thread Cristian Ionescu-Idbohrn
On Sat, 8 Dec 2007, Denys Vlasenko wrote: > _Excellent_ analysis! Thanks :) > You nailed it down. Right. > It's simpler than that. Programs should not make assumptions that > BUFSIZ is bigger than some fixed number. (Well, probably you can > be sure that it is bigger than, say, 63 :) ). > > Ou

Re: [solved?] Re: vi segfaults (bb 1.8.2)

2007-12-08 Thread Denys Vlasenko
Hi Christian, _Excellent_ analysis! On Wednesday 05 December 2007 07:24, Cristian Ionescu-Idbohrn wrote: > It seems to be caused by the poor correlation control between BUFSIZ, > COMMON_BUFSIZE and MAX_LINELEN and somewhat poor choice of macro > names. In this case: > > , [ include/libbb.h ]

Re: [solved?] Re: vi segfaults (bb 1.8.2)

2007-12-05 Thread Cristian Ionescu-Idbohrn
On Wed, 5 Dec 2007, walter harms wrote: > BUFSIZ is used in stdio.h Yes. > #ifndef BUFSIZ > # define BUFSIZ _IO_BUFSIZ > #endif > > so the proper is to use ulibc size and calculate everything > depending on that value. This is obviously not done. Right. > the easy way is to s/BUFSIZ/BBBUFSIZ/g

Re: [solved?] Re: vi segfaults (bb 1.8.2)

2007-12-05 Thread walter harms
hi Cristian, BUFSIZ is used in stdio.h #ifndef BUFSIZ # define BUFSIZ _IO_BUFSIZ #endif so the proper is to use ulibc size and calculate everything depending on that value. This is obviously not done. the easy way is to s/BUFSIZ/BBBUFSIZ/g and thats it. ntl: nice work re, wh Cristian Ione

[solved?] Re: vi segfaults (bb 1.8.2)

2007-12-05 Thread Cristian Ionescu-Idbohrn
I think I found the problem. It seems to be caused by the poor correlation control between BUFSIZ, COMMON_BUFSIZE and MAX_LINELEN and somewhat poor choice of macro names. In this case: , [ include/libbb.h ] | 1101: #ifndef BUFSIZ | 1102: #define BUFSIZ 4096 | 1103: #endif ` BUFSIZ is pre

Re: vi segfaults (bb 1.8.2)

2007-11-30 Thread Cristian Ionescu-Idbohrn
On Tue, 27 Nov 2007, Cristian Ionescu-Idbohrn wrote: > On Tue, 27 Nov 2007, Cristian Ionescu-Idbohrn wrote: > > > On Tue, 27 Nov 2007, Denys Vlasenko wrote: > > > > > Failed to reproduce it here. > > > > Ok. I'll dig deeper. Made some new discoveries. This is the latest result (see attachment):

Re: vi segfaults (bb 1.8.2)

2007-11-27 Thread Loïc Grenié
2007/11/27, Cristian Ionescu-Idbohrn <[EMAIL PROTECTED]>: > On Tue, 27 Nov 2007, Cristian Ionescu-Idbohrn wrote: > > > On Tue, 27 Nov 2007, Denys Vlasenko wrote: > > > > > Failed to reproduce it here. > > > > Ok. I'll dig deeper. > > Looks like its some sort of artifact of these 2 conf options. >

Re: vi segfaults (bb 1.8.2)

2007-11-27 Thread Cristian Ionescu-Idbohrn
On Tue, 27 Nov 2007, Alexander Griesser wrote: > Sorry, no "luck" here in trying to reproduce this. Thanks anyway. Cheers, -- Cristian ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox

Re: vi segfaults (bb 1.8.2)

2007-11-27 Thread Cristian Ionescu-Idbohrn
On Tue, 27 Nov 2007, Cristian Ionescu-Idbohrn wrote: > On Tue, 27 Nov 2007, Denys Vlasenko wrote: > > > Failed to reproduce it here. > > Ok. I'll dig deeper. Looks like its some sort of artifact of these 2 conf options. CONFIG_FEATURE_VI_MAX_LEN=2048 CONFIG_FEATURE_VI_DOT_CMD=y does not segfau

Re: vi segfaults (bb 1.8.2)

2007-11-27 Thread Cristian Ionescu-Idbohrn
On Tue, 27 Nov 2007, Denys Vlasenko wrote: > Failed to reproduce it here. Ok. I'll dig deeper. > Please send exact .config. I'll do that too if I fail to find the problem. > Which versions of gcc cris-axis-elf-gcc (GCC) 3.2.1 Axis release R64/1.64 ld GNU ld version 2.12.1 > Which libc (gl

Re: vi segfaults (bb 1.8.2)

2007-11-27 Thread Denys Vlasenko
On Monday 26 November 2007 07:24, Cristian Ionescu-Idbohrn wrote: > With this configuration, vi works fine: > > CONFIG_VI=y > CONFIG_FEATURE_VI_MAX_LEN=1024 > CONFIG_FEATURE_VI_COLON=y > CONFIG_FEATURE_VI_YANKMARK=y > CONFIG_FEATURE_VI_SEARCH=y > CONFIG_FEATURE_VI_USE_SIGNALS=y > CONFIG_FEATURE_VI_

Re: vi segfaults (bb 1.8.2)

2007-11-26 Thread Alexander Griesser
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Cristian Ionescu-Idbohrn wrote: > If I change: > > CONFIG_FEATURE_VI_MAX_LEN=2048 > > I get a segfault when I start editing a new file, after I push the 'i' > key. I can't confirm this. On my system it doesn't matter to what reasonable size I set th

vi segfaults (bb 1.8.2)

2007-11-26 Thread Cristian Ionescu-Idbohrn
With this configuration, vi works fine: CONFIG_VI=y CONFIG_FEATURE_VI_MAX_LEN=1024 CONFIG_FEATURE_VI_COLON=y CONFIG_FEATURE_VI_YANKMARK=y CONFIG_FEATURE_VI_SEARCH=y CONFIG_FEATURE_VI_USE_SIGNALS=y CONFIG_FEATURE_VI_DOT_CMD=y # CONFIG_FEATURE_VI_READONLY is not set # CONFIG_FEATURE_VI_SETOPTS is no