Re: fsync bug

2011-09-21 Thread Christopher Faylor
On Wed, Sep 21, 2011 at 03:07:21PM -0600, Eric Blake wrote:
>On 09/21/2011 02:54 PM, Christopher Faylor wrote:
>> On Wed, Sep 21, 2011 at 02:43:21PM -0600, Eric Blake wrote:
>>> fsync() is required to work on read-only fds (in theory, you can sync
>>> the atime metadata, which is a write operation triggered by a read-only
>>> fd).  But cygwin rejects this program, which works on Linux:
>>>
>>> $ cat foo.c
>>> #include
>>> #include
>>> #include
>>> #include
>>> #include
>>> #include
>>> int main (void)
>>> {
>>>int fd = open("file", O_CREAT|O_EXCL|O_WRONLY, 0600);
>>>if (fd<  0)
>>>  return 1;
>>>if (close(fd))
>>>  return 2;
>>>fd = open("file", O_RDONLY);
>>>if (fd<  0)
>>>  return 3;
>>>if (fsync(fd))
>>>  return 4;
>>>if (unlink("file"))
>>>  return 5;
>>>puts("success");
>>>return 0;
>>> }
>>> $ rm -f file&&  ./foo; echo $?
>>> 4
>>
>> http://msdn.microsoft.com/en-us/library/aa364439%28VS.85%29.aspx
>
>So what's wrong with making fsync() a no-op for read-only fds, on the 
>grounds that windows doesn't give us a way to flush that data, so the 
>best emulation we can do is by ignoring the request rather than 
>propagating a spurious failure back to the user?

It's hard to see how lying that fsync worked would satisfy the
requirements to write metadata.  But, then, it isn't clear that this is
even an issue on Windows.

But, in any event, you know where the source code is.

cgf

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



RE: Permission denied but have permission

2011-09-21 Thread Thrall, Bryan
Lou U wrote on 2011-09-21: 
> 
> I am a newbie running cygwin on Windows 7. I want to run an installer
> for graphics software, Dislin, viz.
> 
> $./setup.exe
> bash: ./setup.exe Permission denied

Windows 7 has something called UAC[1] which forces you to run anything called 
'setup.exe' with Administrator privileges. You either need to disable UAC or 
run the installer from Windows Explorer or a command prompt.

[1] http://en.wikipedia.org/wiki/User_Account_Control

Hope this helps,
--
Bryan Thrall
Principal Software Engineer
FlightSafety International
bryan.thr...@flightsafety.com
  



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



Permission denied but have permission

2011-09-21 Thread Lou U

I am a newbie running cygwin on Windows 7. I want to run an installer for
graphics software, Dislin, viz.

$./setup.exe
bash: ./setup.exe Permission denied

Permissions for setup.exe are -rwxrwxrwx+
setup will run in a Windows Command window. I'm wondering if that "+" in the
permissions is a problem. If so, how do I circumvent it? Any help would be
appreciated.
Lou
-- 
View this message in context: 
http://old.nabble.com/Permission-denied-but-have-permission-tp32503779p32503779.html
Sent from the Cygwin list mailing list archive at Nabble.com.


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



Re: fsync bug

2011-09-21 Thread Eric Blake

On 09/21/2011 02:54 PM, Christopher Faylor wrote:

On Wed, Sep 21, 2011 at 02:43:21PM -0600, Eric Blake wrote:

fsync() is required to work on read-only fds (in theory, you can sync
the atime metadata, which is a write operation triggered by a read-only
fd).  But cygwin rejects this program, which works on Linux:

$ cat foo.c
#include
#include
#include
#include
#include
#include
int main (void)
{
   int fd = open("file", O_CREAT|O_EXCL|O_WRONLY, 0600);
   if (fd<  0)
 return 1;
   if (close(fd))
 return 2;
   fd = open("file", O_RDONLY);
   if (fd<  0)
 return 3;
   if (fsync(fd))
 return 4;
   if (unlink("file"))
 return 5;
   puts("success");
   return 0;
}
$ rm -f file&&  ./foo; echo $?
4


http://msdn.microsoft.com/en-us/library/aa364439%28VS.85%29.aspx


So what's wrong with making fsync() a no-op for read-only fds, on the 
grounds that windows doesn't give us a way to flush that data, so the 
best emulation we can do is by ignoring the request rather than 
propagating a spurious failure back to the user?


Also, FlushFileBuffers sounds more like fdatasync(); I'm wondering if 
fsync() should also be flushing the containing directory of any given 
file, in case file metadata (such as timestamps or changes in size via 
truncate) still need to be flushed to disk by flushing the directory.


--
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org

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



Re: fsync bug

2011-09-21 Thread Christopher Faylor
On Wed, Sep 21, 2011 at 02:43:21PM -0600, Eric Blake wrote:
>fsync() is required to work on read-only fds (in theory, you can sync 
>the atime metadata, which is a write operation triggered by a read-only 
>fd).  But cygwin rejects this program, which works on Linux:
>
>$ cat foo.c
>#include 
>#include 
>#include 
>#include 
>#include 
>#include 
>int main (void)
>{
>   int fd = open("file", O_CREAT|O_EXCL|O_WRONLY, 0600);
>   if (fd < 0)
> return 1;
>   if (close(fd))
> return 2;
>   fd = open("file", O_RDONLY);
>   if (fd < 0)
> return 3;
>   if (fsync(fd))
> return 4;
>   if (unlink("file"))
> return 5;
>   puts("success");
>   return 0;
>}
>$ rm -f file && ./foo; echo $?
>4

http://msdn.microsoft.com/en-us/library/aa364439%28VS.85%29.aspx

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



fsync bug

2011-09-21 Thread Eric Blake
fsync() is required to work on read-only fds (in theory, you can sync 
the atime metadata, which is a write operation triggered by a read-only 
fd).  But cygwin rejects this program, which works on Linux:


$ cat foo.c
#include 
#include 
#include 
#include 
#include 
#include 
int main (void)
{
  int fd = open("file", O_CREAT|O_EXCL|O_WRONLY, 0600);
  if (fd < 0)
return 1;
  if (close(fd))
return 2;
  fd = open("file", O_RDONLY);
  if (fd < 0)
return 3;
  if (fsync(fd))
return 4;
  if (unlink("file"))
return 5;
  puts("success");
  return 0;
}
$ rm -f file && ./foo; echo $?
4

--
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org

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



Re: Re: this really sucks - 37 seconds to do /usr/bin/ls

2011-09-21 Thread Peter Li

On 7/22/64 11:59 AM, jan.kolar wrote:

jvsrvcs wrote:

OK , I was wrong.  I removed bash completion / git completion and on a
Virtual Box VM (windows xp pro x32 with cygwin installed)

/usr/bin/ls and most other commands take more than 30 seconds to complete.
The box is a quad core with 8GB ram and no other VM is running (host OS
is win 7 and cygwin runs blazingly fast).

I did not have this problem under Windows Virtual PC.  there must be
something I installed with the latest cygwin that is doing this.

/usr/bin/ls takes more than 36 seconds.

When I vi a file, I have to go take a break and come back for it to be
open in the editor.

any ideas?
If things like ls and vi are taking forever, doesn't it sound like your 
VM is borked or your hard drive is failing?


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



Re: setup hanging when running postinstall scripts

2011-09-21 Thread Ben Nye
I am having the same issue as Paul 
(http://sourceware.org/ml/cygwin/2010-11/msg00170.html), but I have already 
tried rebaseall and I have nothing on the BLODA list.

System is:
Windows XP 32 bit (with SP3 and all updates)
Cygwin Version: 1.7.9-1

In fact, I stripped my system down until I literally have almost nothing extra 
running period- but I still get the same issue.  When I try to use setup.exe to 
manage dmalloc- it gives me exit code 254 for every single postinstall script 
(after taking forever to complete each one).  It doesn't matter if I am 
installing it, re-installing it, or uninstalling it- the setup always fails.

The problems in the setup.log.full are noted as such:

For: etc/postistall/000-cygwin-post-install.sh

bash (some number) C:\cygwin\bin\bash.exe *** fatal error - Couldn't allocate 
heap, Win32 error 487

For 000-cygwin-post-install.sh and all other post-install scripts afterward:

bash (some number) fork: child -1 - died waiting for longjmp before 
initialization, retry 0, exit code 0x100, errno 11 (path of the script here): 
fork: retry: Resource temporarily unavailable
bash (some number) C:\cygwin\bin\bash.exe *** fatal error - Couldn't allocate 
heap, Win32 error 487, base 0x4E, top 0x55, reserve_size 454656, 
allocsize 458752, page_const 4096

At this point, I literally have no idea why these things should be failing but 
I am wondering if there is some issue with the setup system itself.  I 
previously had a copy of Cygwin 1.5 on this machine and it never had any 
issues.  

When cleaned out that copy and installed 1.7 I recall that it was working okay, 
but I had a few packages that had some issues with their post-install scripts 
when I tried to use setup to manage my installation (so ultimately, I just 
decided to forgo those packages).

However, I do actually need dmalloc.  Hence I am wondering what the heck the 
problem is.  Here was the list of programs running on the machine on my last 
attempt to run setup.exe, following a full rebaseall in ash:

smss.exe
csrss.exe
winlogon.exe
services.exe
wmiprvse.exe
alg.exe
lsass.exe
explorer.exe
ctfmon.exe
svchost.exe
- DcomLaunch
svchost.exe
- RpcSs
svchost.exe
- Automatic Updates
- BITS
- Com+ Event Manager
- Computer Browser
- Cyptographic Services
- DHCP Client
- Distributed Link Tracking Client
- Error Reporting Service
- Help and Support
- HID
- Network Connections
- NLA
- Remote Access Manager
- Secondary Login
- Security Center
- Server
- Shell Hardware Manager
- System Event Notification
- Task Scheduler
- Telephony
- Themes
- Windows Audio
- Windows Firewall
- WMI
- Windows Time
- Wireless Zero Configuration
- Workstation
svchost.exe
- DNSCache
svchost.exe
- Remote Registry
- SSDP Discovery Service
- TCP/IP NetBIOS LMHosts
svchost.exe
- Webclient
svchost.exe
- Windows Image Acquisition (WMA)
svchost.exe
- HTTP SSL

So that's everything- all the programs and services running.  Nothing BLODA to 
my knowledge.  Heck, if anything there WAS BLODA that should mean that cygwin 
should learn to play nicely with it- all of this stuff is basic WinXP services 
and programs.  So hence... why?  What else could be causing this issue?

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



Re: Permission denied but have permission

2011-09-21 Thread BZTSilversleeves

Lou U wrote:

I am a newbie running cygwin on Windows 7. I want to run an installer for
graphics software, Dislin.
$./setup.exe
bash: ./setup.exe Permission denied
Permissions for setup.exe are -rwxrwxrwx+
setup will run in a Windows Command window. I'm wondering if that "+" in the
permissions is a problem. If so, how do I circumvent it? Any help would be
appreciated.
Lou

Lou,

cygstart is the command for starting Windows applications from the 
command line. Most installers will run from Windows Explorer. I'm 
curious to know why you don't just double-click on the item.


That plus sign on the end is Cygwin's way of noting the file "setup.exe" 
has ACLs -- permissions of a type native to Windows that aren't _quite 
suitable for ready display in a terminal. You can look them up on the 
Cygwin site. (There's also the command 'getfacl ', but IMO its 
output is a little abstruse for newbie Cygwin users).


Helpful? Good.

SW



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



Re: OverflowError with bzr 2.4.0-1 [attn: bzr maintainer]

2011-09-21 Thread Jari Aalto
2011-09-20 17:50 Ken Brown :
| On 9/5/2011 7:43 AM, Ronald Blaschke wrote:
| 
| I'm seeing the same error in my bzr repositories (I have several).
| 
| Jari?  Ping?

Yup, checkin on it.

Jari


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



Re: this really sucks - 37 seconds to do /usr/bin/ls

2011-09-21 Thread jan.kolar


> On 16/09/2011 7.46, J.V. wrote:
>> I install the latest cygwin on Windows XP Pro x32 on a VM under the
>> latest version of VirtualBox.
>>
>> When I do anything it takes a long time. 


jvsrvcs wrote:
> 
> OK , I was wrong.  I removed bash completion / git completion and on a 
> Virtual Box VM (windows xp pro x32 with cygwin installed)
> 
> /usr/bin/ls and most other commands take more than 30 seconds to complete.
> The box is a quad core with 8GB ram and no other VM is running (host OS 
> is win 7 and cygwin runs blazingly fast).
> 
> I did not have this problem under Windows Virtual PC.  there must be 
> something I installed with the latest cygwin that is doing this.
> 
> /usr/bin/ls takes more than 36 seconds.
> 
> When I vi a file, I have to go take a break and come back for it to be 
> open in the editor.
> 
> any ideas?
> 

What about the timing and output of 
strace  bash --noprofile -norc -c /bin/echo 


Thread
http://old.nabble.com/Cygwin-too-slow-while-installing-and-working-to32453954.html
might be related.

-- 
View this message in context: 
http://old.nabble.com/this-really-sucks---37-seconds-to-do--usr-bin-ls-tp32480953p32503748.html
Sent from the Cygwin list mailing list archive at Nabble.com.


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



Re: EXTERNAL: Re: Cygwin too slow while installing and working

2011-09-21 Thread jan.kolar


João Moreira wrote:
> 
> On Wed, Sep 14, 2011 at 7:40 PM, Larry Hall (Cygwin) wrote:
> ...
> During startup of cygwin, which took about 40 seconds,
> ...
> 

What about the timing and output of the following:

strace  bash --noprofile -norc -c /bin/echo


jk

-- 
View this message in context: 
http://old.nabble.com/Cygwin-too-slow-while-installing-and-working-tp32453954p32503746.html
Sent from the Cygwin list mailing list archive at Nabble.com.


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