Segmentation fault due to double free for archetype.

2022-01-15 Thread Takashi Yano
Hi,

I found the following test case causes segmentation fault
in 32 bit cygwin.

#include 
#include 
#include 

int main() {
for (int i = 0; i < 256; i++) {
printf("\r%d, %d\n", i, open("/dev/ptmx", O_RDWR | O_NOCTTY));
}
return 0;
}


The test case results in:

$ ./a.exe
0, 3
1, 4
2, 5
[...]
125, 128
126, 129
  0 [main] a 50 tty_list::allocate: No pty allocated
127, -1
   1549 [main] a 50 tty_list::allocate: No pty allocated
128, -1
   3047 [main] a 50 tty_list::allocate: No pty allocated
129, -1
   4625 [main] a 50 tty_list::allocate: No pty allocated
130, -1
   6477 [main] a 50 tty_list::allocate: No pty allocated
Segmentation fault 
(core dumped)


I looked into this problem and found that this is due to
free'ing archetype which was already free'ed by _cfree().

The mechanism of the problem is:
1) archetype is added to archetypes[] at line 675 in dtable.cc
   when trying to open pty.
2) Opening pty fails because too many ptys are opened.
3) archetype is deleted at line 444 in fhandler.cc.
4) archetype is copied from archetypes[] at line 659 in dtable.cc
   which is already free'ed in step 3) when trying to open pty again.
5) Opening pty fails again.
6) archetype which was already free'ed in step 3) is deleted at
   line 444 in fhandler.cc.

I am not sure why this does not happen in 64 bit cygwin.
I guess double free does not cause segfault by chance in
64 bit cygwin.

I also found the following patch fixes the issue. Is this the
right thing?

diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index fc7c0422e..e51208117 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -441,7 +441,7 @@ fhandler_base::open_with_arch (int flags, mode_t mode)
|| open (flags, mode & 0)))
 {
   if (archetype)
-   delete archetype;
+   cygheap->fdtab.delete_archetype (archetype);
 }
   else if (archetype)
 {

-- 
Takashi Yano 

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


Newname====($"NULL"$)====PROTOTYPE====CALAVARY LOGGER====0.0.0.0====0X0000000====NTATHORITY_SECURITY 0X0====MY RAW VIRTUAL STATIC SIGNATURE. YOU ALL OWE ME MONEY.!!!!!! ELSE GLOBALINFRASTRUCTUREEMULAT

2022-01-15 Thread Null Bug



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


Re: CMake support into libssh-0.8.7-1 is broken.

2022-01-15 Thread Marco Atzeri

On 14.01.2022 23:30, Carlo B. wrote:

Hello,
I discovered that CMake support into current libssh-0.8.7-1 is broken.
After you installed the development package, you just need to add this
line into a dummy CMakeLists.txt:


find_package(libssh)


and into the console you will read:


CMake Error at /usr/lib/cmake/libssh/libssh-config.cmake:21 (message):
   File or directory /usr/lib/cygssh.dll referenced by variable
   LIBSSH_LIBRARIES does not exist !


The error is correct because, if you open
/usr/lib/cmake/libssh/libssh-config.cmake, you will see this code:


if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/CMakeCache.txt")
 # In tree build
 set_and_check(LIBSSH_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/include")
 set_and_check(LIBSSH_LIBRARIES "${CMAKE_CURRENT_LIST_DIR}/lib/cygssh.dll")
else()
 set_and_check(LIBSSH_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/include")
 set_and_check(LIBSSH_LIBRARIES "${PACKAGE_PREFIX_DIR}/lib/cygssh.dll")
endif()


which is wrong since the right value for LIBSSH_LIBRARIES should be
"${PACKAGE_PREFIX_DIR}/bin/cygssh-4.dll" or
"${CMAKE_CURRENT_LIST_DIR}/bin/cygssh-4.dll".
After that, I downloaded the latest stable libssh-0.9.6, I tried to
build it but it crashes with an internal GCC error at compile time:


during RTL pass: final
/home/Carlo/libssh-0.9.6/src/sftp.c: In function ‘sftp_packet_read’:
/home/Carlo/libssh-0.9.6/src/sftp.c:549:1: internal compiler error: in
i386_pe_seh_unwind_emit, at config/i386/winnt.c:1275
   549 | }
   | ^


So, I downloaded the latest sources from the repository: GCC still
emits an internal compiler error, but only when building the examples.
So I configured with -DWITH_EXAMPLES=OFF and I got the base library
compiled.
Here, I verified that the macros for CMake are generated correctly
with the right names and paths.

Is it possible to fix or update this package?
Thank you very much for your time.

Sincerely.



noted

Regards
Marco


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


[ANNOUNCEMENT] Updated: Perl distributions

2022-01-15 Thread Achim Gratz


The following Perl distributions have been updated to their latest
release version available on CPAN:

x86/x86_64
--
perl-Net-SSLeay-1.92-1-src
perl-PerlIO-utf8_strict-0.009-1-src

noarch
--
perl-Business-ISBN-3.007-1-src
perl-JSON-4.05-1-src
perl-Tie-Cycle-1.227-1-src

-- 
  *** CYGWIN-ANNOUNCE UNSUBSCRIBE INFO ***

If you want to unsubscribe from the cygwin-announce mailing list, look
at the "List-Unsubscribe: " tag in the email header of this message.
Send email to the address specified there. It will be in the format:

cygwin-announce-unsubscribe-you=yourdomain@cygwin.com

If you need more information on unsubscribing, start reading here:

http://sourceware.org/lists.html#unsubscribe-simple

Please read *all* of the information on unsubscribing that is available
starting at this URL.

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


[ANNOUNCEMENT] xorg-server-21.1.3-1

2022-01-15 Thread Jon Turney



The following packages have been uploaded to the Cygwin distribution:

* xorg-server-21.1.3-1
* xorg-server-common-21.1.3-1
* xorg-server-extra-21.1.3-1
* xorg-server-devel-21.1.3-1
* xorg-server-xorg-21.1.3-1
* xwinclip-21.1.3-1

These packages contain XWin and the other X.Org X11 servers.

In addition to upstream fixes [1], the following cygwin-specific changes 
have been made since 21.1.2-2:


* Rework display number locking to avoid left-over socket files causing 
problems.

  Addresses: https://cygwin.com/pipermail/cygwin/2022-January/250419.html

[1] https://lists.x.org/archives/xorg-announce/2022-January/003127.html

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


Re: [ANNOUNCEMENT] xorg-server-21.1.3-1 / recent setups not working on Win8 / winsymlinks:lnk

2022-01-15 Thread Dan Harkless

On 1/15/2022 9:27 AM, Jon Turney wrote:


The following packages have been uploaded to the Cygwin distribution:

* xorg-server-21.1.3-1
* xorg-server-common-21.1.3-1
* xorg-server-extra-21.1.3-1
* xorg-server-devel-21.1.3-1
* xorg-server-xorg-21.1.3-1
* xwinclip-21.1.3-1

These packages contain XWin and the other X.Org X11 servers.

In addition to upstream fixes [1], the following cygwin-specific 
changes have been made since 21.1.2-2:


* Rework display number locking to avoid left-over socket files 
causing problems.

  Addresses: https://cygwin.com/pipermail/cygwin/2022-January/250419.html

[1] https://lists.x.org/archives/xorg-announce/2022-January/003127.html


Forgive me if this is a FAQ (I tried searching), but is there a standard 
timeframe in between when a package update is announced on the list and 
when it's actually available on the mirrors?


I tried every https mirror, but none of them have the new versions. I've 
been having trouble with the X server and xwin-xdg-menu failing to start 
up properly (in a semi-non-repeatable way), so I was hoping to get this 
update now.


I tried upgrading setup-x86_64.exe to 2.915, in case some fix was needed 
to get the new packages to show up, but like the last several versions 
of the setup programs (2.909 is the last one I remember working), it 
doesn't work on my Windows 8.1 system (with all available MS updates).  
Running the installer from Explorer results in nothing happening 
whatsoever.


Running setup from bash as Administrator results in:

   Starting cygwin install, version 2.915
   User has backup/restore rights
   User has symlink creation right
   *** --symlink-type lnk is not implemented

I've had my CYGWIN environment variable set to "wincmdln 
winsymlinks:lnk" for ages, and it's always worked before.  I /highly/ 
prefer the lnk implementation of symlinks, since it allows me to make 
them from non-Admin shells, etc.


--
Dan Harkless
http://harkless.org/dan/



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


Re: [ANNOUNCEMENT] xorg-server-21.1.3-1 / recent setups not working on Win8 / winsymlinks:lnk

2022-01-15 Thread Dan Harkless

On 1/15/2022 10:26 AM, Dan Harkless wrote:

On 1/15/2022 9:27 AM, Jon Turney wrote:


The following packages have been uploaded to the Cygwin distribution:

* xorg-server-21.1.3-1
* xorg-server-common-21.1.3-1
* xorg-server-extra-21.1.3-1
* xorg-server-devel-21.1.3-1
* xorg-server-xorg-21.1.3-1
* xwinclip-21.1.3-1

These packages contain XWin and the other X.Org X11 servers.

In addition to upstream fixes [1], the following cygwin-specific 
changes have been made since 21.1.2-2:


* Rework display number locking to avoid left-over socket files 
causing problems.
  Addresses: 
https://cygwin.com/pipermail/cygwin/2022-January/250419.html


[1] https://lists.x.org/archives/xorg-announce/2022-January/003127.html


Forgive me if this is a FAQ (I tried searching), but is there a 
standard timeframe in between when a package update is announced on 
the list and when it's actually available on the mirrors?


I tried every https mirror, but none of them have the new versions.  
I've been having trouble with the X server and xwin-xdg-menu failing 
to start up properly (in a semi-non-repeatable way), so I was hoping 
to get this update now.


I tried upgrading setup-x86_64.exe to 2.915, in case some fix was 
needed to get the new packages to show up, but like the last several 
versions of the setup programs (2.909 is the last one I remember 
working), it doesn't work on my Windows 8.1 system (with all available 
MS updates).  Running the installer from Explorer results in nothing 
happening whatsoever.


Running setup from bash as Administrator results in:

Starting cygwin install, version 2.915
User has backup/restore rights
User has symlink creation right
*** --symlink-type lnk is not implemented

I've had my CYGWIN environment variable set to "wincmdln 
winsymlinks:lnk" for ages, and it's always worked before.  I /highly/ 
prefer the lnk implementation of symlinks, since it allows me to make 
them from non-Admin shells, etc.


Oh, and forgot to mention I took a look at 
https://cygwin.com/mirrors-report.html, and it claims (by omission) that 
most of the mirrors I tried are supposed to be complete and up-to-date, 
so... I'm not sure what that page is even indicating.


--
Dan Harkless
http://harkless.org/dan/


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


Re: [ANNOUNCEMENT] xorg-server-21.1.3-1 / recent setups not working on Win8 / winsymlinks:lnk

2022-01-15 Thread Marco Atzeri

On 15.01.2022 19:26, Dan Harkless wrote:

On 1/15/2022 9:27 AM, Jon Turney wrote:


The following packages have been uploaded to the Cygwin distribution:

* xorg-server-21.1.3-1
* xorg-server-common-21.1.3-1
* xorg-server-extra-21.1.3-1
* xorg-server-devel-21.1.3-1
* xorg-server-xorg-21.1.3-1
* xwinclip-21.1.3-1

Forgive me if this is a FAQ (I tried searching), but is there a standard 
timeframe in between when a package update is announced on the list and 
when it's actually available on the mirrors?




it depends on the specific mirror sync timing.
Some are doing every hour, but others every day or more

In this moment however I see on my preferred server that
21.1.3-1 is marked as test.

Jon,
is it intentional ?



Regards
Marco



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


Re: [ANNOUNCEMENT] xorg-server-21.1.3-1 / recent setups not working on Win8 / winsymlinks:lnk

2022-01-15 Thread Brian Inglis

On 2022-01-15 12:06, Marco Atzeri wrote:

On 15.01.2022 19:26, Dan Harkless wrote:

On 1/15/2022 9:27 AM, Jon Turney wrote:

The following packages have been uploaded to the Cygwin distribution:
* xorg-server-21.1.3-1
* xorg-server-common-21.1.3-1
* xorg-server-extra-21.1.3-1
* xorg-server-devel-21.1.3-1
* xorg-server-xorg-21.1.3-1
* xwinclip-21.1.3-1


Forgive me if this is a FAQ (I tried searching), but is there a 
standard timeframe in between when a package update is announced on 
the list and when it's actually available on the mirrors?



it depends on the specific mirror sync timing.
Some are doing every hour, but others every day or more


Check for outdated mirrors at:

https://cygwin.com/mirrors-report.html

Compare the modified time stamp on your local mirror for:

$mirror/x86_64/setup.{bz2,ini,xz,zst}

to that on the master for:

{ftp,http,https}://cygwin.com/pub/cygwin/x86{,64}/setup.{bz2,ini,xz,zst}

or just the sha512.sum at each (e.g. using curl -I).


In this moment however I see on my preferred server that
21.1.3-1 is marked as test.

Jon,
is it intentional ?


I see 21.1.3-1 as current and 21.1.0-1 as test on my local mirror

$mirror/x86_64/setup.{bz2,ini,xz,zst}

and also the master

{ftp,http,https}://cygwin.com/pub/cygwin/x86{,64}/setup.{bz2,ini,xz,zst}

--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]

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


Re: [ANNOUNCEMENT] xorg-server-21.1.3-1 / recent setups not working on Win8 / winsymlinks:lnk

2022-01-15 Thread Dan Harkless

On 1/15/2022 2:13 PM, Brian Inglis wrote:

On 2022-01-15 12:06, Marco Atzeri wrote:

On 15.01.2022 19:26, Dan Harkless wrote:
Forgive me if this is a FAQ (I tried searching), but is there a 
standard timeframe in between when a package update is announced on 
the list and when it's actually available on the mirrors?

it depends on the specific mirror sync timing.
Some are doing every hour, but others every day or more


Check for outdated mirrors at:

https://cygwin.com/mirrors-report.html

Compare the modified time stamp on your local mirror for:

$mirror/x86_64/setup.{bz2,ini,xz,zst}

to that on the master for:

{ftp,http,https}://cygwin.com/pub/cygwin/x86{,64}/setup.{bz2,ini,xz,zst}

or just the sha512.sum at each (e.g. using curl -I).


Cool.  Thanks for that magic formula.


In this moment however I see on my preferred server that
21.1.3-1 is marked as test.

Jon,
is it intentional ?


I see 21.1.3-1 as current and 21.1.0-1 as test on my local mirror

$mirror/x86_64/setup.{bz2,ini,xz,zst}

and also the master

{ftp,http,https}://cygwin.com/pub/cygwin/x86{,64}/setup.{bz2,ini,xz,zst}


Thank you.  I was able to update to the latest X packages this evening.  
Still having trouble with them not working properly on my Windows 8.1 
systems, but it may be related to firewalling and VPN split-tunneling 
not working as I'd expect.  I'll continue to troubleshoot, and hopefully 
someone can look at the setup programs' current failure to work on Win8 
and/or with winsymlinks:lnk set.


--
Dan Harkless
http://harkless.org/dan/



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