Re: Preremove/postinstall scripts fail with snapshot installed

2011-02-15 Thread Corinna Vinschen
On Feb 14 17:41, Corinna Vinschen wrote:
 On Feb 14 10:20, Corinna Vinschen wrote:
  On Feb 13 18:07, Ken Brown wrote:
   On 2/13/2011 12:20 PM, Ken Brown wrote:
   $1 ls
 0 [main] bash 2220 exception::handle: Exception:
   STATUS_ACCESS_VIOLATION
  
  Yes, I encountered that at one point yesterday as well, and I have
  already a patch in the pipe, but didn't apply it so far because I
  want to do some tests first.
  [...]
  Anyway, I'll apply a patch later today.
 
 Nope, not today.  I stumbled over some other problems which require
 more debugging.

I just uploaded a new snapshot which (hopefully) fixed a couple of bugs,
including this one.  Please give it a test.  If you encounter something
weird, please report.


Thanks,
Corinna

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

--
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: Preremove/postinstall scripts fail with snapshot installed

2011-02-15 Thread Ken Brown

On 2/15/2011 12:09 PM, Corinna Vinschen wrote:

On Feb 14 17:41, Corinna Vinschen wrote:

On Feb 14 10:20, Corinna Vinschen wrote:

On Feb 13 18:07, Ken Brown wrote:

On 2/13/2011 12:20 PM, Ken Brown wrote:
$1 ls
   0 [main] bash 2220 exception::handle: Exception:
STATUS_ACCESS_VIOLATION


Yes, I encountered that at one point yesterday as well, and I have
already a patch in the pipe, but didn't apply it so far because I
want to do some tests first.
[...]
Anyway, I'll apply a patch later today.


Nope, not today.  I stumbled over some other problems which require
more debugging.


I just uploaded a new snapshot which (hopefully) fixed a couple of bugs,
including this one.  Please give it a test.  If you encounter something
weird, please report.


Works fine so far.  The last bug I reported is fixed, and 
preremove/postinstall scripts run OK under setup.exe.


Ken

--
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: Preremove/postinstall scripts fail with snapshot installed

2011-02-14 Thread Corinna Vinschen
On Feb 13 18:07, Ken Brown wrote:
 On 2/13/2011 12:20 PM, Ken Brown wrote:
 Works for me on W7 64 bit with KB 2393802 installed.
 
 BTW, when I said that it works, I was talking about the original bug
 that I reported about preremove/postinstall scripts.  But I just now
 tested removing an in-use directory, and I was surprised by what
 happened.  Maybe I just don't understand how this is supposed to
 work. I have two bash shells open, with prompts $1 and $2.
 
 In shell 1:
 
 $1 mkdir /tmp/foo
 $1 cd /tmp/foo
 
 In shell 2:
 
 $2 rmdir /tmp/foo
 $2 ls /tmp/foo
 ls: cannot access /tmp/foo: No such file or directory
 
 Back to shell 1:
 
 $1 ls
   0 [main] bash 2220 exception::handle: Exception:
 STATUS_ACCESS_VIOLATION

Yes, I encountered that at one point yesterday as well, and I have
already a patch in the pipe, but didn't apply it so far because I
want to do some tests first.

What happens is this.

When Cygwin forks, it actually performs some magic centered around
a call to CreateProcess.  Up to Windows 2003, the CreateProcess
call just duplicates the parent's CWD handle and stores it as the
CWD handle in the child.  Starting with Windows Vista, the CWD handle
is always a fresh one, created on process startup, even if the CWD
of the child is the same as the CWD of the parent.

The problem with this scenario is that in the child process the CWD
handle creation fails, because the requested CWD doesn't exist anymore.
The result is that an important pointer in the OS is NULL.  My change
from yesterday neglected this possibility, so it dereferences this 
pointer without checking it for NULL, which in turn crashes.

Unfortunately it's not just adding a simple test, because Cygwin needs
the pointer to figure out which version of the FAST_CWD structure is
used.

Anyway, I'll apply a patch later today.


Corinna

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

--
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: Preremove/postinstall scripts fail with snapshot installed

2011-02-14 Thread Corinna Vinschen
On Feb 14 10:20, Corinna Vinschen wrote:
 On Feb 13 18:07, Ken Brown wrote:
  On 2/13/2011 12:20 PM, Ken Brown wrote:
  $1 ls
0 [main] bash 2220 exception::handle: Exception:
  STATUS_ACCESS_VIOLATION
 
 Yes, I encountered that at one point yesterday as well, and I have
 already a patch in the pipe, but didn't apply it so far because I
 want to do some tests first.
 [...]
 Anyway, I'll apply a patch later today.

Nope, not today.  I stumbled over some other problems which require
more debugging.


Corinna

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

--
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: Preremove/postinstall scripts fail with snapshot installed

2011-02-13 Thread Corinna Vinschen
On Feb 12 19:12, Corinna Vinschen wrote:
 On Feb 12 17:44, Corinna Vinschen wrote:
  On Feb 12 10:31, Ken Brown wrote:
   I just did a system restore to undo the last round of Windows
   updates, and the problem went away.  I'm not sure where to go from
   here.
  
  You're right, I can reproduce it on W7 32 and 64 bit.
  [...]
  By installing the security updates again, one by one, I figure out
  that it is the security update connected to KB 2393802 which triggers
  the problem.
  [...]
 
 Just FYI, I have a working workaround.  It's not exactly how I would
 like to handle this stuff, but at least we know there *is* a solution
 which still maintains the desired ability to delete an in-use directory.

Ok, I think I have a solution now.

A few hours of debugging turned up that the KB 2393802 patch introduces
a change to the layout of the (undocumented) structure in which Windows
stores the CWD starting with Vista.  That's the structure we called
FAST_CWD in Cygwin.  The new layout is sufficiently different that
Cygwin scrambled the contents of the structure from the Win32
perspective.

Above all, the new structure layout is 4 bytes bigger, because
RtlSetCurrentDirectory_U now also stores some filesystem flags which
RtlGetCurrentDirectory_U uses to find out if the CWD is on a removable
device, and if that device is still available.

If Cygwin scrambled the content effectivly enough, Win32 calls like
CreateProcess could become so confused that they potentially crash with
a SEGV.

I just checked in a patch to Cygwin which uses the new structure layout
on systems which already have the KB 2393802 patch installed and the old
structure layout otherwise.

I also uploaded a new Cygwin snapshot to http://cygwin.com/snapshots/
Please give the today's snapsot a try.  I tested it on Windows 2008 32
bit as well as on W7 32 and 64 bit, with and without KB 2393802
installed.  It works for me.(TM)

I sure hope that Microsoft does not change the structure layout again
any time soon...


Corinna


(*) As a side note, what strikes me as weird is the fact that nothing
at all in the information about KB 2393802(**) points to a
vulnerability related to the CWD and removable devices.  Somehow
this change seems to be entirely unrelated to what the MS11-011
security bulletin is about.  I also inspected all other security
bulletins from this month, but to no avail.

(**) http://www.microsoft.com/technet/security/bulletin/MS11-011.mspx

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

--
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: Preremove/postinstall scripts fail with snapshot installed

2011-02-13 Thread Ken Brown

On 2/13/2011 11:24 AM, Corinna Vinschen wrote:

On Feb 12 19:12, Corinna Vinschen wrote:

On Feb 12 17:44, Corinna Vinschen wrote:

On Feb 12 10:31, Ken Brown wrote:

I just did a system restore to undo the last round of Windows
updates, and the problem went away.  I'm not sure where to go from
here.


You're right, I can reproduce it on W7 32 and 64 bit.
[...]
By installing the security updates again, one by one, I figure out
that it is the security update connected to KB 2393802 which triggers
the problem.
[...]


Just FYI, I have a working workaround.  It's not exactly how I would
like to handle this stuff, but at least we know there *is* a solution
which still maintains the desired ability to delete an in-use directory.


Ok, I think I have a solution now.

A few hours of debugging turned up that the KB 2393802 patch introduces
a change to the layout of the (undocumented) structure in which Windows
stores the CWD starting with Vista.  That's the structure we called
FAST_CWD in Cygwin.  The new layout is sufficiently different that
Cygwin scrambled the contents of the structure from the Win32
perspective.

Above all, the new structure layout is 4 bytes bigger, because
RtlSetCurrentDirectory_U now also stores some filesystem flags which
RtlGetCurrentDirectory_U uses to find out if the CWD is on a removable
device, and if that device is still available.

If Cygwin scrambled the content effectivly enough, Win32 calls like
CreateProcess could become so confused that they potentially crash with
a SEGV.

I just checked in a patch to Cygwin which uses the new structure layout
on systems which already have the KB 2393802 patch installed and the old
structure layout otherwise.

I also uploaded a new Cygwin snapshot to http://cygwin.com/snapshots/
Please give the today's snapsot a try.  I tested it on Windows 2008 32
bit as well as on W7 32 and 64 bit, with and without KB 2393802
installed.  It works for me.(TM)


Works for me on W7 64 bit with KB 2393802 installed.  (I didn't test 
without it.  I had already reinstalled the updates.)


Thanks.

Ken

--
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: Preremove/postinstall scripts fail with snapshot installed

2011-02-13 Thread Andy Koppe
On 13 February 2011 16:24, Corinna Vinschen wrote:
 (*) As a side note, what strikes me as weird is the fact that nothing
    at all in the information about KB 2393802(**) points to a
    vulnerability related to the CWD and removable devices.  Somehow
    this change seems to be entirely unrelated to what the MS11-011
    security bulletin is about.  I also inspected all other security
    bulletins from this month, but to no avail.

If I were a conspiracy theorist I'd suspect a link with a recent
discussion on a certain MSDN blog.

;) Andy

--
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: Preremove/postinstall scripts fail with snapshot installed

2011-02-13 Thread Ken Brown

On 2/13/2011 12:20 PM, Ken Brown wrote:

Works for me on W7 64 bit with KB 2393802 installed.


BTW, when I said that it works, I was talking about the original bug 
that I reported about preremove/postinstall scripts.  But I just now 
tested removing an in-use directory, and I was surprised by what 
happened.  Maybe I just don't understand how this is supposed to work. 
I have two bash shells open, with prompts $1 and $2.


In shell 1:

$1 mkdir /tmp/foo
$1 cd /tmp/foo

In shell 2:

$2 rmdir /tmp/foo
$2 ls /tmp/foo
ls: cannot access /tmp/foo: No such file or directory

Back to shell 1:

$1 ls
  0 [main] bash 2220 exception::handle: Exception: 
STATUS_ACCESS_VIOLATION

Exception: STATUS_ACCESS_VIOLATION at eip=6109352A
eax= ebx=0075A0E8 ecx=77B83442 edx=00732C14 esi=0001 
edi=007309E8
ebp=0028CD08 esp=0028CCC0 program=C:\cygwin\bin\bash.exe, pid 2220, 
thread main

cs=0023 ds=002B es=002B fs=0053 gs=002B ss=002B
Stack trace:
Frame Function  Args
0028CD08  6109352A  (61241A3C, 0001, , 0028CD94)
0028CD28  6109608F  (61241A3C, 0028CE64, 610068B0, 61004AF9)
0028CD58  61006B31  (, 0028CD94, 610068B0, 7EFDE000)
End of stack trace

[repeated many more times...]

15641011 [main] bash 4588 exception::handle: Exception: 
STATUS_ACCESS_VIOLATION

Exception: STATUS_ACCESS_VIOLATION at eip=6109352A
eax= ebx=0081A0E8 ecx=77B83442 edx=007F2C14 esi=0001 
edi=007F09E8
ebp=0028CD08 esp=0028CCC0 program=C:\cygwin\bin\bash.exe, pid 4588, 
thread main

cs=0023 ds=002B es=002B fs=0053 gs=002B ss=002B
Stack trace:
Frame Function  Args
0028CD08  6109352A  (61241A3C, 0001, , 0028CD94)
0028CD28  6109608F  (61241A3C, 0028CE64, 610068B0, 61004AF9)
0028CD58  61006B31  (, 0028CD94, 610068B0, 7EFDE000)
End of stack trace
15643878 [main] -bash 2804 fork: child -1 - died waiting for longjmp 
before initialization, retry 0, exit code 0x600, errno 11

-bash: fork: Resource temporarily unavailable

Is this to be expected?  I admit that it's stupid to try to list a cwd 
that no longer exists, but I would have expected a friendlier response.


Ken

--
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: Preremove/postinstall scripts fail with snapshot installed

2011-02-12 Thread Achim Gratz
Ken Brown kbr...@cornell.edu writes:
 If I run setup.exe with a cygwin snapshot installed, bash crashes
 while running all preremove and postinstall scripts.  Here's a typical
 error message in /var/log/setup.log.full:

I'm getting similar crashes running Git fetch on a snapshot installation
on Win7 I did a few weeks ago while trying to figure out my problem with
named pipes.  I did not change the Cygwin installation since then (which
went fine at the time) and Git was running OK (cloned a few repos, the
ones that now have a problem updating).  If I run the fetch a few times
it will eventually complete, though.  There was a patchday inbetween,
however... also it wouldn't be the first time that some Cygwin program
was deemed malicious by behavioral virus scanners.


Achim.
-- 
+[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+

Factory and User Sound Singles for Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds


--
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: Preremove/postinstall scripts fail with snapshot installed

2011-02-12 Thread Corinna Vinschen
On Feb 11 16:22, Ken Brown wrote:
 If I run setup.exe with a cygwin snapshot installed, bash crashes
 while running all preremove and postinstall scripts.  Here's a
 typical error message in /var/log/setup.log.full:
 
 2011/02/11 15:56:55 running: C:\cygwin\bin\bash.exe --norc
 --noprofile /etc/preremove/emacs-X11.sh
   0 [main] bash 2760 exception::handle: Exception:
 STATUS_ACCESS_VIOLATION
1739 [main] bash 2760 open_stackdumpfile: Dumping stack trace to
 bash.exe.stackdump

I'm sorry, but YA works fine for me, on Windows 7 64 bit.

 Exception: STATUS_ACCESS_VIOLATION at eip=772DA671
 eax=00F8 ebx=0089F4C0 ecx=0008EC50 edx=0028B974 esi=00F8 edi=0003
 ebp=0028B97C esp=0028B97C program=C:\cygwin\bin\bash.exe, pid 2712, thread 
 main
 cs=0023 ds=002B es=002B fs=0053 gs=002B ss=002B
 Stack trace:
 Frame Function  Args
 0028B97C  772DA671  (00F8, 0089D3A0, , 0028BA34)
 0028B990  772E640D  (0089D3A0, 776E5386, 0028BAFC, 0028BA98)
 0028BA34  7731E1DD  (0028BA60, 0208, 0028BAFC, )
 0028BA68  772DAD80  (0089F4C0, 0208, 0028BAFC, )
 0028BA84  772FC943  (0089F4C0, 0208, 0028BAFC, )
 0028BADC  7516C498  (0001, 0104, 0028BAFC, 0028BD44)
 0028BD08  75170C30  (0028BD3C, 0028BDC8, 0001, 0028C24C)
 0028BD48  751709CB  (0089F298, 0198, , 0001)
 0028BD6C  75170964  (0089F298, 0198, , 0080)
 0028BFA0  75175C49  (019C, 0198, 0089F298, )
 0028BFF0  75175AFA  (019C, 0028C114, , 000A)
 0028C680  75171ADC  (, 60FE0018, 60FE0018, 6117974C)
 0028C6B8  75161059  (60FE0018, 60FE0018, 6117974C, 6117974C)
 0028C788  61066A75  (0028C7B4, 0028C790, 00DC5048, 610722B6)
 0028C908  61067368  (00FF, 0028C938, 0028C934, 004451D9)
 0028C948  610C1185  (00DC50F8, , 00DC3BE0, 00A0)
 End of stack trace (more stack frames may be present)

The last Cygwin address in this call stack (61066A75) is an entirely
harmless line in an entirely harmless function in a piece of code taken
from FreeBSD.  From there it goes downhill through at least two Windows
DLLs (all address starting with 7).  The joke is that this last Cygwin
address in the call stack is practically unable to generate an access
violation *and* it does not call any Windows function.  I habe no idea
why that happens, but it tastes a lot like a BLODA problem.


Corinna

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

--
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: Preremove/postinstall scripts fail with snapshot installed

2011-02-12 Thread Ken Brown

On 2/12/2011 9:25 AM, Corinna Vinschen wrote:

On Feb 11 16:22, Ken Brown wrote:

If I run setup.exe with a cygwin snapshot installed, bash crashes
while running all preremove and postinstall scripts.  Here's a
typical error message in /var/log/setup.log.full:

2011/02/11 15:56:55 running: C:\cygwin\bin\bash.exe --norc
--noprofile /etc/preremove/emacs-X11.sh
   0 [main] bash 2760 exception::handle: Exception:
STATUS_ACCESS_VIOLATION
1739 [main] bash 2760 open_stackdumpfile: Dumping stack trace to
bash.exe.stackdump


I'm sorry, but YA works fine for me, on Windows 7 64 bit.


Exception: STATUS_ACCESS_VIOLATION at eip=772DA671
eax=00F8 ebx=0089F4C0 ecx=0008EC50 edx=0028B974 esi=00F8 edi=0003
ebp=0028B97C esp=0028B97C program=C:\cygwin\bin\bash.exe, pid 2712, thread main
cs=0023 ds=002B es=002B fs=0053 gs=002B ss=002B
Stack trace:
Frame Function  Args
0028B97C  772DA671  (00F8, 0089D3A0, , 0028BA34)
0028B990  772E640D  (0089D3A0, 776E5386, 0028BAFC, 0028BA98)
0028BA34  7731E1DD  (0028BA60, 0208, 0028BAFC, )
0028BA68  772DAD80  (0089F4C0, 0208, 0028BAFC, )
0028BA84  772FC943  (0089F4C0, 0208, 0028BAFC, )
0028BADC  7516C498  (0001, 0104, 0028BAFC, 0028BD44)
0028BD08  75170C30  (0028BD3C, 0028BDC8, 0001, 0028C24C)
0028BD48  751709CB  (0089F298, 0198, , 0001)
0028BD6C  75170964  (0089F298, 0198, , 0080)
0028BFA0  75175C49  (019C, 0198, 0089F298, )
0028BFF0  75175AFA  (019C, 0028C114, , 000A)
0028C680  75171ADC  (, 60FE0018, 60FE0018, 6117974C)
0028C6B8  75161059  (60FE0018, 60FE0018, 6117974C, 6117974C)
0028C788  61066A75  (0028C7B4, 0028C790, 00DC5048, 610722B6)
0028C908  61067368  (00FF, 0028C938, 0028C934, 004451D9)
0028C948  610C1185  (00DC50F8, , 00DC3BE0, 00A0)
End of stack trace (more stack frames may be present)


The last Cygwin address in this call stack (61066A75) is an entirely
harmless line in an entirely harmless function in a piece of code taken
from FreeBSD.  From there it goes downhill through at least two Windows
DLLs (all address starting with 7).  The joke is that this last Cygwin
address in the call stack is practically unable to generate an access
violation *and* it does not call any Windows function.  I habe no idea
why that happens, but it tastes a lot like a BLODA problem.


Did you test it with the latest Windows updates installed?  The only 
thing I can think of that changed on the two computers where I have this 
issue is that there was a Windows update the night before the problem 
started.  I might try rolling back the update before I start searching 
for BLODA.


Ken


--
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: Preremove/postinstall scripts fail with snapshot installed

2011-02-12 Thread Ken Brown

On 2/12/2011 9:58 AM, Ken Brown wrote:

On 2/12/2011 9:25 AM, Corinna Vinschen wrote:

On Feb 11 16:22, Ken Brown wrote:

If I run setup.exe with a cygwin snapshot installed, bash crashes
while running all preremove and postinstall scripts.  Here's a
typical error message in /var/log/setup.log.full:

2011/02/11 15:56:55 running: C:\cygwin\bin\bash.exe --norc
--noprofile /etc/preremove/emacs-X11.sh
0 [main] bash 2760 exception::handle: Exception:
STATUS_ACCESS_VIOLATION
 1739 [main] bash 2760 open_stackdumpfile: Dumping stack trace to
bash.exe.stackdump


I'm sorry, but YA works fine for me, on Windows 7 64 bit.


Exception: STATUS_ACCESS_VIOLATION at eip=772DA671
eax=00F8 ebx=0089F4C0 ecx=0008EC50 edx=0028B974 esi=00F8 edi=0003
ebp=0028B97C esp=0028B97C program=C:\cygwin\bin\bash.exe, pid 2712, thread main
cs=0023 ds=002B es=002B fs=0053 gs=002B ss=002B
Stack trace:
Frame Function  Args
0028B97C  772DA671  (00F8, 0089D3A0, , 0028BA34)
0028B990  772E640D  (0089D3A0, 776E5386, 0028BAFC, 0028BA98)
0028BA34  7731E1DD  (0028BA60, 0208, 0028BAFC, )
0028BA68  772DAD80  (0089F4C0, 0208, 0028BAFC, )
0028BA84  772FC943  (0089F4C0, 0208, 0028BAFC, )
0028BADC  7516C498  (0001, 0104, 0028BAFC, 0028BD44)
0028BD08  75170C30  (0028BD3C, 0028BDC8, 0001, 0028C24C)
0028BD48  751709CB  (0089F298, 0198, , 0001)
0028BD6C  75170964  (0089F298, 0198, , 0080)
0028BFA0  75175C49  (019C, 0198, 0089F298, )
0028BFF0  75175AFA  (019C, 0028C114, , 000A)
0028C680  75171ADC  (, 60FE0018, 60FE0018, 6117974C)
0028C6B8  75161059  (60FE0018, 60FE0018, 6117974C, 6117974C)
0028C788  61066A75  (0028C7B4, 0028C790, 00DC5048, 610722B6)
0028C908  61067368  (00FF, 0028C938, 0028C934, 004451D9)
0028C948  610C1185  (00DC50F8, , 00DC3BE0, 00A0)
End of stack trace (more stack frames may be present)


The last Cygwin address in this call stack (61066A75) is an entirely
harmless line in an entirely harmless function in a piece of code taken
from FreeBSD.  From there it goes downhill through at least two Windows
DLLs (all address starting with 7).  The joke is that this last Cygwin
address in the call stack is practically unable to generate an access
violation *and* it does not call any Windows function.  I habe no idea
why that happens, but it tastes a lot like a BLODA problem.


Did you test it with the latest Windows updates installed?  The only
thing I can think of that changed on the two computers where I have this
issue is that there was a Windows update the night before the problem
started.  I might try rolling back the update before I start searching
for BLODA.


I just did a system restore to undo the last round of Windows updates, 
and the problem went away.  I'm not sure where to go from here.


Ken


--
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: Preremove/postinstall scripts fail with snapshot installed

2011-02-12 Thread Corinna Vinschen
On Feb 12 10:31, Ken Brown wrote:
 On 2/12/2011 9:58 AM, Ken Brown wrote:
 On 2/12/2011 9:25 AM, Corinna Vinschen wrote:
 The last Cygwin address in this call stack (61066A75) is an entirely
 harmless line in an entirely harmless function in a piece of code taken
 from FreeBSD.  From there it goes downhill through at least two Windows
 DLLs (all address starting with 7).  The joke is that this last Cygwin
 address in the call stack is practically unable to generate an access
 violation *and* it does not call any Windows function.  I habe no idea
 why that happens, but it tastes a lot like a BLODA problem.
 
 Did you test it with the latest Windows updates installed?  The only
 thing I can think of that changed on the two computers where I have this
 issue is that there was a Windows update the night before the problem
 started.  I might try rolling back the update before I start searching
 for BLODA.
 
 I just did a system restore to undo the last round of Windows
 updates, and the problem went away.  I'm not sure where to go from
 here.

You're right, I can reproduce it on W7 32 and 64 bit.  I reverted all
security updates from last Tuesday, rebooted, and the problem went
away.  On another machine I kept the security updates but reverted
Cygwin to 1.7.7 instead and the problem also went away.

So this problem occurs on Windows 7 and perhaps Vista only with recent
Cygwin snapshots or current CVS, only with the latest security updates
installed and, for some reason, only when calling postinstall scripts
from setup.exe.  Calling the same scripts from an interactive bash works
fine.

The 2010-10-18 snapshot is the snapshot which reintroduced the ability
to remove in-use directories by accessing an undocumented structure in
Vista/Windows 7.  Looks like MSFT had to change something which breaks
an application using this structure in a very specifc scenario, which is
unfortunately exposed by running bash from setup.exe :-(

By installing the security updates again, one by one, I figure out
that it is the security update connected to KB 2393802 which triggers
the problem.

But, be it as it is, it doesn't make sense to ask people not to install
the security updates, so I fear it's back to the drawing board for
Cygwin.  Sigh.


Thanks for the report,
Corinna

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

--
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: Preremove/postinstall scripts fail with snapshot installed

2011-02-12 Thread Corinna Vinschen
On Feb 12 17:44, Corinna Vinschen wrote:
 On Feb 12 10:31, Ken Brown wrote:
  I just did a system restore to undo the last round of Windows
  updates, and the problem went away.  I'm not sure where to go from
  here.
 
 You're right, I can reproduce it on W7 32 and 64 bit.
 [...]
 So this problem occurs on Windows 7 and perhaps Vista only with recent
 Cygwin snapshots or current CVS, only with the latest security updates
 installed and, for some reason, only when calling postinstall scripts
 from setup.exe.  Calling the same scripts from an interactive bash works
 fine.
 
 The 2010-10-18 snapshot is the snapshot which reintroduced the ability
 to remove in-use directories by accessing an undocumented structure in
 Vista/Windows 7.  Looks like MSFT had to change something which breaks
 an application using this structure in a very specifc scenario, which is
 unfortunately exposed by running bash from setup.exe :-(
 
 By installing the security updates again, one by one, I figure out
 that it is the security update connected to KB 2393802 which triggers
 the problem.
 
 But, be it as it is, it doesn't make sense to ask people not to install
 the security updates, so I fear it's back to the drawing board for
 Cygwin.  Sigh.

Just FYI, I have a working workaround.  It's not exactly how I would
like to handle this stuff, but at least we know there *is* a solution
which still maintains the desired ability to delete an in-use directory.

Stay tuned.


Corinna

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

--
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: Preremove/postinstall scripts fail with snapshot installed

2011-02-12 Thread Christopher Faylor
On Sat, Feb 12, 2011 at 07:12:24PM +0100, Corinna Vinschen wrote:
Just FYI, I have a working workaround.  It's not exactly how I would
like to handle this stuff, but at least we know there *is* a solution
which still maintains the desired ability to delete an in-use directory.

Stay tuned.

Funny how this cropped up twice in different ways in the last two days.

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: Preremove/postinstall scripts fail with snapshot installed

2011-02-11 Thread Ken Brown

On 2/11/2011 4:22 PM, Ken Brown wrote:

If I run setup.exe with a cygwin snapshot installed, bash crashes while
running all preremove and postinstall scripts.  Here's a typical error
message in /var/log/setup.log.full:

2011/02/11 15:56:55 running: C:\cygwin\bin\bash.exe --norc --noprofile
/etc/preremove/emacs-X11.sh
0 [main] bash 2760 exception::handle: Exception:
STATUS_ACCESS_VIOLATION
 1739 [main] bash 2760 open_stackdumpfile: Dumping stack trace to
bash.exe.stackdump

I can reproduce this on two different Win7 machines, but the problem
doesn't occur on a third machine running XP SP3.  I'm attaching cygcheck
output from one of the Win7 machines, as well as a bash stackdump.

I've tested this on the latest snapshot (2011-02-07) as well as the
2010-12-01 snapshot.  I haven't yet had a chance to test earlier
snapshots to see where the problem first occurs, but I'll try to do that
over the weekend.  The problem does not occur under cygwin 1.7.7.


OK, the problem first occurs in the 2010-10-18 snapshot.

What's really puzzling is that I've been running snapshots for quite a 
while, and this problem didn't show up until today.  I have no idea what 
changed.


Ken


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