On Tue, 17 Jan 2023 21:46:20 +0100
Corinna Vinschen wrote:
> Hi Takashi,
>
> On Jan 16 22:42, Corinna Vinschen via Cygwin wrote:
> > On Jan 16 16:18, Corinna Vinschen via Cygwin wrote:
> > > Actually, I' running your testcase on two machines in parallel now for
> > > quite some time, which only one hunk of 60675f1a7eb2 reverted, i.e.
> > >
> > > diff --git a/winsup/cygwin/mm/shared.cc b/winsup/cygwin/mm/shared.cc
> > > index 893b20d289b4..6d6d2940b6d4 100644
> > > --- a/winsup/cygwin/mm/shared.cc
> > > +++ b/winsup/cygwin/mm/shared.cc
> > > @@ -140,7 +140,11 @@ open_shared (const WCHAR *name, int n, HANDLE&
> > > shared_h, DWORD size,
> > > if (*m == SH_JUSTCREATE || *m == SH_JUSTOPEN)
> > > addr = NULL;
> > > else
> > > - addr = (void *) region_address[*m];
> > > + {
> > > + addr = (void *) region_address[*m];
> > > + VirtualFree (addr, 0, MEM_RELEASE);
> > > + }
> > > +
> > >
> > > WCHAR map_buf[MAX_PATH];
> > > WCHAR *mapname = NULL;
> > >
> > > So far (and knocking on wood madly while writing this) the mapping
> > > problem didn't show up once. Maybe you'd like to try the same?
> >
> > Never mind, I encountered another error. After a bit more debugging
> > I think I understand the problem now, and I'm just in the process of
> > reworking open_shared. This may take a day or two. Stay tuned.
>
> I pushed some patches to fix this issue. Excessive debugging indicated
> that the reason cygcheck fails in this way is:
>
> - It's a non-Cygwin process which
>
> - is built with high-entropy ASLR and
>
> - tries to load the Cygwin DLL dynamically and
>
> - therefore suffers from the fact that recent Cygwin code doesn't
> expect that certain memory regions are used by Windows itself.
> Which they are, due to the high-entropy stuff.
>
> The patches are supposed to make the code less rigid in terms of the
> addresses of certain memory regions, as well as dropping the
> high-entropy VA flag from builds of strace and cygcheck, both of which
> are loading the Cygwin DLL dynamically as part of their job.
>
> The test release 3.5.0-0.116.g8d318bf142f7 contains the patches, for
> everybody to try.
Thank you very much for working on this problem. It seems that
it was unexpectedly large-scale modification.
I confirmed that the problem has been fixed with these patches.
The test case has been running for 11 hours but the problem does
not happen so far.
--
Takashi Yano <[email protected]>
--
Problem reports: https://cygwin.com/problems.html
FAQ: https://cygwin.com/faq/
Documentation: https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple