[ENBD] Re: ENBD Digest, Vol 34, Issue 4
Peter T. Breuer
ptb at inv.it.uc3m.es
Fri Jan 19 14:54:31 MST 2007
"Also sprach Lothar Brendel:"
> >(I have a 64 bit AMD machine). Here's the build as it goes
> >on amd64 (I typed "make" in the 2.4.33 src dir).
(kernel 2.6.15.5)
> >Are you sure you have configured and built your kernel? The kernel
> >.config file should start out like:
> >
> >
> 1st try was a configured only, out-of-the-box 2.6.8 (copied
I don't think that will work ... 2.6.8 is fundamentally different from
later kernels in some areas of memory management. But who knows, it may
... given luck I spotted when enough interfaces changed to have put
the right if KERNEL_VERSION > stuff in the code.
> /boot/config* as .config into /usr/src/kernel-source-*) and enbd 2.4.32.
>
> 2nd try (after your reply) was enbd 2.4.33 with a configured+built
> 2.6.8, same result as with 2.6.15 (cf. below). All builds were done with
Don't bother testing with anything except 2.6.15 as we know it works
with that (I am running 2.6.15.5 on a perfectly standard debian sarge
amd64 installation).
> gcc version 3.3.5 (Debian 1:3.3.5-13), all kernel sources are Debian ones.
It's too late night for me to want to go and see what my debian says
(I have to trudge into another room and boot a noisy machine ... maybe
I'll do it in a little while) and what the compiler says about itself
there, but I rather imagine it will be a gcc 4.1, no?
> 3rd try was enbd 2.4.33 with a configured+built 2.6.18, didn't compile
Don't try different things. Just one. We know it works against 2.6.15
because that's what I used.
> (they removed split-include from scripts/basic).
Possibly - I wouldn't know! 2.6.15.5 is the most recent kernel I have
looked at. If you can tell me what is needed under that source tree
I'll be glad to modify the kernel Makefile used.
> 4th try was enbd 2.4.33 with a configured+built 2.6.15, it compiled with
> lots of "warning: long long int format, s64 arg" (seems to affect only
No ... you shouldn't get any of those. You saw that my compile evoked
nothing of the sort. Are you maybe compiling with DEBUG set, or
something? Are you sure you are pointing at the right source directory?
Just copy one of the compile lines I showed in my log, and check you get
the same result.
> message output, though).
>
> Module insertion doesn't show anything unusual (I suppose, the version
> mismatch "Enhanced Network Block Device 2.4.30 $Date: 2002/09/17
> 16:33:22 $" in the log doesn't mean anything.).
Possibly. I forget where it comes from.
> Finally, upon "make test", the client suffers a SIGSEGV:
>
> /root/enbd-2.4.33/nbd/enbd-maketest: line 348: 4208 Segmentation
> fault nice -19 $ENBD_CLIENT $OPTCLI
That's not the informative part. You need to look at your syslogs
(kernel log for the oops).
> Which details would you need for further investigation?
The very first error message shown (there are no errors here).
OK, I'll go boot the machine. How does one tell which debian one has?
% uname -a
Linux xilofon.it.uc3m.es 2.6.15.5 #2 PREEMPT Tue Mar 14 19:31:17 CET 2006 x86_64 GNU/Linux
% gcc -v
Reading specs from /usr/lib/gcc-lib/x86_64-linux/3.3.5/specs
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f77,pascal,objc,ada,treelang
--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
--with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared
--enable-__cxa_atexit --with-system-zlib --enable-nls
--without-included-gettext --enable-clocale=gnu --enable-debug
--enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc
--disable-multilib x86_64-linux
Thread model: posix
gcc version 3.3.5 (Debian 1:3.3.5-13)
That looks exactly the same as yours.
In the enbd 2.4.33 source directory, a "make" starts off ..
xilofon:/usr/oboe/ptb/lang/c/nbd/enbd-2.4.33% make
mkdir -p /tmp
cp nbd/configure /tmp/configure && chmod +x /tmp/configure
make config
make[1]: Entering directory `/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33'
export
CONFIG_SITE=/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/conf/config.Linux;
\
cd /tmp; ./configure
--srcdir=/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd \
--with-kernel-srcdir=/usr; \
loading site script
/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/conf/config.Linux
creating cache ./config.cache
checking for gcc... gcc
checking whether the C compiler (gcc -D_LARGEFILE64_SOURCE=1
-D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1 -D_XOPEN_SOURCE=1
-D_FILE_OFFSET_BITS=64 -Wall -Winline -O2 -I/usr/include ) works... yes
checking whether the C compiler (gcc -D_LARGEFILE64_SOURCE=1
-D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1 -D_XOPEN_SOURCE=1
-D_FILE_OFFSET_BITS=64 -Wall -Winline -O2 -I/usr/include ) is a
cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking whether warnings should be enabled... yes
...
Then all the compiles of the daemons start with ...
make[1]: Leaving directory `/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33'
make -C /tmp VPATH=/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd \
CFLAGS="-D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1 -D_XOPEN_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Wall -Winline -O2 \
-I/tmp \
-I/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/kernel/linux-2.6.x/include \
-I/usr/include \
\
-DDEBUG=0" \
EXTRA_LIBS=" \
"
make[1]: Entering directory `/var/tmp'
gcc -DCONFDIR="\"/etc\"" -DPIDDIR="\"/var/run\"" -DSTATEDIR="\"/var/state/enbd\"" -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1 -D_XOPEN_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Wall -Winline -O2 -I/tmp -I/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/kernel/linux-2.6.x/include -I/usr/include -DDEBUG=0 -o enbd-server.o -c /var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/enbd-server.c
...
There are a few warnings in mmap_cache.c now I look ..
gcc -DCONFDIR="\"/etc\"" -DPIDDIR="\"/var/run\"" -DSTATEDIR="\"/var/state/enbd\"" -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1 -D_XOPEN_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Wall -Winline -O2 -I/tmp -I/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/kernel/linux-2.6.x/include -I/usr/include -DDEBUG=0 -o mmap_cache.o -c /var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/mmap_cache.c
/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/mmap_cache.c: In function `free_mmap_cache_entry':
/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/mmap_cache.c:51: warning: long long int format, s64 arg (arg 4)
/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/mmap_cache.c:51: warning: long long int format, s64 arg (arg 5)
/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/mmap_cache.c:51: warning: long long int format, s64 arg (arg 4)
/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/mmap_cache.c:51: warning: long long int format, s64 arg (arg 5)
/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/mmap_cache.c: In function `add_mmap_cache_entry':
/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/mmap_cache.c:163: warning: long long int format, s64 arg (arg 4)
/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/mmap_cache.c:163: warning: long long int format, s64 arg (arg 5)
/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/mmap_cache.c:163: warning: long long int format, s64 arg (arg 4)
/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/mmap_cache.c:163: warning: long long int format, s64 arg (arg 5)
/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/mmap_cache.c:183: warning: long long int format, s64 arg (arg 3)
/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/mmap_cache.c:183: warning: long long int format, s64 arg (arg 4)
/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/mmap_cache.c:183: warning: long long int format, s64 arg (arg 5)
/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/mmap_cache.c:183: warning: long long int format, s64 arg (arg 6)
/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/mmap_cache.c:183: warning: long long int format, s64 arg (arg 3)
/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/mmap_cache.c:183: warning: long long int format, s64 arg (arg 4)
/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/mmap_cache.c:183: warning: long long int format, s64 arg (arg 5)
/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/mmap_cache.c:183: warning: long long int format, s64 arg (arg 6)
/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/mmap_cache.c:243: warning: long long int format, s64 arg (arg 4)
/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/mmap_cache.c:243: warning: long long int format, s64 arg (arg 5)
/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/mmap_cache.c:243: warning: long long int format, s64 arg (arg 4)
/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/nbd/mmap_cache.c:243: warning: long long int format, s64 arg (arg 5)
I'll fix those.
By the time we get to the kernel source, it is saying ...
make[1]: Entering directory `/usr/local/src/linux-2.6.15.5'
*** Warning: Overriding SUBDIRS on the command line can cause
*** inconsistencies
mkdir -p /tmp/linux-2.6.x/.tmp_versions
make -f /usr/local/src/linux-2.6.15.5/scripts/Makefile.build obj=/tmp/linux-2.6.x/drivers/block/enbd
gcc -I/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/kernel/linux-2.6.x/include -Wp,-MD,/tmp/linux-2.6.x/drivers/block/enbd/.enbd_base.o.d -nostdinc -iwithprefix include -D__KERNEL__ -Iinclude -D__KERNEL__ -Iinclude -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -mno-red-zone -mcmodel=kernel -pipe -fno-reorder-blocks -Wno-sign-compare -fno-asynchronous-unwind-tables -O2 -fomit-frame-pointer -DMODULE -I"/var/home/oboe/ptb/lang/c/nbd/enbd-2.4.33/kernel/linux-2.6.x/include" -DKBUILD_BASENAME=enbd_base -DKBUILD_MODNAME=enbd -c -o /tmp/linux-2.6.x/drivers/block/enbd/enbd_base.o /tmp/linux-2.6.x/drivers/block/enbd/enbd_base.c
Check your paths against that.
Now let's have a look at mmap_cache.c ... line 163 is
MSG ("1 adding separated mmap cache entry %d: %Ldk-%Ldk\n",
mmap_cache_entry_count,
mce->from >> 10, (mce->from + mce->len) >> 10);
return 0;
and if it really wants me to cast those to long long, I guess I will!
MSG ("1 adding separated mmap cache entry %d: %Ldk-%Ldk\n",
mmap_cache_entry_count,
(long long)mce->from >> 10,
(long long)(mce->from + mce->len) >> 10);
return 0;
Lines 183 and 243 are just the same sort of thing. Fix the same way.
Oh, line 51 too. That's it. Now all smooth.
So show me the first error, and the compile line that goes with it, and
maybe the line that it refers to in the code.
(BTW I fly to the UK tomorrow for a week .. comms may be spotty).
Peter
More information about the ENBD
mailing list