Size difference reported by /proc/partitions and lseek(SEEK_END) on block device

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Size difference reported by /proc/partitions and lseek(SEEK_END) on block device

Loh, Joe
Hello folks,
We have created the following test case to illustrate the behavior that
we observed.  Hopefully someone out there can shed some light into the
subject matter.    This behavior is observed running "CYGWIN_NT-5.2
P3PANDA 1.5.18(0.132/4/2) 2005-07-02 20:30 i686 unknown unknown Cygwin".

The block device size is different between the values reported in
/proc/partitions and lseek(SEEK_END).  We have included a small 'C'
program that simply uses lseek to size the block device.  Is this
expected of?  If so, what accounts for the descrepancy?  We have another
system with a 40G drives that doesn't show such discrepancy.  We are
able to address the LBA beyond the range reported in /proc/partitions
using 'dd'.  So, it's definitely addressable, but we ran into yet a
different issue as we approach the end of the block device using 'dd'.
We have open a different thread to address the 'dd' isssue under "Error
reported dd'ing close of end of block device with skip"

Here's the 'C' program listing:

#define _FILE_OFFSET_BITS 64

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>

int main (int argc, char* const argv[])
{
  int vFd;
  off_t vSz;
  if (argv[1] == NULL) {
    printf("SYNTAX: %s <DEVICE>\n",argv[0]);
    exit(1);
  }

  vFd = open(argv[1],O_RDONLY);
  if (vFd < 0) {
    perror("open");
    exit(1);
  }
  vSz = lseek(vFd, (off_t)0, SEEK_END);
  if (vSz < 0) {
    perror("lseek");
    exit(1);
  }
  close(vFd);
  printf("%s size: %llu bytes (%llu of 1024-bytes
blocks)\n",argv[1],vSz,(vSz/1024));
  exit(0);
}

Comparing the results from the lseek sizing with the /proc/partitions.
We got the following results:

$ cat /proc/partitions
major minor  #blocks  name

    8     0  78124095 sda
    8     1  15358108 sda1
    8     2    104422 sda2
    8     3  16386300 sda3

Results from lseek(SEEK_END):

/dev/sda size: 80000000000 bytes (78125000 of 1024-bytes blocks)

Here's the output from strace:

**********************************************
Program name: C:\cygwin\home\Administrator\lseekend.exe (pid 376, ppid
1)
App version:  1005.18, api: 0.132
DLL version:  1005.18, api: 0.132
DLL build:    2005-07-02 20:30
OS version:   Windows NT-5.2
Heap size:    402653184
Date/Time:    2005-12-06 13:41:02
**********************************************
   63     451 [main] lseekend 376 set_myself: myself->dwProcessId 376
   72     523 [main] lseekend 376 time: 1133898062 = time (0)
  795    1318 [main] lseekend 376 environ_init: 0x420238:
!C:=C:\cygwin\bin
  153    1471 [main] lseekend 376 environ_init: 0x420250:
ALLUSERSPROFILE=C:\Documents and Settings\All Users
   98    1569 [main] lseekend 376 environ_init: 0x420288:
APPDATA=C:\Documents and Settings\Administrator\Application Data
   95    1664 [main] lseekend 376 environ_init: 0x4202D0:
CLIENTNAME=ASTOR
   91    1755 [main] lseekend 376 environ_init: 0x4202E8:
CLUSTERLOG=C:\WINDOWS\Cluster\cluster.log
   92    1847 [main] lseekend 376 environ_init: 0x420318:
COLORFGBG=0;default;15
   95    1942 [main] lseekend 376 environ_init: 0x420338:
COLORTERM=rxvt-xpm
   93    2035 [main] lseekend 376 environ_init: 0x420350:
COMMONPROGRAMFILES=C:\Program Files\Common Files
   94    2129 [main] lseekend 376 environ_init: 0x420388:
COMPUTERNAME=P3PANDA
   94    2223 [main] lseekend 376 environ_init: 0x4203A8:
COMSPEC=C:\WINDOWS\system32\cmd.exe
   94    2317 [main] lseekend 376 environ_init: 0x4203D0:
CVS_RSH=/bin/ssh
   95    2412 [main] lseekend 376 set_file_api_mode: File APIs set to
OEM
   62    2474 [main] lseekend 376 parse_options: codepage (called func)
   94    2568 [main] lseekend 376 parse_options: tty 1001
   93    2661 [main] lseekend 376 parse_options: binmode 65536
   95    2756 [main] lseekend 376 parse_options: title 1
   91    2847 [main] lseekend 376 parse_options: returning
   48    2895 [main] lseekend 376 environ_init: 0x4203E8:
CYGWIN=codepage:oem tty binmode title
   95    2990 [main] lseekend 376 environ_init: 0x420460: DISPLAY=:0
   92    3082 [main] lseekend 376 environ_init: 0x420470: EDITOR=vi
   96    3178 [main] lseekend 376 environ_init: 0x420480:
FP_NO_HOST_CHECK=NO
  100    3278 [main] lseekend 376 getwinenv: can't set native for HOME=
since no environ yet
  104    3382 [main] lseekend 376 mount_info::conv_to_posix_path:
conv_to_posix_path (C:\cygwin\home\Administrator, no-keep-rel,
no-add-slash)
   59    3441 [main] lseekend 376 normalize_win32_path:
C:\cygwin\home\Administrator = normalize_win32_path
(C:\cygwin\home\Administrator)
   61    3502 [main] lseekend 376 mount_info::conv_to_posix_path:
/home/Administrator = conv_to_posix_path (C:\cygwin\home\Administrator)
  143    3645 [main] lseekend 376 win_env::add_cache: posix
/home/Administrator
   47    3692 [main] lseekend 376 win_env::add_cache: native
HOME=C:\cygwin\home\Administrator
   49    3741 [main] lseekend 376 posify: env var converted to
HOME=/home/Administrator
   97    3838 [main] lseekend 376 environ_init: 0x4204C0:
HOME=/home/Administrator
   94    3932 [main] lseekend 376 environ_init: 0x420498: HOMEDRIVE=C:
   94    4026 [main] lseekend 376 environ_init: 0x420610:
HOMEPATH=\Documents and Settings\Administrator
   93    4119 [main] lseekend 376 environ_init: 0x420648:
HOSTNAME=P3PANDA
   97    4216 [main] lseekend 376 environ_init: 0x420660:
INFOPATH=/usr/local/info:/usr/share/info:/usr/info:
   91    4307 [main] lseekend 376 environ_init: 0x420698:
LOGONSERVER=\\P3PANDA
  104    4411 [main] lseekend 376 environ_init: 0x4206B8: MAKE_MODE=unix
  100    4511 [main] lseekend 376 environ_init: 0x4206D0:
MANPATH=/usr/local/man:/usr/share/man:/usr/man::/usr/ssl/man
  156    4667 [main] lseekend 376 environ_init: 0x420718:
NUMBER_OF_PROCESSORS=2
   80    4747 [main] lseekend 376 environ_init: 0x420738: OLDPWD=/proc
   77    4824 [main] lseekend 376 environ_init: 0x420750: OS=Windows_NT
   79    4903 [main] lseekend 376 getwinenv: can't set native for PATH=
since no environ yet
   55    4958 [main] lseekend 376 normalize_posix_path: src .
  134    5092 [main] lseekend 376 mount_info::conv_to_posix_path:
conv_to_posix_path (C:\cygwin\home\Administrator, no-keep-rel,
no-add-slash)
   45    5137 [main] lseekend 376 normalize_win32_path:
C:\cygwin\home\Administrator = normalize_win32_path
(C:\cygwin\home\Administrator)
   44    5181 [main] lseekend 376 mount_info::conv_to_posix_path:
/home/Administrator = conv_to_posix_path (C:\cygwin\home\Administrator)
   43    5224 [main] lseekend 376 cwdstuff::get: posix
/home/Administrator
   41    5265 [main] lseekend 376 cwdstuff::get: (/home/Administrator) =
cwdstuff::get (0x22EBC0, 260, 1, 0), errno 0
   65    5330 [main] lseekend 376 normalize_posix_path:
/home/Administrator/ = normalize_posix_path (.)
   54    5384 [main] lseekend 376 mount_info::conv_to_win32_path:
conv_to_win32_path (/home/Administrator)
   50    5434 [main] lseekend 376 set_flags: flags: binary (0x2)
   42    5476 [main] lseekend 376 mount_info::conv_to_win32_path:
src_path /home/Administrator, dst C:\cygwin\home\Administrator, flags
0xA, rc 0
  104    5580 [main] lseekend 376 symlink_info::check: not a symlink
   43    5623 [main] lseekend 376 symlink_info::check: 0 = symlink.check
(C:\cygwin\home\Administrator, 0x22E880) (0xA)
  885    6508 [main] lseekend 376 set_privilege: 1 = set_privilege
((token 70C) SeChangeNotifyPrivilege, 1)
  184    6692 [main] lseekend 376 path_conv::check:
this->path(C:\cygwin\home\Administrator), has_acls(1)
   91    6783 [main] lseekend 376 mount_info::conv_to_posix_path:
conv_to_posix_path (C:\cygwin\usr\local\bin, keep-rel, no-add-slash)
   42    6825 [main] lseekend 376 normalize_win32_path:
C:\cygwin\usr\local\bin = normalize_win32_path (C:\cygwin\usr\local\bin)
   44    6869 [main] lseekend 376 mount_info::conv_to_posix_path:
/usr/local/bin = conv_to_posix_path (C:\cygwin\usr\local\bin)
   42    6911 [main] lseekend 376 mount_info::conv_to_posix_path:
conv_to_posix_path (C:\cygwin\bin, keep-rel, no-add-slash)
   42    6953 [main] lseekend 376 normalize_win32_path: C:\cygwin\bin =
normalize_win32_path (C:\cygwin\bin)
   41    6994 [main] lseekend 376 mount_info::conv_to_posix_path:
/usr/bin = conv_to_posix_path (C:\cygwin\bin)
   41    7035 [main] lseekend 376 mount_info::conv_to_posix_path:
conv_to_posix_path (C:\cygwin\bin, keep-rel, no-add-slash)
   42    7077 [main] lseekend 376 normalize_win32_path: C:\cygwin\bin =
normalize_win32_path (C:\cygwin\bin)
   41    7118 [main] lseekend 376 mount_info::conv_to_posix_path:
/usr/bin = conv_to_posix_path (C:\cygwin\bin)
   41    7159 [main] lseekend 376 mount_info::conv_to_posix_path:
conv_to_posix_path (C:\cygwin\usr\X11R6\bin, keep-rel, no-add-slash)
   42    7201 [main] lseekend 376 normalize_win32_path:
C:\cygwin\usr\X11R6\bin = normalize_win32_path (C:\cygwin\usr\X11R6\bin)
   47    7248 [main] lseekend 376 mount_info::conv_to_posix_path:
/usr/X11R6/bin = conv_to_posix_path (C:\cygwin\usr\X11R6\bin)
   42    7290 [main] lseekend 376 mount_info::conv_to_posix_path:
conv_to_posix_path (c:\WINDOWS\system32, keep-rel, no-add-slash)
   41    7331 [main] lseekend 376 normalize_win32_path:
c:\WINDOWS\system32 = normalize_win32_path (c:\WINDOWS\system32)
   42    7373 [main] lseekend 376 mount_info::conv_to_posix_path:
/cygdrive/c/WINDOWS/system32 = conv_to_posix_path (c:\WINDOWS\system32)
   42    7415 [main] lseekend 376 mount_info::conv_to_posix_path:
conv_to_posix_path (c:\WINDOWS, keep-rel, no-add-slash)
   41    7456 [main] lseekend 376 normalize_win32_path: c:\WINDOWS =
normalize_win32_path (c:\WINDOWS)
   41    7497 [main] lseekend 376 mount_info::conv_to_posix_path:
/cygdrive/c/WINDOWS = conv_to_posix_path (c:\WINDOWS)
   42    7539 [main] lseekend 376 mount_info::conv_to_posix_path:
conv_to_posix_path (c:\WINDOWS\System32\Wbem, keep-rel, no-add-slash)
   41    7580 [main] lseekend 376 normalize_win32_path:
c:\WINDOWS\System32\Wbem = normalize_win32_path
(c:\WINDOWS\System32\Wbem)
   42    7622 [main] lseekend 376 mount_info::conv_to_posix_path:
/cygdrive/c/WINDOWS/System32/Wbem = conv_to_posix_path
(c:\WINDOWS\System32\Wbem)
   51    7673 [main] lseekend 376 mount_info::conv_to_posix_path:
conv_to_posix_path ("C, keep-rel, no-add-slash)
   41    7714 [main] lseekend 376 mount_info::conv_to_posix_path: "C =
conv_to_posix_path ("C)
   41    7755 [main] lseekend 376 mount_info::conv_to_posix_path:
conv_to_posix_path (C:\cygwin\Program Files\Symantec\Norton Ghost
2003\", keep-rel, no-add-slash)
   42    7797 [main] lseekend 376 normalize_win32_path:
C:\cygwin\Program Files\Symantec\Norton Ghost 2003\" =
normalize_win32_path (C:\cygwin\Program Files\Symantec\Norton Ghost
2003\")
   43    7840 [main] lseekend 376 mount_info::conv_to_posix_path:
/Program Files/Symantec/Norton Ghost 2003/" = conv_to_posix_path
(C:\cygwin\Program Files\Symantec\Norton Ghost 2003\")
   42    7882 [main] lseekend 376 mount_info::conv_to_posix_path:
conv_to_posix_path (C:\cygwin\lib\lapack, keep-rel, no-add-slash)
   42    7924 [main] lseekend 376 normalize_win32_path:
C:\cygwin\lib\lapack = normalize_win32_path (C:\cygwin\lib\lapack)
   41    7965 [main] lseekend 376 mount_info::conv_to_posix_path:
/usr/lib/lapack = conv_to_posix_path (C:\cygwin\lib\lapack)
  133    8098 [main] lseekend 376 win_env::add_cache: posix
/usr/local/bin:/usr/bin:/usr/bin:/usr/X11R6/bin:/cygdrive/c/WINDOWS/syst
em32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:"C:/Program
Files/Symantec/Norton Ghost 2003/":/usr/lib/lapack
   44    8142 [main] lseekend 376 win_env::add_cache: native
PATH=C:\cygwin\usr\local\bin;C:\cygwin\bin;C:\cygwin\bin;C:\cygwin\usr\X
11R6\bin;c:\WINDOWS\system32;c:\WINDOWS;c:\WINDOWS\System32\Wbem;"C;C:\c
ygwin\Program Files\Symantec\Norton Ghost 2003\";C:\cygwin\lib\lapack
   44    8186 [main] lseekend 376 posify: env var converted to
PATH=/usr/local/bin:/usr/bin:/usr/bin:/usr/X11R6/bin:/cygdrive/c/WINDOWS
/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:"C:/Prog
ram Files/Symantec/Norton Ghost 2003/":/usr/lib/lapack
   85    8271 [main] lseekend 376 environ_init: 0x420848:
PATH=/usr/local/bin:/usr/bin:/usr/bin:/usr/X11R6/bin:/cygdrive/c/WINDOWS
/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:"C:/Prog
ram Files/Symantec/Norton Ghost 2003/":/usr/lib/lapack
   82    8353 [main] lseekend 376 environ_init: 0x420768:
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
   78    8431 [main] lseekend 376 environ_init: 0x4207A8:
PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig
   79    8510 [main] lseekend 376 environ_init: 0x4207D8:
PRINTER=NPICE37B3 on http://192.168.100.17 (from ASTOR) in session 0
   79    8589 [main] lseekend 376 environ_init: 0x420828:
PROCESSOR_ARCHITECTURE=x86
   78    8667 [main] lseekend 376 environ_init: 0x420C58:
PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 1, GenuineIntel
   78    8745 [main] lseekend 376 environ_init: 0x420CA0:
PROCESSOR_LEVEL=15
   77    8822 [main] lseekend 376 environ_init: 0x420CB8:
PROCESSOR_REVISION=0401
   78    8900 [main] lseekend 376 environ_init: 0x420CD8:
PROGRAMFILES=C:\Program Files
   78    8978 [main] lseekend 376 environ_init: 0x4204B0: PROMPT=$P$G
   77    9055 [main] lseekend 376 environ_init: 0x420D00:
PS1=\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$
   78    9133 [main] lseekend 376 environ_init: 0x420D48:
PWD=/home/Administrator
   94    9227 [main] lseekend 376 environ_init: 0x420D68:
SESSIONNAME=RDP-Tcp#5
   96    9323 [main] lseekend 376 environ_init: 0x420D88: SHLVL=1
   78    9401 [main] lseekend 376 environ_init: 0x420D98: SYSTEMDRIVE=C:
   77    9478 [main] lseekend 376 environ_init: 0x420DB0:
SYSTEMROOT=C:\WINDOWS
   78    9556 [main] lseekend 376 getwinenv: can't set native for TEMP=
since no environ yet
   78    9634 [main] lseekend 376 mount_info::conv_to_posix_path:
conv_to_posix_path (c:\DOCUME~1\ADMINI~1\LOCALS~1\Temp, no-keep-rel,
no-add-slash)
   41    9675 [main] lseekend 376 normalize_win32_path:
c:\DOCUME~1\ADMINI~1\LOCALS~1\Temp = normalize_win32_path
(c:\DOCUME~1\ADMINI~1\LOCALS~1\Temp)
   42    9717 [main] lseekend 376 mount_info::conv_to_posix_path:
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp = conv_to_posix_path
(c:\DOCUME~1\ADMINI~1\LOCALS~1\Temp)
  121    9838 [main] lseekend 376 win_env::add_cache: posix
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp
   40    9878 [main] lseekend 376 win_env::add_cache: native
TEMP=c:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
   41    9919 [main] lseekend 376 posify: env var converted to
TEMP=/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp
   76    9995 [main] lseekend 376 environ_init: 0x420E00:
TEMP=/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp
   79   10074 [main] lseekend 376 environ_init: 0x420DD0: TERM=xterm
   78   10152 [main] lseekend 376 environ_init: 0x420DE0:
TEXDOCVIEW_DVI=cygstart %s
   82   10234 [main] lseekend 376 environ_init: 0x420F70:
TEXDOCVIEW_HTML=cygstart %s
   78   10312 [main] lseekend 376 environ_init: 0x420F90:
TEXDOCVIEW_PDF=cygstart %s
   78   10390 [main] lseekend 376 environ_init: 0x420FB0:
TEXDOCVIEW_PS=cygstart %s
   89   10479 [main] lseekend 376 environ_init: 0x420FD0:
TEXDOCVIEW_TXT=cygstart %s
   79   10558 [main] lseekend 376 getwinenv: can't set native for TMP=
since no environ yet
   78   10636 [main] lseekend 376 mount_info::conv_to_posix_path:
conv_to_posix_path (c:\DOCUME~1\ADMINI~1\LOCALS~1\Temp, no-keep-rel,
no-add-slash)
   42   10678 [main] lseekend 376 normalize_win32_path:
c:\DOCUME~1\ADMINI~1\LOCALS~1\Temp = normalize_win32_path
(c:\DOCUME~1\ADMINI~1\LOCALS~1\Temp)
   42   10720 [main] lseekend 376 mount_info::conv_to_posix_path:
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp = conv_to_posix_path
(c:\DOCUME~1\ADMINI~1\LOCALS~1\Temp)
  115   10835 [main] lseekend 376 win_env::add_cache: posix
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp
   41   10876 [main] lseekend 376 win_env::add_cache: native
TMP=c:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
   41   10917 [main] lseekend 376 posify: env var converted to
TMP=/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp
   76   10993 [main] lseekend 376 environ_init: 0x421020:
TMP=/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp
   78   11071 [main] lseekend 376 environ_init: 0x420FF0:
USER=Administrator
   83   11154 [main] lseekend 376 environ_init: 0x421008:
USERDOMAIN=P3PANDA
   78   11232 [main] lseekend 376 environ_init: 0x421190:
USERNAME=Administrator
   78   11310 [main] lseekend 376 environ_init: 0x4211B0:
USERPROFILE=C:\Documents and Settings\Administrator
   77   11387 [main] lseekend 376 environ_init: 0x4211E8: VISUAL=vi
   78   11465 [main] lseekend 376 environ_init: 0x4211F8:
WINDIR=C:\WINDOWS
   77   11542 [main] lseekend 376 environ_init: 0x421210:
WINDOWID=6565432
   78   11620 [main] lseekend 376 environ_init: 0x421228:
_=/usr/bin/strace
   50   11670 [main] lseekend 376 pinfo_init: Set nice to 0
   41   11711 [main] lseekend 376 pinfo_init: pid 376, pgid 376
  717   12428 [main] lseekend 376 set_privilege: 0 = set_privilege
((token 738) SeRestorePrivilege, 1)
   63   12491 [main] lseekend 376 set_privilege: 1 = set_privilege
((token 738) SeChangeNotifyPrivilege, 1)
  109   12600 [main] lseekend 376 dtable::extend: size 32, fds
0x611556C0
   56   12656 [main] lseekend 376 normalize_posix_path: src /etc/passwd
   42   12698 [main] lseekend 376 normalize_posix_path: /etc/passwd =
normalize_posix_path (/etc/passwd)
   42   12740 [main] lseekend 376 mount_info::conv_to_win32_path:
conv_to_win32_path (/etc/passwd)
   42   12782 [main] lseekend 376 set_flags: flags: binary (0x2)
   41   12823 [main] lseekend 376 mount_info::conv_to_win32_path:
src_path /etc/passwd, dst C:\cygwin\etc\passwd, flags 0xA, rc 0
   87   12910 [main] lseekend 376 symlink_info::check: not a symlink
   42   12952 [main] lseekend 376 symlink_info::check: 0 = symlink.check
(C:\cygwin\etc\passwd, 0x22E830) (0xA)
   44   12996 [main] lseekend 376 path_conv::check:
this->path(C:\cygwin\etc\passwd), has_acls(1)
  218   13214 [main] lseekend 376 etc::test_file_change: FindFirstFile
succeeded
  357   13571 [main] lseekend 376 pwdgrp::load: /etc/passwd curr_lines 6
   43   13614 [main] lseekend 376 pwdgrp::load: /etc/passwd load
succeeded
   61   13675 [main] lseekend 376 normalize_posix_path: src /etc/group
   41   13716 [main] lseekend 376 normalize_posix_path: /etc/group =
normalize_posix_path (/etc/group)
  111   13827 [main] lseekend 376 mount_info::conv_to_win32_path:
conv_to_win32_path (/etc/group)
   44   13871 [main] lseekend 376 set_flags: flags: binary (0x2)
   40   13911 [main] lseekend 376 mount_info::conv_to_win32_path:
src_path /etc/group, dst C:\cygwin\etc\group, flags 0xA, rc 0
   79   13990 [main] lseekend 376 symlink_info::check: not a symlink
   43   14033 [main] lseekend 376 symlink_info::check: 0 = symlink.check
(C:\cygwin\etc\group, 0x22E7F0) (0xA)
   48   14081 [main] lseekend 376 path_conv::check:
this->path(C:\cygwin\etc\group), has_acls(1)
  116   14197 [main] lseekend 376 etc::test_file_change: FindFirstFile
succeeded
  373   14570 [main] lseekend 376 pwdgrp::load: /etc/group curr_lines 17
   43   14613 [main] lseekend 376 pwdgrp::load: /etc/group load
succeeded
   60   14673 [main] lseekend 376 internal_getlogin:
SetTokenInformation(TokenPrimaryGroup), Win32 error 1308
   46   14719 [main] lseekend 376 internal_getlogin:
SetTokenInformation(TokenPrimaryGroup), Win32 error 1308
   42   14761 [main] lseekend 376 cygheap_user::ontherange: what 2, pw
0x421528
   43   14804 [main] lseekend 376 cygheap_user::ontherange: HOME is
already in the environment /home/Administrator
  269   15073 [main] lseekend 376 sigproc_init: process/signal handling
enabled(1001)
  289   15362 [main] lseekend 376 tty_list::allocate_tty: console 200A2
already associated with tty0
   73   15435 [main] lseekend 376 tty_list::allocate_tty: console
0x200A2 associated with tty0
    5   15440 [sig] lseekend 376 wait_sig: myself->dwProcessId 376
   97   15537 [sig] lseekend 376 wait_sig: entering ReadFile loop,
readsig 0x700, myself->sendsig 0x6F8
  980   16517 [main] lseekend 376 build_argv: argv[0] = 'lseekend.exe'
   54   16571 [main] lseekend 376 build_argv: argv[1] = '/dev/sda'
   44   16615 [main] lseekend 376 build_argv: argc 2
  139   16754 [main] lseekend 376 build_fh_pc: fh 0x61155828
   50   16804 [main] lseekend 376 fhandler_base::set_flags: flags
0x10002, supplied_bin 0x0
   44   16848 [main] lseekend 376 fhandler_base::set_flags:
O_TEXT/O_BINARY set in flags 0x10000
   44   16892 [main] lseekend 376 fhandler_base::set_flags: filemode set
to binary
   45   16937 [main] lseekend 376 fhandler_base::init: created new
fhandler_base for handle 0x668, bin 1
  137   17074 [main] lseekend 376 build_fh_pc: fh 0x61155A30
   44   17118 [main] lseekend 376 fhandler_base::set_flags: flags
0x10002, supplied_bin 0x0
   45   17163 [main] lseekend 376 fhandler_base::set_flags:
O_TEXT/O_BINARY set in flags 0x10000
   44   17207 [main] lseekend 376 fhandler_base::set_flags: filemode set
to binary
   44   17251 [main] lseekend 376 fhandler_base::init: created new
fhandler_base for handle 0x664, bin 1
  119   17370 [main] lseekend 376 build_fh_pc: fh 0x61155C38
   44   17414 [main] lseekend 376 fhandler_base::set_flags: flags
0x10002, supplied_bin 0x0
   45   17459 [main] lseekend 376 fhandler_base::set_flags:
O_TEXT/O_BINARY set in flags 0x10000
   46   17505 [main] lseekend 376 fhandler_base::set_flags: filemode set
to binary
   44   17549 [main] lseekend 376 fhandler_base::init: created new
fhandler_base for handle 0x6D8, bin 1
  143   17692 [main] lseekend 376 set_console_title: title 'lseekend'
   67   17759 [main] lseekend 376 dll_crt0_1: user_data->main 0x401050
   45   17804 [main] lseekend 376 __set_errno: void
dll_crt0_1(char*):880 val 0
   45   17849 [main] lseekend 376 wait_for_sigthread: wait_sig_inited
0x6FC
  139   17988 [main] lseekend 376 open: open (/dev/sda, 0x0)
   47   18035 [main] lseekend 376 normalize_posix_path: src /dev/sda
   44   18079 [main] lseekend 376 normalize_posix_path: /dev/sda =
normalize_posix_path (/dev/sda)
   45   18124 [main] lseekend 376 mount_info::conv_to_win32_path:
conv_to_win32_path (/dev/sda)
   51   18175 [main] lseekend 376 mount_info::conv_to_win32_path:
src_path /dev/sda, dst \Device\Harddisk0\Partition0, flags 0x2, rc 0
   55   18230 [main] lseekend 376 build_fh_pc: fh 0x61155E40
  104   18334 [main] lseekend 376 fhandler_base::open:
(\Device\Harddisk0\Partition0, 0x10000)
  177   18511 [main] lseekend 376 fhandler_base::set_flags: flags
0x10000, supplied_bin 0x10000
   63   18574 [main] lseekend 376 fhandler_base::set_flags:
O_TEXT/O_BINARY set in flags 0x10000
   46   18620 [main] lseekend 376 fhandler_base::set_flags: filemode set
to binary
   43   18663 [main] lseekend 376 fhandler_base::open: 0 = NtCreateFile
(0x6FC, 80100000, \Device\Harddisk0\Partition0, io, NULL, 0, 7, 1, 20,
NULL, 0)
   46   18709 [main] lseekend 376 fhandler_base::open: 1 =
fhandler_base::open (\Device\Harddisk0\Partition0, 0x10000)
  142   18851 [main] lseekend 376 open: 3 = open (/dev/sda, 0x0)
   64   18915 [main] lseekend 376 fhandler_dev_floppy::lseek: disk
geometry: (9726 cyl)*(255 trk)*(63 sec)*(512 bps)
  103   19018 [main] lseekend 376 fhandler_dev_floppy::lseek: partition
info: 0 (-1604378624)
   46   19064 [main] lseekend 376 fhandler_dev_floppy::lseek: drive
size: -1604378624
   49   19113 [main] lseekend 376 lseek64: 80000000000 = lseek (3, 0, 2)
   44   19157 [main] lseekend 376 close: close (3)
   49   19206 [main] lseekend 376 fhandler_base::close: closing
'/dev/sda' handle 0x6FC
  111   19317 [main] lseekend 376 close: 0 = close (3)
  112   19429 [main] lseekend 376 fhandler_base::fstat: here
   50   19479 [main] lseekend 376 fstat64: 0 = fstat (1, 0x22D1B0)
  334   19813 [main] lseekend 376 close: close (0)
   53   19866 [main] lseekend 376 fhandler_base::close: closing ''
handle 0x668
   54   19920 [main] lseekend 376 close: 0 = close (0)
  420   20340 [main] lseekend 376 fhandler_base::write: binary write
  147   20487 [main] lseekend 376 close: close (1)
   50   20537 [main] lseekend 376 fhandler_base::close: closing ''
handle 0x664
   53   20590 [main] lseekend 376 close: 0 = close (1)
  444   21034 [main] lseekend 376 close: close (2)
   49   21083 [main] lseekend 376 fhandler_base::close: closing ''
handle 0x6D8
   53   21136 [main] lseekend 376 close: 0 = close (2)
  222   21358 [main] lseekend 376 do_exit: do_exit (0), exit_state 0
   53   21411 [main] lseekend 376 void: 0x0 = signal (20, 0x1)
   50   21461 [main] lseekend 376 void: 0x0 = signal (1, 0x1)
   49   21510 [main] lseekend 376 void: 0x0 = signal (2, 0x1)
   49   21559 [main] lseekend 376 void: 0x0 = signal (3, 0x1)
   51   21610 [main] lseekend 376 sigproc_terminate: entering
   63   21673 [main] lseekend 376 proc_terminate: nprocs 0
    4   21677 [sig] lseekend 376 wait_sig: done
   50   21727 [main] lseekend 376 proc_terminate: leaving
   48   21775 [sig] lseekend 376 _cygtls::remove: wait 0x0
  229   22004 [main] lseekend 376 set_console_title: title
'rxvt00000600'
   53   22057 [main] lseekend 376 do_exit: 376 == sid 376, send SIGHUP
to children
   77   22134 [main] lseekend 376 sigproc_terminate: sigproc handling
not active
   40   22174 [main] lseekend 376 proc_terminate: nprocs 0
   40   22214 [main] lseekend 376 proc_terminate: leaving
   42   22256 [main] lseekend 376 __to_clock_t: dwHighDateTime 0,
dwLowDateTime 0
   40   22296 [main] lseekend 376 __to_clock_t: total 00000000 00000000
   41   22337 [main] lseekend 376 __to_clock_t: dwHighDateTime 0,
dwLowDateTime 0
   40   22377 [main] lseekend 376 __to_clock_t: total 00000000 00000000
  428   22805 [main] lseekend 376
pinfo::maybe_set_exit_code_from_windows: pid 376, exit value - old
0x80000000, windows 0xDEADBEEF, cygwin 0x80000000




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Reply | Threaded
Open this post in threaded view
|

Re: Size difference reported by /proc/partitions and lseek(SEEK_END) on block device

Corinna Vinschen-2
On Dec  6 13:45, Loh, Joe wrote:
> Hello folks,
> We have created the following test case to illustrate the behavior that
> we observed.  Hopefully someone out there can shed some light into the
> subject matter.    This behavior is observed running "CYGWIN_NT-5.2
> P3PANDA 1.5.18(0.132/4/2) 2005-07-02 20:30 i686 unknown unknown Cygwin".

Have you tried this with the latest snashot from
http://cygwin.com/snapshots ?


Corinna

--
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Reply | Threaded
Open this post in threaded view
|

RE: Size difference reported by /proc/partitions and lseek(SEEK_END) on block device

Loh, Joe
In reply to this post by Loh, Joe
> Have you tried this with the latest snashot from
http://cygwin.com/snapshots ?
>
>
> Corinna

We just installed the cygwin-inst-20051207.tar.bz2 snapshot.  The output
in //proc/partitions is the same as the Cygwin Kernel 1.5.18.  However,
the lseek(SEEK_END) no longer works.  When I rerun the "C" program it
gave the following error. I even recompiled with the new snapshot just
to make sure, still the same error.  I have also attached the strace
output for the lseekend.

$ ./lseekend.exe /dev/sda
lseek: Invalid argument

Here's the output from the snapshot:

major minor  #blocks  name

    8     0  78124095 sda
    8     1  15358108 sda1
    8     2    104422 sda2
    8     3  16386300 sda3

Strace for lseekend:

**********************************************
Program name: C:\cygwin\home\Administrator\lseekend.exe (pid 3220, ppid
1)
App version:  1005.19, api: 0.147
DLL version:  1005.19, api: 0.147
DLL build:    20051207 10:34:08SNP
OS version:   Windows NT-5.2
Heap size:    402653184
Date/Time:    2005-12-07 11:15:23
**********************************************
   74     592 [main] lseekend 3220 set_myself: myself->dwProcessId 3220
   63     655 [main] lseekend 3220 time: 1133975723 = time (0)
  548    1203 [main] lseekend 3220 environ_init: GetEnvironmentStrings
returned 0x2458B8 - "=C:=C:\cygwin\bin"
  186    1389 [main] lseekend 3220 environ_init: 0x420238:
!C:=C:\cygwin\bin
   79    1468 [main] lseekend 3220 environ_init: 0x420250:
ALLUSERSPROFILE=C:\Documents and Settings\All Users
   77    1545 [main] lseekend 3220 environ_init: 0x420288:
APPDATA=C:\Documents and Settings\Administrator\Application Data
   80    1625 [main] lseekend 3220 environ_init: 0x4202D0:
CLIENTNAME=Console
   77    1702 [main] lseekend 3220 environ_init: 0x4202E8:
CLUSTERLOG=C:\WINDOWS\Cluster\cluster.log
   78    1780 [main] lseekend 3220 environ_init: 0x420318:
COLORFGBG=0;default;15
   77    1857 [main] lseekend 3220 environ_init: 0x420338:
COLORTERM=rxvt-xpm
   78    1935 [main] lseekend 3220 environ_init: 0x420350:
COMMONPROGRAMFILES=C:\Program Files\Common Files
   78    2013 [main] lseekend 3220 environ_init: 0x420388:
COMPUTERNAME=P3PANDA
   77    2090 [main] lseekend 3220 environ_init: 0x4203A8:
COMSPEC=C:\WINDOWS\system32\cmd.exe
   78    2168 [main] lseekend 3220 environ_init: 0x4203D0:
CVS_RSH=/bin/ssh
   80    2248 [main] lseekend 3220 set_file_api_mode: File APIs set to
OEM
   40    2288 [main] lseekend 3220 parse_options: codepage (called func)
   77    2365 [main] lseekend 3220 parse_options: tty 1001
   78    2443 [main] lseekend 3220 parse_options: binmode 65536
   77    2520 [main] lseekend 3220 parse_options: title 1
   76    2596 [main] lseekend 3220 parse_options: returning
   41    2637 [main] lseekend 3220 environ_init: 0x4203E8:
CYGWIN=codepage:oem tty binmode title
   77    2714 [main] lseekend 3220 environ_init: 0x420460: DISPLAY=:0
   77    2791 [main] lseekend 3220 environ_init: 0x420470: EDITOR=vi
   77    2868 [main] lseekend 3220 environ_init: 0x420480:
FP_NO_HOST_CHECK=NO
   81    2949 [main] lseekend 3220 getwinenv: can't set native for HOME=
since no environ yet
   80    3029 [main] lseekend 3220 mount_info::conv_to_posix_path:
conv_to_posix_path (C:\cygwin\home\Administrator, no-keep-rel,
no-add-slash)
   48    3077 [main] lseekend 3220 normalize_win32_path:
C:\cygwin\home\Administrator = normalize_win32_path
(C:\cygwin\home\Administrator)
   49    3126 [main] lseekend 3220 mount_info::conv_to_posix_path:
/home/Administrator = conv_to_posix_path (C:\cygwin\home\Administrator)
  114    3240 [main] lseekend 3220 win_env::add_cache: posix
/home/Administrator
   41    3281 [main] lseekend 3220 win_env::add_cache: native
HOME=C:\cygwin\home\Administrator
   41    3322 [main] lseekend 3220 posify: env var converted to
HOME=/home/Administrator
   77    3399 [main] lseekend 3220 environ_init: 0x4204C0:
HOME=/home/Administrator
   77    3476 [main] lseekend 3220 environ_init: 0x420498: HOMEDRIVE=C:
   77    3553 [main] lseekend 3220 environ_init: 0x420610:
HOMEPATH=\Documents and Settings\Administrator
   78    3631 [main] lseekend 3220 environ_init: 0x420648:
HOSTNAME=P3PANDA
   77    3708 [main] lseekend 3220 environ_init: 0x420660:
INFOPATH=/usr/local/info:/usr/share/info:/usr/info:
   79    3787 [main] lseekend 3220 environ_init: 0x420698:
LOGONSERVER=\\P3PANDA
   77    3864 [main] lseekend 3220 environ_init: 0x4206B8:
MAKE_MODE=unix
   78    3942 [main] lseekend 3220 environ_init: 0x4206D0:
MANPATH=/usr/local/man:/usr/share/man:/usr/man::/usr/ssl/man
   78    4020 [main] lseekend 3220 environ_init: 0x420718:
NUMBER_OF_PROCESSORS=2
   77    4097 [main] lseekend 3220 environ_init: 0x420738:
OLDPWD=/usr/bin
   77    4174 [main] lseekend 3220 environ_init: 0x420750: OS=Windows_NT
  134    4308 [main] lseekend 3220 getwinenv: can't set native for PATH=
since no environ yet
   50    4358 [main] lseekend 3220 normalize_posix_path: src .
   48    4406 [main] lseekend 3220 mount_info::conv_to_posix_path:
conv_to_posix_path (C:\cygwin\home\Administrator, no-keep-rel,
no-add-slash)
   42    4448 [main] lseekend 3220 normalize_win32_path:
C:\cygwin\home\Administrator = normalize_win32_path
(C:\cygwin\home\Administrator)
   42    4490 [main] lseekend 3220 mount_info::conv_to_posix_path:
/home/Administrator = conv_to_posix_path (C:\cygwin\home\Administrator)
   44    4534 [main] lseekend 3220 cwdstuff::get: posix
/home/Administrator
   43    4577 [main] lseekend 3220 cwdstuff::get: (/home/Administrator)
= cwdstuff::get (0x22EAC0, 260, 1, 0), errno 0
   43    4620 [main] lseekend 3220 normalize_posix_path:
/home/Administrator/ = normalize_posix_path (.)
   41    4661 [main] lseekend 3220 mount_info::conv_to_win32_path:
conv_to_win32_path (/home/Administrator)
   50    4711 [main] lseekend 3220 set_flags: flags: binary (0x2)
   41    4752 [main] lseekend 3220 mount_info::conv_to_win32_path:
src_path /home/Administrator, dst C:\cygwin\home\Administrator, flags
0xA, rc 0
   94    4846 [main] lseekend 3220 symlink_info::check: not a symlink
   43    4889 [main] lseekend 3220 symlink_info::check: 0 =
symlink.check (C:\cygwin\home\Administrator, 0x22E780) (0xA)
  750    5639 [main] lseekend 3220 set_privilege: 1 = set_privilege
((token 708) SeChangeNotifyPrivilege, 1)
  164    5803 [main] lseekend 3220 path_conv::check:
this->path(C:\cygwin\home\Administrator), has_acls(1)
  151    5954 [main] lseekend 3220 mount_info::conv_to_posix_path:
conv_to_posix_path (C:\cygwin\usr\local\bin, keep-rel, no-add-slash)
   50    6004 [main] lseekend 3220 normalize_win32_path:
C:\cygwin\usr\local\bin = normalize_win32_path (C:\cygwin\usr\local\bin)
   44    6048 [main] lseekend 3220 mount_info::conv_to_posix_path:
/usr/local/bin = conv_to_posix_path (C:\cygwin\usr\local\bin)
   42    6090 [main] lseekend 3220 mount_info::conv_to_posix_path:
conv_to_posix_path (C:\cygwin\bin, keep-rel, no-add-slash)
   42    6132 [main] lseekend 3220 normalize_win32_path: C:\cygwin\bin =
normalize_win32_path (C:\cygwin\bin)
   41    6173 [main] lseekend 3220 mount_info::conv_to_posix_path:
/usr/bin = conv_to_posix_path (C:\cygwin\bin)
   41    6214 [main] lseekend 3220 mount_info::conv_to_posix_path:
conv_to_posix_path (C:\cygwin\bin, keep-rel, no-add-slash)
   42    6256 [main] lseekend 3220 normalize_win32_path: C:\cygwin\bin =
normalize_win32_path (C:\cygwin\bin)
   42    6298 [main] lseekend 3220 mount_info::conv_to_posix_path:
/usr/bin = conv_to_posix_path (C:\cygwin\bin)
   41    6339 [main] lseekend 3220 mount_info::conv_to_posix_path:
conv_to_posix_path (C:\cygwin\usr\X11R6\bin, keep-rel, no-add-slash)
   42    6381 [main] lseekend 3220 normalize_win32_path:
C:\cygwin\usr\X11R6\bin = normalize_win32_path (C:\cygwin\usr\X11R6\bin)
   42    6423 [main] lseekend 3220 mount_info::conv_to_posix_path:
/usr/X11R6/bin = conv_to_posix_path (C:\cygwin\usr\X11R6\bin)
   42    6465 [main] lseekend 3220 mount_info::conv_to_posix_path:
conv_to_posix_path (c:\WINDOWS\system32, keep-rel, no-add-slash)
   42    6507 [main] lseekend 3220 normalize_win32_path:
c:\WINDOWS\system32 = normalize_win32_path (c:\WINDOWS\system32)
   42    6549 [main] lseekend 3220 mount_info::conv_to_posix_path:
/cygdrive/c/WINDOWS/system32 = conv_to_posix_path (c:\WINDOWS\system32)
   42    6591 [main] lseekend 3220 mount_info::conv_to_posix_path:
conv_to_posix_path (c:\WINDOWS, keep-rel, no-add-slash)
   42    6633 [main] lseekend 3220 normalize_win32_path: c:\WINDOWS =
normalize_win32_path (c:\WINDOWS)
   41    6674 [main] lseekend 3220 mount_info::conv_to_posix_path:
/cygdrive/c/WINDOWS = conv_to_posix_path (c:\WINDOWS)
   42    6716 [main] lseekend 3220 mount_info::conv_to_posix_path:
conv_to_posix_path (c:\WINDOWS\System32\Wbem, keep-rel, no-add-slash)
   42    6758 [main] lseekend 3220 normalize_win32_path:
c:\WINDOWS\System32\Wbem = normalize_win32_path
(c:\WINDOWS\System32\Wbem)
  112    6870 [main] lseekend 3220 mount_info::conv_to_posix_path:
/cygdrive/c/WINDOWS/System32/Wbem = conv_to_posix_path
(c:\WINDOWS\System32\Wbem)
   45    6915 [main] lseekend 3220 mount_info::conv_to_posix_path:
conv_to_posix_path ("C, keep-rel, no-add-slash)
   41    6956 [main] lseekend 3220 mount_info::conv_to_posix_path: "C =
conv_to_posix_path ("C)
   42    6998 [main] lseekend 3220 mount_info::conv_to_posix_path:
conv_to_posix_path (C:\cygwin\Program Files\Symantec\Norton Ghost
2003\", keep-rel, no-add-slash)
   43    7041 [main] lseekend 3220 normalize_win32_path:
C:\cygwin\Program Files\Symantec\Norton Ghost 2003\" =
normalize_win32_path (C:\cygwin\Program Files\Symantec\Norton Ghost
2003\")
   43    7084 [main] lseekend 3220 mount_info::conv_to_posix_path:
/Program Files/Symantec/Norton Ghost 2003/" = conv_to_posix_path
(C:\cygwin\Program Files\Symantec\Norton Ghost 2003\")
   43    7127 [main] lseekend 3220 mount_info::conv_to_posix_path:
conv_to_posix_path (C:\cygwin\lib\lapack, keep-rel, no-add-slash)
   42    7169 [main] lseekend 3220 normalize_win32_path:
C:\cygwin\lib\lapack = normalize_win32_path (C:\cygwin\lib\lapack)
   43    7212 [main] lseekend 3220 mount_info::conv_to_posix_path:
/usr/lib/lapack = conv_to_posix_path (C:\cygwin\lib\lapack)
  134    7346 [main] lseekend 3220 win_env::add_cache: posix
/usr/local/bin:/usr/bin:/usr/bin:/usr/X11R6/bin:/cygdrive/c/WINDOWS/syst
em32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:"C:/Program
Files/Symantec/Norton Ghost 2003/":/usr/lib/lapack
   45    7391 [main] lseekend 3220 win_env::add_cache: native
PATH=C:\cygwin\usr\local\bin;C:\cygwin\bin;C:\cygwin\bin;C:\cygwin\usr\X
11R6\bin;c:\WINDOWS\system32;c:\WINDOWS;c:\WINDOWS\System32\Wbem;"C;C:\c
ygwin\Program Files\Symantec\Norton Ghost 2003\";C:\cygwin\lib\lapack
   44    7435 [main] lseekend 3220 posify: env var converted to
PATH=/usr/local/bin:/usr/bin:/usr/bin:/usr/X11R6/bin:/cygdrive/c/WINDOWS
/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:"C:/Prog
ram Files/Symantec/Norton Ghost 2003/":/usr/lib/lapack
   79    7514 [main] lseekend 3220 environ_init: 0x420848:
PATH=/usr/local/bin:/usr/bin:/usr/bin:/usr/X11R6/bin:/cygdrive/c/WINDOWS
/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:"C:/Prog
ram Files/Symantec/Norton Ghost 2003/":/usr/lib/lapack
   83    7597 [main] lseekend 3220 environ_init: 0x420768:
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
   78    7675 [main] lseekend 3220 environ_init: 0x4207A8:
PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig
   78    7753 [main] lseekend 3220 environ_init: 0x4207D8:
PRINTER=NPICE37B3 on http://192.168.100.17 (from ASTOR) in session 0
   78    7831 [main] lseekend 3220 environ_init: 0x420828:
PROCESSOR_ARCHITECTURE=x86
   78    7909 [main] lseekend 3220 environ_init: 0x420C58:
PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 1, GenuineIntel
   79    7988 [main] lseekend 3220 environ_init: 0x420CA0:
PROCESSOR_LEVEL=15
   77    8065 [main] lseekend 3220 environ_init: 0x420CB8:
PROCESSOR_REVISION=0401
   78    8143 [main] lseekend 3220 environ_init: 0x420CD8:
PROGRAMFILES=C:\Program Files
   78    8221 [main] lseekend 3220 environ_init: 0x4204B0: PROMPT=$P$G
   77    8298 [main] lseekend 3220 environ_init: 0x420D00:
PS1=\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$
   79    8377 [main] lseekend 3220 environ_init: 0x420D48:
PWD=/home/Administrator
   77    8454 [main] lseekend 3220 environ_init: 0x420D68:
SESSIONNAME=RDP-Tcp#1
   77    8531 [main] lseekend 3220 environ_init: 0x420D88: SHLVL=1
   78    8609 [main] lseekend 3220 environ_init: 0x420D98:
SYSTEMDRIVE=C:
   77    8686 [main] lseekend 3220 environ_init: 0x420DB0:
SYSTEMROOT=C:\WINDOWS
   78    8764 [main] lseekend 3220 getwinenv: can't set native for TEMP=
since no environ yet
   77    8841 [main] lseekend 3220 mount_info::conv_to_posix_path:
conv_to_posix_path (c:\DOCUME~1\ADMINI~1\LOCALS~1\Temp, no-keep-rel,
no-add-slash)
   42    8883 [main] lseekend 3220 normalize_win32_path:
c:\DOCUME~1\ADMINI~1\LOCALS~1\Temp = normalize_win32_path
(c:\DOCUME~1\ADMINI~1\LOCALS~1\Temp)
   47    8930 [main] lseekend 3220 mount_info::conv_to_posix_path:
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp = conv_to_posix_path
(c:\DOCUME~1\ADMINI~1\LOCALS~1\Temp)
  116    9046 [main] lseekend 3220 win_env::add_cache: posix
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp
   40    9086 [main] lseekend 3220 win_env::add_cache: native
TEMP=c:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
   41    9127 [main] lseekend 3220 posify: env var converted to
TEMP=/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp
   77    9204 [main] lseekend 3220 environ_init: 0x420E00:
TEMP=/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp
   78    9282 [main] lseekend 3220 environ_init: 0x420DD0: TERM=xterm
   78    9360 [main] lseekend 3220 environ_init: 0x420DE0:
TEXDOCVIEW_DVI=cygstart %s
   78    9438 [main] lseekend 3220 environ_init: 0x420F70:
TEXDOCVIEW_HTML=cygstart %s
   77    9515 [main] lseekend 3220 environ_init: 0x420F90:
TEXDOCVIEW_PDF=cygstart %s
   78    9593 [main] lseekend 3220 environ_init: 0x420FB0:
TEXDOCVIEW_PS=cygstart %s
   78    9671 [main] lseekend 3220 environ_init: 0x420FD0:
TEXDOCVIEW_TXT=cygstart %s
   82    9753 [main] lseekend 3220 getwinenv: can't set native for TMP=
since no environ yet
   77    9830 [main] lseekend 3220 mount_info::conv_to_posix_path:
conv_to_posix_path (c:\DOCUME~1\ADMINI~1\LOCALS~1\Temp, no-keep-rel,
no-add-slash)
   42    9872 [main] lseekend 3220 normalize_win32_path:
c:\DOCUME~1\ADMINI~1\LOCALS~1\Temp = normalize_win32_path
(c:\DOCUME~1\ADMINI~1\LOCALS~1\Temp)
   42    9914 [main] lseekend 3220 mount_info::conv_to_posix_path:
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp = conv_to_posix_path
(c:\DOCUME~1\ADMINI~1\LOCALS~1\Temp)
  115   10029 [main] lseekend 3220 win_env::add_cache: posix
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp
   41   10070 [main] lseekend 3220 win_env::add_cache: native
TMP=c:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
   40   10110 [main] lseekend 3220 posify: env var converted to
TMP=/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp
   77   10187 [main] lseekend 3220 environ_init: 0x421020:
TMP=/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp
   78   10265 [main] lseekend 3220 environ_init: 0x420FF0:
USER=Administrator
   77   10342 [main] lseekend 3220 environ_init: 0x421008:
USERDOMAIN=P3PANDA
   77   10419 [main] lseekend 3220 environ_init: 0x421190:
USERNAME=Administrator
   78   10497 [main] lseekend 3220 environ_init: 0x4211B0:
USERPROFILE=C:\Documents and Settings\Administrator
   78   10575 [main] lseekend 3220 environ_init: 0x4211E8: VISUAL=vi
   77   10652 [main] lseekend 3220 environ_init: 0x4211F8:
WINDIR=C:\WINDOWS
   78   10730 [main] lseekend 3220 environ_init: 0x421210:
WINDOWID=6565432
   77   10807 [main] lseekend 3220 environ_init: 0x421228:
_=/usr/bin/strace
   51   10858 [main] lseekend 3220 pinfo_init: Set nice to 0
   41   10899 [main] lseekend 3220 pinfo_init: pid 3220, pgid 3220
  690   11589 [main] lseekend 3220 set_privilege: 0 = set_privilege
((token 734) SeRestorePrivilege, 1)
   61   11650 [main] lseekend 3220 set_privilege: 1 = set_privilege
((token 734) SeChangeNotifyPrivilege, 1)
  103   11753 [main] lseekend 3220 dtable::extend: size 32, fds
0x6115C6DC
   54   11807 [main] lseekend 3220 normalize_posix_path: src /etc/passwd
   41   11848 [main] lseekend 3220 normalize_posix_path: /etc/passwd =
normalize_posix_path (/etc/passwd)
   42   11890 [main] lseekend 3220 mount_info::conv_to_win32_path:
conv_to_win32_path (/etc/passwd)
   43   11933 [main] lseekend 3220 set_flags: flags: binary (0x2)
   41   11974 [main] lseekend 3220 mount_info::conv_to_win32_path:
src_path /etc/passwd, dst C:\cygwin\etc\passwd, flags 0xA, rc 0
   85   12059 [main] lseekend 3220 symlink_info::check: not a symlink
   44   12103 [main] lseekend 3220 symlink_info::check: 0 =
symlink.check (C:\cygwin\etc\passwd, 0x22E840) (0xA)
   44   12147 [main] lseekend 3220 path_conv::check:
this->path(C:\cygwin\etc\passwd), has_acls(1)
  135   12282 [main] lseekend 3220 etc::test_file_change: FindFirstFile
succeeded
  397   12679 [main] lseekend 3220 pwdgrp::load: /etc/passwd curr_lines
6
   43   12722 [main] lseekend 3220 pwdgrp::load: /etc/passwd load
succeeded
   63   12785 [main] lseekend 3220 normalize_posix_path: src /etc/group
   42   12827 [main] lseekend 3220 normalize_posix_path: /etc/group =
normalize_posix_path (/etc/group)
   42   12869 [main] lseekend 3220 mount_info::conv_to_win32_path:
conv_to_win32_path (/etc/group)
   45   12914 [main] lseekend 3220 set_flags: flags: binary (0x2)
   42   12956 [main] lseekend 3220 mount_info::conv_to_win32_path:
src_path /etc/group, dst C:\cygwin\etc\group, flags 0xA, rc 0
   74   13030 [main] lseekend 3220 symlink_info::check: not a symlink
   42   13072 [main] lseekend 3220 symlink_info::check: 0 =
symlink.check (C:\cygwin\etc\group, 0x22E810) (0xA)
   44   13116 [main] lseekend 3220 path_conv::check:
this->path(C:\cygwin\etc\group), has_acls(1)
  114   13230 [main] lseekend 3220 etc::test_file_change: FindFirstFile
succeeded
  339   13569 [main] lseekend 3220 pwdgrp::load: /etc/group curr_lines
17
   42   13611 [main] lseekend 3220 pwdgrp::load: /etc/group load
succeeded
   59   13670 [main] lseekend 3220 internal_getlogin:
SetTokenInformation(TokenPrimaryGroup), Win32 error 1308
   45   13715 [main] lseekend 3220 internal_getlogin:
SetTokenInformation(TokenPrimaryGroup), Win32 error 1308
   43   13758 [main] lseekend 3220 cygheap_user::ontherange: what 2, pw
0x421528
   43   13801 [main] lseekend 3220 cygheap_user::ontherange: HOME is
already in the environment /home/Administrator
  260   14061 [main] lseekend 3220 sigproc_init: process/signal handling
enabled, state 0x1001
  297   14358 [sig] lseekend 3220 wait_sig: myself->dwProcessId 3220
   11   14369 [main] lseekend 3220 tty_list::allocate_tty: console 10090
already associated with tty0
   59   14428 [sig] lseekend 3220 wait_sig: entering ReadFile loop,
readsig 0x700, myself->sendsig 0x6FC
   97   14525 [main] lseekend 3220 tty_list::allocate_tty: console
0x10090 associated with tty0
  976   15501 [main] lseekend 3220 build_argv: argv[0] = 'lseekend.exe'
   55   15556 [main] lseekend 3220 build_argv: argv[1] = '/dev/sda'
   45   15601 [main] lseekend 3220 build_argv: argc 2
  135   15736 [main] lseekend 3220 build_fh_pc: fh 0x6115C844
   57   15793 [main] lseekend 3220 fhandler_base::set_flags: flags
0x10002, supplied_bin 0x0
   44   15837 [main] lseekend 3220 fhandler_base::set_flags:
O_TEXT/O_BINARY set in flags 0x10000
   44   15881 [main] lseekend 3220 fhandler_base::set_flags: filemode
set to binary
   44   15925 [main] lseekend 3220 fhandler_base::init: created new
fhandler_base for handle 0x668, bin 1
  127   16052 [main] lseekend 3220 build_fh_pc: fh 0x6115CA4C
   45   16097 [main] lseekend 3220 fhandler_base::set_flags: flags
0x10002, supplied_bin 0x0
   44   16141 [main] lseekend 3220 fhandler_base::set_flags:
O_TEXT/O_BINARY set in flags 0x10000
   44   16185 [main] lseekend 3220 fhandler_base::set_flags: filemode
set to binary
   44   16229 [main] lseekend 3220 fhandler_base::init: created new
fhandler_base for handle 0x664, bin 1
  118   16347 [main] lseekend 3220 build_fh_pc: fh 0x6115CC54
   44   16391 [main] lseekend 3220 fhandler_base::set_flags: flags
0x10002, supplied_bin 0x0
   45   16436 [main] lseekend 3220 fhandler_base::set_flags:
O_TEXT/O_BINARY set in flags 0x10000
   45   16481 [main] lseekend 3220 fhandler_base::set_flags: filemode
set to binary
   44   16525 [main] lseekend 3220 fhandler_base::init: created new
fhandler_base for handle 0x6D8, bin 1
  168   16693 [main] lseekend 3220 set_console_title: title 'lseekend'
   61   16754 [main] lseekend 3220 dll_crt0_1: user_data->main 0x401050
   44   16798 [main] lseekend 3220 __set_errno: void
dll_crt0_1(char*):890 val 0
   44   16842 [main] lseekend 3220 wait_for_sigthread: wait_sig_inited
0x704
  140   16982 [main] lseekend 3220 open: open (/dev/sda, 0x0)
   50   17032 [main] lseekend 3220 normalize_posix_path: src /dev/sda
   43   17075 [main] lseekend 3220 normalize_posix_path: /dev/sda =
normalize_posix_path (/dev/sda)
   54   17129 [main] lseekend 3220 mount_info::conv_to_win32_path:
conv_to_win32_path (/dev/sda)
   51   17180 [main] lseekend 3220 mount_info::conv_to_win32_path:
src_path /dev/sda, dst \Device\Harddisk0\Partition0, flags 0x2, rc 0
   55   17235 [main] lseekend 3220 build_fh_pc: fh 0x6115CE5C
   87   17322 [main] lseekend 3220 fhandler_base::open:
(\Device\Harddisk0\Partition0, 0x10000)
  166   17488 [main] lseekend 3220 fhandler_base::set_flags: flags
0x10000, supplied_bin 0x10000
   69   17557 [main] lseekend 3220 fhandler_base::set_flags:
O_TEXT/O_BINARY set in flags 0x10000
   51   17608 [main] lseekend 3220 fhandler_base::set_flags: filemode
set to binary
   50   17658 [main] lseekend 3220 fhandler_base::open: 0 = NtCreateFile
(0x704, 80100000, \Device\Harddisk0\Partition0, io, NULL, 0, 7, 1, 20,
NULL, 0)
   53   17711 [main] lseekend 3220 fhandler_base::open: 1 =
fhandler_base::open (\Device\Harddisk0\Partition0, 0x10000)
  215   17926 [main] lseekend 3220 fhandler_dev_floppy::get_drive_info:
disk geometry: (9726 cyl)*(255 trk)*(63 sec)*(512 bps)
   57   17983 [main] lseekend 3220 fhandler_dev_floppy::get_drive_info:
partition info: offset 0  length 80000000000
   47   18030 [main] lseekend 3220 fhandler_dev_floppy::get_drive_info:
drive size: 80000000000
   46   18076 [main] lseekend 3220 open: 3 = open (/dev/sda, 0x0)
   52   18128 [main] lseekend 3220 __set_errno: virtual _off64_t
fhandler_dev_floppy::lseek(_off64_t, int):385 val 22
   44   18172 [main] lseekend 3220 lseek64: -1 = lseek (3, 0, 2)
  133   18305 [main] lseekend 3220 fhandler_base::write: binary write
  208   18513 [main] lseekend 3220 fhandler_base::write: binary write
  200   18713 [main] lseekend 3220 fhandler_base::write: binary write
  277   18990 [main] lseekend 3220 fhandler_base::write: binary write
  355   19345 [main] lseekend 3220 close: close (0)
   44   19389 [main] lseekend 3220 fhandler_base::close: closing ''
handle 0x668
   49   19438 [main] lseekend 3220 close: 0 = close (0)
  343   19781 [main] lseekend 3220 close: close (1)
   45   19826 [main] lseekend 3220 fhandler_base::close: closing ''
handle 0x664
   47   19873 [main] lseekend 3220 close: 0 = close (1)
  343   20216 [main] lseekend 3220 close: close (2)
   44   20260 [main] lseekend 3220 fhandler_base::close: closing ''
handle 0x6D8
   46   20306 [main] lseekend 3220 close: 0 = close (2)
  193   20499 [main] lseekend 3220 do_exit: do_exit (256), exit_state 0
   49   20548 [main] lseekend 3220 void: 0x0 = signal (20, 0x1)
   43   20591 [main] lseekend 3220 void: 0x0 = signal (1, 0x1)
   43   20634 [main] lseekend 3220 void: 0x0 = signal (2, 0x1)
   44   20678 [main] lseekend 3220 void: 0x0 = signal (3, 0x1)
   45   20723 [main] lseekend 3220 fhandler_base::close: closing
'/dev/sda' handle 0x704
  112   20835 [main] lseekend 3220 do_exit: 3220 == sid 3220, send
SIGHUP to children
  164   20999 [main] lseekend 3220 set_console_title: title
'rxvt0000061c'
  108   21107 [main] lseekend 3220 sigproc_terminate: entering
   49   21156 [main] lseekend 3220 sig_send: sendsig 0x6FC, pid 3220,
signal -42, its_me 1
   63   21219 [main] lseekend 3220 sig_send: Not waiting for
sigcomplete.  its_me 1 signal -42
    9   21228 [sig] lseekend 3220 wait_sig: saw __SIGEXIT
   47   21275 [main] lseekend 3220 sig_send: returning 0x0 from sending
signal -42
   92   21367 [main] lseekend 3220 proc_terminate: nprocs 0
    8   21375 [sig] lseekend 3220 wait_sig: signal thread exiting
   39   21414 [main] lseekend 3220 proc_terminate: leaving
   49   21463 [sig] lseekend 3220 _cygtls::remove: wait 0x0
  382   21845 [main] lseekend 3220 __to_clock_t: dwHighDateTime 0,
dwLowDateTime 156250
  171   22016 [main] lseekend 3220 __to_clock_t: total 00000000 0000000F
   75   22091 [main] lseekend 3220 __to_clock_t: dwHighDateTime 0,
dwLowDateTime 0
   44   22135 [main] lseekend 3220 __to_clock_t: total 00000000 00000000
  423   22558 [main] lseekend 3220 pinfo::exit: Calling ExitProcess n
0x100, exitcode 0x1


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Reply | Threaded
Open this post in threaded view
|

Re: Size difference reported by /proc/partitions and lseek(SEEK_END) on block device

Corinna Vinschen-2
On Dec  7 11:17, Loh, Joe wrote:
> We just installed the cygwin-inst-20051207.tar.bz2 snapshot.  The output
> in //proc/partitions is the same as the Cygwin Kernel 1.5.18.  However,
> the lseek(SEEK_END) no longer works.  When I rerun the "C" program it
> gave the following error. I even recompiled with the new snapshot just
> to make sure, still the same error.  I have also attached the strace
> output for the lseekend.
>
> $ ./lseekend.exe /dev/sda
> lseek: Invalid argument

Ouch.  Thanks for the report.  I have fixed a buggy condition which
only allowed to seek to 1 byte below EOM in CVS.  You should see the
change in the next developers snapshot.

> Here's the output from the snapshot:
>
> major minor  #blocks  name
>
>     8     0  78124095 sda
>     8     1  15358108 sda1
>     8     2    104422 sda2
>     8     3  16386300 sda3

The reason that /proc/partition contains wrong information is that
the /proc/partition information uses an old, deprecated IOCTL call
to evaluate the disk size by # of cylinders, # of tracks per sektor,
etc.  I didn't fix that so far but it's not overly complicated, so
stay tuned.


Thanks again,
Corinna

--
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Reply | Threaded
Open this post in threaded view
|

Re: Size difference reported by /proc/partitions and lseek(SEEK_END) on block device

Corinna Vinschen-2
On Dec  7 19:12, Corinna Vinschen wrote:

> On Dec  7 11:17, Loh, Joe wrote:
> > major minor  #blocks  name
> >
> >     8     0  78124095 sda
> >     8     1  15358108 sda1
> >     8     2    104422 sda2
> >     8     3  16386300 sda3
>
> The reason that /proc/partition contains wrong information is that
> the /proc/partition information uses an old, deprecated IOCTL call
> to evaluate the disk size by # of cylinders, # of tracks per sektor,
> etc.  I didn't fix that so far but it's not overly complicated, so
> stay tuned.

This should be fixed now, too, in CVS.  Please try the next developers
snapshot.


Corinna

--
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Reply | Threaded
Open this post in threaded view
|

RE: Size difference reported by /proc/partitions and lseek(SEEK_END) on block device

Loh, Joe
In reply to this post by Loh, Joe
>> On Dec  7 11:17, Loh, Joe wrote:
>> We just installed the cygwin-inst-20051207.tar.bz2 snapshot.  The
>> output in //proc/partitions is the same as the Cygwin Kernel 1.5.18.

>> However, the lseek(SEEK_END) no longer works.  When I rerun the "C"
>> program it gave the following error. I even recompiled with the new
>> snapshot just to make sure, still the same error.  I have also
>> attached the strace output for the lseekend.
>>
>> $ ./lseekend.exe /dev/sda
>> lseek: Invalid argument
>
> Ouch.  Thanks for the report.  I have fixed a buggy condition which
only allowed to seek to 1 byte below EOM in CVS.  You should see the
change in the next developers snapshot.

>
>> Here's the output from the snapshot:
>>
>> major minor  #blocks  name
>>
>>     8     0  78124095 sda
>>     8     1  15358108 sda1
>>     8     2    104422 sda2
>>     8     3  16386300 sda3
>
> The reason that /proc/partition contains wrong information is that the
/proc/partition information uses an > old, deprecated IOCTL call to
evaluate the disk size by # of cylinders, # of tracks per sektor, etc.
I didn't fix that so far but it's not overly complicated, so stay tuned.

Thank you.  We will give the next snapshot a try.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Reply | Threaded
Open this post in threaded view
|

RE: Size difference reported by /proc/partitions and lseek(SEEK_END) on block device

Loh, Joe
In reply to this post by Loh, Joe

> This should be fixed now, too, in CVS.  Please try the next developers
snapshot.

We just downloaded cygwin-inst-20051213.tar.bz2 and tried the snapshot.
Problem with lseek(SEEK_END) is resolve and the result returned
corresponded with the /proc/partitions.

Thank you.

Joe

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/