Bug#603882: util-vserver: startup script breaks boot (on sparc)

2010-12-30 Thread Mehdi Dogguy
Ivan Jager aij+deb...@andrew.cmu.edu wrote:
 Ok, so I started looking at the internals of dietlibc, and I noticed
 the data returned by getdents64 looks as I would expect, but the
 struct dirent64 does not match it. Apparently the way these things
 are being compiled it ends up with sizeof(uint64_t) = 4, so the
 struct fields don't line up.
 

dietlibc seems to be fixed now. Could you please test again and tell
us if this issue if fixed as well?

Regards,

-- 
Mehdi Dogguy



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#603882: util-vserver: startup script breaks boot (on sparc)

2010-12-30 Thread Ivan Jager

On Thu, 30 Dec 2010, Mehdi Dogguy wrote:

dietlibc seems to be fixed now. Could you please test again and tell
us if this issue if fixed as well?


Yes, it is fixed in 0.30.216-pre2864-2+b2.

Thanks



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#603882: util-vserver: startup script breaks boot (on sparc)

2010-11-23 Thread Ivan Jager
Ok, so I started looking at the internals of dietlibc, and I noticed the 
data returned by getdents64 looks as I would expect, but the struct 
dirent64 does not match it. Apparently the way these things are being 
compiled it ends up with sizeof(uint64_t) = 4, so the struct fields don't 
line up.


I think I will be filing a bug against dietlibc in the morning. It seems 
compiling with diet gcc -g -D_FILE_OFFSET_BITS=64 causes readdir to 
break, at least on sparc.


Ivan(gdb) break getdents64
Breakpoint 2 at 0x116dc
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y

Starting program: /home/ivan/deb/util-vserver-0.30.216-pre2864/src/showattr
vc_get_iattr(): Function not implemented
ERR .

Breakpoint 2, 0x000116dc in getdents64 ()
(gdb) bt
#0  0x000116dc in getdents64 ()
#1  0x0001114c in readdir64 ()
#2  0x00010230 in Ereaddir (path=0x11730 .)
at ./ensc_wrappers/wrappers-dirent.hc:38
#3  iterateFilesystem (path=0x11730 .) at src/fstool.c:83
#4  0x000106b8 in processFile (path=0x11730 .) at src/fstool.c:162
#5  0x00010ae8 in main (argc=1, argv=value optimized out) at src/fstool.c:236
(gdb) disas
Dump of assembler code for function getdents64:
0x000116dc getdents64+0:  b  0x10e44 __unified_syscall
0x000116e0 getdents64+4:  mov  0x9a, %g1
End of assembler dump.
(gdb) fini
Run till exit from #0  0x000116dc in getdents64 ()
0x0001114c in readdir64 ()
(gdb) print o1
No symbol o1 in current context.
(gdb) print $o1
$1 = -134234112
(gdb) print/x $o1
$2 = 0xf7ffc000
(gdb) x/10 0xf7ffc000
0xf7ffc000: 0x  0xe105  0x  0x033036bc
0xf7ffc010: 0x00200876  0x6c696d69  0x742e6300  0x
0xf7ffc020: 0x  0xe0c6
(gdb) print (char*) 0xf7ffc013
$3 = 0xf7ffc013 vlimit.c
(gdb) bt
#0  0x0001114c in readdir64 ()
#1  0x00010230 in Ereaddir (path=0x11730 .)
at ./ensc_wrappers/wrappers-dirent.hc:38
#2  iterateFilesystem (path=0x11730 .) at src/fstool.c:83
#3  0x000106b8 in processFile (path=0x11730 .) at src/fstool.c:162
#4  0x00010ae8 in main (argc=1, argv=value optimized out) at src/fstool.c:236
(gdb) fini
Run till exit from #0  0x0001114c in readdir64 ()
Ereaddir (path=0x11730 .) at ./ensc_wrappers/wrappers-dirent.hc:40
40FatalErrnoError(res==0  errno!=0, readdir());
(gdb) print res
$4 = value optimized out
(gdb) print $o0
$5 = -134234112
(gdb) print $o1
$6 = 71472
(gdb) print/x $o0
$7 = 0xf7ffc000
(gdb) x/10 0xf7ffc000
0xf7ffc000: 0x  0xe105  0x  0x033036bc
0xf7ffc010: 0x00200876  0x6c696d69  0x742e6300  0x
0xf7ffc020: 0x  0xe0c6
(gdb) bt
#0  Ereaddir (path=0x11730 .) at ./ensc_wrappers/wrappers-dirent.hc:40
#1  iterateFilesystem (path=0x11730 .) at src/fstool.c:83
#2  0x000106b8 in processFile (path=0x11730 .) at src/fstool.c:162
#3  0x00010ae8 in main (argc=1, argv=value optimized out) at src/fstool.c:236
(gdb) fini
Run till exit from #0  Ereaddir (path=0x11730 .)
at ./ensc_wrappers/wrappers-dirent.hc:40
86  if (ent==0) break;
(gdb) print ent
$8 = (struct dirent64 *) 0xf7ffc000
(gdb) print *ent
$9 = {d_ino = 0, d_off = 57605, d_reclen = 0, d_type = 0 '\000',
  d_name = \000\003\060\066\274\000 \bvlimit.c, '\000' repeats 11 
times\340, \306\000\000\000\000\003\251~\030\000 \btunctl.c, '\000' repeats 
11 times\341, \b\000\000\000\000\003\254\336\340\000 \butil.h, '\000' 
repeats 13 times\347, \246\000\000\000\000\004\267\204L\000 
\bvreboot.o\000\000\000\000\000\000\000\000\000\000\340\366\000\000\000\000\004\363\344\245\000(\bmask2prefix.c,
 '\000' repeats 14 times\350, \001\000\000\000\000\006\211\325+\000 
\bexec-remount\000\000\000\000\000\000\000\340\356\000\000\000\000\a\242\023\065\000
 \bnattribute.c\000\000\000\000\000\000\000\347\351\000\000\000\000\b...}
(gdb) print ent-d_name
$10 = \000\003\060\066\274\000 \bvlimit.c, '\000' repeats 11 times\340, 
\306\000\000\000\000\003\251~\030\000 \btunctl.c, '\000' repeats 11 
times\341, \b\000\000\000\000\003\254\336\340\000 \butil.h, '\000' repeats 
13 times\347, \246\000\000\000\000\004\267\204L\000 
\bvreboot.o\000\000\000\000\000\000\000\000\000\000\340\366\000\000\000\000\004\363\344\245\000(\bmask2prefix.c,
 '\000' repeats 14 times\350, \001\000\000\000\000\006\211\325+\000 
\bexec-remount\000\000\000\000\000\000\000\340\356\000\000\000\000\a\242\023\065\000
 \bnattribute.c\000\000\000\000\000\000\000\347\351\000\000\000\000\b...
(gdb) print ent-d_name
$11 = (char (*)[256]) 0xf7ffc00b
(gdb) print ent-d_ino
$12 = (long unsigned int *) 0xf7ffc000
(gdb) print ent-d_off
$13 = (long int *) 0xf7ffc004
(gdb) print ent-d_reclen
$14 = (short unsigned int *) 0xf7ffc008
(gdb) print ent-d_type
$15 = (unsigned char *) 0xf7ffc00a 
(gdb) print sizeof(struct dirent64)
$16 = 268
(gdb) print sizeof(struct dirent)
No struct type named dirent.
(gdb) print sizeof(ent-d_ino)
$17 = 4
(gdb) print sizeof(uint64_t)
$18 = 4
(gdb)


Bug#603882: util-vserver: startup script breaks boot (on sparc)

2010-11-22 Thread Ivan Jager

On Thu, 18 Nov 2010, micah anderson wrote:


On Thu, 18 Nov 2010 04:13:20 +0100 (CET), Daniel Hokka Zakrisson 
dan...@hozac.com wrote:


What dietlibc version was used to build the binaries? Does it have
http://people.linux-vserver.org/~dhozac/p/m/delta-dietdirent-fix01.diff
applied? IIRC this was one way that problem exhibited itself.


Actually, I lied. The patch *is* applied. I was looking at the unpatched
source, but if I looked at the patched source before its built, it is in
fact there.


I just tried downgrading to dietlibc-dev 0.31-1.2 (from lenny), and if I 
build against that it does iterate over the files properly. So I suppose 
it does have something to do with dietlibc.


I get a bunch of vc_get_iattr(): Function not implemented errors, which 
may be expected for all I know, but it does seem to iterate over the files 
properly now. Here's a sniplet of output:

vc_get_iattr(): Function not implemented
ERR ./compile
vc_get_iattr(): Function not implemented
ERR ./config.log
vc_get_iattr(): Function not implemented
ERR ./distrib


Ivan



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#603882: util-vserver: startup script breaks boot (on sparc)

2010-11-18 Thread micah anderson
On Thu, 18 Nov 2010 04:13:20 +0100 (CET), Daniel Hokka Zakrisson 
dan...@hozac.com wrote:

 What dietlibc version was used to build the binaries? Does it have
 http://people.linux-vserver.org/~dhozac/p/m/delta-dietdirent-fix01.diff
 applied? IIRC this was one way that problem exhibited itself.

Looking at the build logs for sparc, it looks like 0.32-5 of dietlibc
was used. Looking at the debian source for that version of dietlibc, and
comparing it to the patch you reference, no it was not applied.

That patch is odd, all it does is move the int below the 

char buf[PAGE_SIZE-(sizeof (int)*3)];

what is going on there?

micah


pgprNjfUhafn1.pgp
Description: PGP signature


Bug#603882: util-vserver: startup script breaks boot (on sparc)

2010-11-18 Thread Daniel Hokka Zakrisson
micah anderson wrote:
 On Thu, 18 Nov 2010 04:13:20 +0100 (CET), Daniel Hokka Zakrisson 
 dan...@hozac.com wrote:

 What dietlibc version was used to build the binaries? Does it have
 http://people.linux-vserver.org/~dhozac/p/m/delta-dietdirent-fix01.diff
 applied? IIRC this was one way that problem exhibited itself.

 Looking at the build logs for sparc, it looks like 0.32-5 of dietlibc
 was used. Looking at the debian source for that version of dietlibc, and
 comparing it to the patch you reference, no it was not applied.

 That patch is odd, all it does is move the int below the

 char buf[PAGE_SIZE-(sizeof (int)*3)];

 what is going on there?

It's an alignment issue. The buffer needs to be 8-byte aligned,
and the int offsets the beginning of buf by 4 bytes.

 micah

-- 
Daniel Hokka Zakrisson



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#603882: util-vserver: startup script breaks boot (on sparc)

2010-11-18 Thread micah anderson
On Thu, 18 Nov 2010 04:13:20 +0100 (CET), Daniel Hokka Zakrisson 
dan...@hozac.com wrote:

 What dietlibc version was used to build the binaries? Does it have
 http://people.linux-vserver.org/~dhozac/p/m/delta-dietdirent-fix01.diff
 applied? IIRC this was one way that problem exhibited itself.

Actually, I lied. The patch *is* applied. I was looking at the unpatched
source, but if I looked at the patched source before its built, it is in
fact there.

micah


pgpvOHZXFJa4N.pgp
Description: PGP signature


Bug#603882: util-vserver: startup script breaks boot (on sparc)

2010-11-17 Thread Ivan Jager
Package: util-vserver
Version: 0.30.216-pre2864-2
Severity: critical
Justification: breaks the whole system


I'm trying to switch to vservers from openvz because openvz support (for 
sparc) got silently dropped in Lenny. After installing 
linux-image-2.6.32-5-vserver-sparc64, during boot I get an endless 
stream of lstat(): No such file or directory

Fortunately, I was able to ssh in and found /etc/init.d/util-vserver was 
running setattr. Running setattr with the same arguments also produces 
the endless stream of errors. strace shows that it is trying to stat  
a lot. I found I could reproduce the stream of errors as a normal user 
by running showattr without arguments instead. I guess it's something in 
the common code that is shared between the two.

I rebuild with debugging and got a backtrace:
#0  0x00010e88 in lstat ()
#1  0x000102c4 in iterateFilesystem (path=0x11730 .) at src/fstool.c:89
#2  0x000106b8 in processFile (path=0x11730 .) at src/fstool.c:162
#3  0x00010ae8 in main (argc=1, argv=value optimized out) at src/fstool.c:236

(gdb) frame 1
#1  0x000102c4 in iterateFilesystem (path=0x11730 .) at src/fstool.c:89
89  if (lstat(ent-d_name, st)==-1) {
(gdb) print ent
$1 = (struct dirent64 *) 0xf7ffc000
(gdb) print *ent
$2 = {d_ino = 0, d_off = 58613, d_reclen = 0, d_type = 0 '\000',
  d_name = \000\000\273\377R\000 \blibtool, '\000' repeats 11 times, 
\...@\024\000\000\000\000\001h\262g\000 
\bltmain.sh\000\000\000\000\000\000\000\000\000\000\342\372\000\000\000\000\003^`\211\000
 
\binstall-sh\000\000\000\000\000\000\000\000\000\341o\000\000\000\000\004\222C\314\000
 
\004lib_internal\000\000\000\000\000\000\000\342\373\000\000\000\000\005ô\365\000\030\004man\000\000\000\000\000\000\000\...@\032\000\000\000\000\amm\363\000
 \bMakefile.svn\000\000\000\000\000\000\000\344\300\000\000\000\000\a\323N%\000 
\bpathconfig.h\000\000\000\000\000\000\000\341\320\000\000\000\000\tho\216...}


Obviously ent is bogus. The things that look like filenames inside 
d_name are files in the working directory. (In this case 
util-vserver-0.30.216-pre2864)

I tried to reproduce the problem with a small program that just did 
opendir and readir with printf, but that worked fine, so I'm not sure 
where the problem lies exactly. My best current guess is that either 
something is overwriting the data from opendir before readdir gets 
called, or somehow an incompatible opendir and readdir are getting 
linked in. (Is that possible?)  I haven't looked at the internals of how 
opendir and readdir work yet, so I don't really know.

I tried installing util-vserver on a lenny machine, which installed 
version 0.30.216~r2772-6, but that version does not have this problem.  
I also tried transplaning the binary from 0.30.216-pre2864-2 to the 
lenny box, and then I do get the endless stream of errors.

So, to reproduce in a way that is easy to debug:
install util-vserver-0.30.216-pre2864-2 on a sparc system and run 
showattr.Make sure the startup script won't run or that you're not 
running a vserver kernel to avoid setattr being run at startup.

To reproduce in a way that will leave you without a login prompt: 
install util-vserver-0.30.216-pre2864-2 and boot a sparc system into a 
kernel with vserver support.

Sorry I didn't get around to testing vservers earlier. I was hoping 
openvz support might come back.

Thanks,
Ivan

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: sparc (sparc64)

Kernel: Linux 2.6.32-5-vserver-sparc64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages util-vserver depends on:
ii  debconf [debconf-2.0] 1.5.36 Debian configuration management sy
ii  iproute   20100519-3 networking and traffic control too
ii  libc6 2.11.2-7   Embedded GNU C Library: Shared lib
ii  libnss3-1d3.12.8-1   Network Security Service libraries
ii  make  3.81-8 An utility for Directing compilati
ii  net-tools 1.60-23+b1 The NET-3 networking toolkit
ii  util-linux2.17.2-3.3 Miscellaneous system utilities

Versions of packages util-vserver recommends:
ii  binutils  2.20.1-15  The GNU assembler, linker and bina
ii  debootstrap   1.0.25 Bootstrap a basic Debian system

Versions of packages util-vserver suggests:
ii  iptables  1.4.8-3administration tools for packet fi
ii  linux-image-2.6.32-5-sparc64- 2.6.32-27  Linux 2.6.32 for multiprocessor 64
ii  linux-image-2.6.32-5-vserver- 2.6.32-27  Linux 2.6.32 for uniprocessor 64-b
ii  module-init-tools 3.12-1 tools for managing Linux kernel mo
ii  procps1:3.2.8-9  /proc file system utilities
ii  vlan  1.9-3  user mode programs to enable VLANs
ii  wget 

Bug#603882: util-vserver: startup script breaks boot (on sparc)

2010-11-17 Thread Daniel Hokka Zakrisson
Ivan Jager wrote:
 Package: util-vserver
 Version: 0.30.216-pre2864-2
 Severity: critical
 Justification: breaks the whole system


 I'm trying to switch to vservers from openvz because openvz support (for
 sparc) got silently dropped in Lenny. After installing
 linux-image-2.6.32-5-vserver-sparc64, during boot I get an endless
 stream of lstat(): No such file or directory

 Fortunately, I was able to ssh in and found /etc/init.d/util-vserver was
 running setattr. Running setattr with the same arguments also produces
 the endless stream of errors. strace shows that it is trying to stat 
 a lot. I found I could reproduce the stream of errors as a normal user
 by running showattr without arguments instead. I guess it's something in
 the common code that is shared between the two.

 I rebuild with debugging and got a backtrace:
 #0  0x00010e88 in lstat ()
 #1  0x000102c4 in iterateFilesystem (path=0x11730 .) at src/fstool.c:89
 #2  0x000106b8 in processFile (path=0x11730 .) at src/fstool.c:162
 #3  0x00010ae8 in main (argc=1, argv=value optimized out) at 
 src/fstool.c:236

 (gdb) frame 1
 #1  0x000102c4 in iterateFilesystem (path=0x11730 .) at src/fstool.c:89
 89  if (lstat(ent-d_name, st)==-1) {
 (gdb) print ent
 $1 = (struct dirent64 *) 0xf7ffc000
 (gdb) print *ent
 $2 = {d_ino = 0, d_off = 58613, d_reclen = 0, d_type = 0 '\000',
   d_name = \000\000\273\377R\000 \blibtool, '\000' repeats 11 times,
 \...@\024\000\000\000\000\001h\262g\000
 \bltmain.sh\000\000\000\000\000\000\000\000\000\000\342\372\000\000\000\000\003^`\211\000
 \binstall-sh\000\000\000\000\000\000\000\000\000\341o\000\000\000\000\004\222C\314\000
 \004lib_internal\000\000\000\000\000\000\000\342\373\000\000\000\000\005ô\365\000\030\004man\000\000\000\000\000\000\000\...@\032\000\000\000\000\amm\363\000
 \bMakefile.svn\000\000\000\000\000\000\000\344\300\000\000\000\000\a\323N%\000
 \bpathconfig.h\000\000\000\000\000\000\000\341\320\000\000\000\000\tho\216...}


 Obviously ent is bogus. The things that look like filenames inside
 d_name are files in the working directory. (In this case
 util-vserver-0.30.216-pre2864)

 I tried to reproduce the problem with a small program that just did
 opendir and readir with printf, but that worked fine, so I'm not sure
 where the problem lies exactly. My best current guess is that either
 something is overwriting the data from opendir before readdir gets
 called, or somehow an incompatible opendir and readdir are getting
 linked in. (Is that possible?)  I haven't looked at the internals of how
 opendir and readdir work yet, so I don't really know.

 I tried installing util-vserver on a lenny machine, which installed
 version 0.30.216~r2772-6, but that version does not have this problem.
 I also tried transplaning the binary from 0.30.216-pre2864-2 to the
 lenny box, and then I do get the endless stream of errors.

 So, to reproduce in a way that is easy to debug:
 install util-vserver-0.30.216-pre2864-2 on a sparc system and run
 showattr.Make sure the startup script won't run or that you're not
 running a vserver kernel to avoid setattr being run at startup.

 To reproduce in a way that will leave you without a login prompt:
 install util-vserver-0.30.216-pre2864-2 and boot a sparc system into a
 kernel with vserver support.

 Sorry I didn't get around to testing vservers earlier. I was hoping
 openvz support might come back.

What dietlibc version was used to build the binaries? Does it have
http://people.linux-vserver.org/~dhozac/p/m/delta-dietdirent-fix01.diff
applied? IIRC this was one way that problem exhibited itself.

 Thanks,
 Ivan

 -- System Information:
 Debian Release: squeeze/sid
   APT prefers testing
   APT policy: (500, 'testing')
 Architecture: sparc (sparc64)

 Kernel: Linux 2.6.32-5-vserver-sparc64 (SMP w/1 CPU core)
 Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
 Shell: /bin/sh linked to /bin/dash

 Versions of packages util-vserver depends on:
 ii  debconf [debconf-2.0] 1.5.36 Debian configuration management 
 sy
 ii  iproute   20100519-3 networking and traffic control 
 too
 ii  libc6 2.11.2-7   Embedded GNU C Library: Shared 
 lib
 ii  libnss3-1d3.12.8-1   Network Security Service 
 libraries
 ii  make  3.81-8 An utility for Directing 
 compilati
 ii  net-tools 1.60-23+b1 The NET-3 networking toolkit
 ii  util-linux2.17.2-3.3 Miscellaneous system utilities

 Versions of packages util-vserver recommends:
 ii  binutils  2.20.1-15  The GNU assembler, linker and 
 bina
 ii  debootstrap   1.0.25 Bootstrap a basic Debian system

 Versions of packages util-vserver suggests:
 ii  iptables  1.4.8-3administration tools for packet 
 fi
 ii  linux-image-2.6.32-5-sparc64- 2.6.32-27  Linux 2.6.32 for multiprocessor 
 64
 ii  linux-image-2.6.32-5-vserver-