Robert Elz wrote: > Date: Tue, 8 May 2018 19:15:28 +0100 > From: Alexander Nasonov <al...@yandex.ru> > Message-ID: <20180508180815.GA5990@neva> > > | I think it broke the tool. If you run > | > | cgdconfig -p > | > | it will crash. > > Sorry, I cannot reproduce this, it looks to work OK to me. > > Can you tell me exactly what command you gave and what > "it will crash" means (core dump? other failure? ??)
(gdb) b opendisk1 (gdb) run -p Starting program: /home/alnsn/netbsd-current/clean/src/sbin/cgdconfig/obj/cgdconfig -p Breakpoint 1, 0x00007f7ff78111f6 in opendisk1 () from /lib/libutil.so.7 (gdb) x/s $rdi 0x0: <error: Cannot access memory at address 0x0> # path=NULL (gdb) c Program received signal SIGSEGV, Segmentation fault. 0x00007f7ff7116880 in strchr () from /lib/libc.so.12 (gdb) bt #0 0x00007f7ff7116880 in strchr () from /lib/libc.so.12 #1 0x00007f7ff78110a8 in ?? () from /lib/libutil.so.7 #2 0x0000000000202bc3 in configure () #3 0x00000000002074d8 in main () (gdb) disassemble Dump of assembler code for function strchr: 0x00007f7ff7116860 <+0>: movabs $0x101010101010101,%r8 0x00007f7ff711686a <+10>: movzbq %sil,%rdx 0x00007f7ff711686e <+14>: imul $0x80,%r8,%r9 0x00007f7ff7116875 <+21>: imul %r8,%rdx 0x00007f7ff7116879 <+25>: test $0x7,%dil 0x00007f7ff711687d <+29>: jne 0x7f7ff71168d5 <strchr+117> 0x00007f7ff711687f <+31>: nop => 0x00007f7ff7116880 <+32>: mov (%rdi),%rax (gdb) x $rdi 0x0: Cannot access memory at address 0x0 # presumably the path argument If I comment out the if block with opendisk1 inside: (gdb) run -p Starting program: /home/alnsn/netbsd-current/clean/src/sbin/cgdconfig/obj/cgdconfig -p cgdconfig: wrong number of args usage: cgdconfig [-nv] [-V vmeth] cgd dev [paramsfile] cgdconfig -C [-nv] [-f configfile] cgdconfig -G [-nv] [-i ivmeth] [-k kgmeth] [-o outfile] paramsfile cgdconfig -g [-nv] [-i ivmeth] [-k kgmeth] [-o outfile] alg [keylen] cgdconfig -l cgdconfig -s [-nv] [-i ivmeth] cgd dev alg [keylen] cgdconfig -U [-nv] [-f configfile] cgdconfig -u [-nv] cgd [Inferior 1 (process 26827) exited with code 01] -- Alex