[ENBD] Re: enbd + x86_64

Peter T. Breuer ptb at inv.it.uc3m.es
Tue Jan 23 12:20:42 MST 2007


"Also sprach Lothar Brendel:"
> >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.
> >
> First I have to understand the whole story when it's working. Then I can 
> try it on a more recent kernel.

You don't need understanding .. just eyes to look for where it has gone
to :). Or/and run a kernel make with V=1, so we can see what goes down
where, and send me a sample of the log that shows the important bit
(not that I can tell what IS an imporatnt bit without seeing a log, of
course :).

> >No ... you shouldn't get any of those. You saw that my compile evoked
> >nothing of the sort.
> >
> Yes, but your listing started with making enbd_base.o. The major part of 

Sorry - when you said "enbd" I assumed you meant the kernel driver. The
rest is just userspace stuff that shouldn't present any problem
debugging.  Just run the relevant daemon under gdb after having compiled
with CFLAGS=-g set and tell me where it says it cores out.

Ho hum .. I suppose one might have to run a tiny script to stop the
daemon forking, or else attach gdb to the running and forked process in
a hurry via its process number. I'll tackle that, don't worry.

> >Are you maybe compiling with DEBUG set, or
> >something? Are you sure you are pointing at the right source directory?
> No and yes, respectively.

OK - telling me that a daemon is dying anyway makes it just a normal
bughunt with no normal difficulty. But it will have to wait until I get
back home on sunday.

> There are only two differences (apart from different source- and 
> tmp-paths, of course):
> 
> i) The names of my object files all start with ".tmp_" (e.g. 
> "linux-2.6.x/drivers/block/enbd/.tmp_enbd_base.o" instead of your 
> "linux-2.6.x/drivers/block/enbd/enbd_base.o").

:-). Kinda weird. I suppose the kernel makefile might be doing that.
Otherwise I don't know what is.

> ii) My modpost runs with option "-m" since I chose module versioning 
> support when building the kernel.

That's OK. I suppose.

> >Possibly. I forget where it comes from.
> >  
> >
> kernel/linux-2.6.x/include/linux/enbd.h, line 52. Looks like 
> discontinued version control.

Thanks.

> >>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

Run it under gdb ... I might have to supply a flag to prevent it
backgrounding.

> kern.log says (no oops):

OK, sorry.

> 
> ...
> Jan 22 17:07:21 localhost kernel: ENBD #5600[0]: enbd_init registered 
> device at major 43
> Jan 22 17:08:06 localhost enbd-server[4199]: server (-2) sighandler 
> propagates signal 15
> Jan 22 17:08:06 localhost enbd-server[4199]: server (-2) sighandler 
> terminates safely on signal 15
> Jan 22 17:08:11 localhost enbd-server[7560]: server: will open resources 
> in mode linear
> Jan 22 17:08:11 localhost enbd-server[7560]: looking for size of fd 4 
> with seek SEEK_END...
> Jan 22 17:08:11 localhost enbd-server[7560]: set size of fd 4 to 4194304
> Jan 22 17:08:11 localhost enbd-server[7560]: looking for size of fd 5 
> with seek SEEK_END...
> Jan 22 17:08:11 localhost enbd-server[7560]: set size of fd 5 to 4194304
> Jan 22 17:08:11 localhost enbd-server[7560]: size of exported 
> file/device is 8388608B (8192 blocks)
> Jan 22 17:08:11 localhost enbd-server[7561]: server (-2) set new signal 
> handlers
> Jan 22 17:08:16 localhost enbd-client[7570]: enbd-client: client 
> channels is 4
> Jan 22 17:08:16 localhost enbd-client[7570]: enbd-client: client says 
> blksize is 1024
> Jan 22 17:08:16 localhost enbd-client[7570]: enbd-client: client 
> identifier is NBDabcdefNBD
> Jan 22 17:08:16 localhost enbd-client[7570]: enbd-client: client 
> negotiation timeout is 120
> Jan 22 17:08:16 localhost enbd-client[7570]: enbd-client: client pulse 
> intvl is 5

And then it dies ... just early on in handshake. Should be easy.

> Jan 22 17:08:16 localhost kernel: enbd-client[7570]: segfault at 
> 0000000000000000 rip 00002aaaaacfc05c rsp 00007fffffc63ae0 error 4

Ok.

> Jan 22 17:08:26 localhost kernel: ENBD #2442[1]: do_enbd_request device 
> not enabled.
> Jan 22 17:08:26 localhost kernel: printk: 999 messages suppressed.
> ...
> 

> >The very first error message shown (there are no errors here).
> >  
> >
> I hope, the above is more helpful.

It is. Thanks.

> >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.
> >  
> >
> I changed also %d to %zd in PERR in netserver.c:366 and netserver.c:372 
> and in printf("BAD...) in enbd-test.c:1245. In x86_64 world, the sizeof 
> operator's results are no longer of type 'int' but 'unsigned long' :-(

Better to cast to int. Can't depend on being on x86 OR on having gcc as
a compiler.


> No hurry, I highly appreciate your support in any case.

Be with you soon as I can.

Peter


More information about the ENBD mailing list