Re: arc4random does not reseed after using fork()

2024-01-27 Thread Johnothan King via Cygwin
> FYI: There was a thread in Nov 2023 about rand() which might be related.
> 
> rand is not ISO C compliant in Cygwin
> https://cygwin.com/pipermail/cygwin/2023-November/254735.html
> 
> conclusion of that thread:
> https://cygwin.com/pipermail/cygwin/2023-November/254764.html

I don't think that has much relevance here, as this is regarding
arc4random's seed after a fork, not rand's behavior in threads.
In any case I think I have found the cause of the bug. In
arc4random.c, _rs_stir_if_needed() attempts to detect a fork by
calling _rs_forkdetect(), which is located in arc4random.h. However,
that function is nothing more than a stub:
   static inline void
   _rs_forkdetect(void)
   {
   #ifdef _ARC4RANDOM_FORKDETECT
_ARC4RANDOM_FORKDETECT();
   #endif
   }
If _ARC4RANDOM_FORKDETECT is defined, _rs_forkdetect will attempt to
use it for detecting if a fork occured (the LibreSSL implementation
then zeros out `rs' with 'memset(rs, 0, sizeof(*rs));'.
Yet Cygwin has no such function or macro, so _rs_forkdetect does
nothing and _rs_stir subsequently cannot reseed after a fork() occurs.

- Johnothan King

-- 
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: arc4random does not reseed after using fork()

2024-01-27 Thread Brian Inglis via Cygwin

On 2024-01-26 16:50, Glenn Strauss via Cygwin wrote:

While testing ksh93u+m's recently added SRANDOM variable[1], I have
discovered a bug in Cygwin's arc4random function. After using fork(),
arc4random does not reseed itself, which causes the results to become
predictable[2]. Below is a test case C program exhibiting the bug:
...
[1]: https://github.com/ksh93/ksh/commit/00b296c
[2]: https://github.com/ksh93/ksh/issues/711



FYI: There was a thread in Nov 2023 about rand() which might be related.
rand is not ISO C compliant in Cygwin
https://cygwin.com/pipermail/cygwin/2023-November/254735.html
conclusion of that thread:
https://cygwin.com/pipermail/cygwin/2023-November/254764.html


No newlib man page or libc info but is in man-pages-linux.
Note that arc4random.c appears to be straight from OpenBSD but arc4random.h 
appears to be newlib, so could function docs be added into arc4random.h, perhaps 
based on OpenBSD man page?


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

La perfection est atteinte   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut
 -- Antoine de Saint-Exupéry


--
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: New package: btop 1.3.0-1

2024-01-27 Thread Brian Inglis via Cygwin

On 2024-01-26 18:30, Takashi Yano via Cygwin wrote:

On Sat, 27 Jan 2024 08:58:49 +0900
Takashi Yano wrote:

On Fri, 26 Jan 2024 16:09:10 -0700
Brian Inglis wrote:

Window blips and disappears whether running from XDG Menu btop++ or terminal!


What happens if you run btop in mintty or UXterm?


I could reproduce the problem. I'll release 1.3.0-2.


Release 2 btop works as great as hoped for! Thanks!

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

La perfection est atteinte   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut
 -- Antoine de Saint-Exupéry

--
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: [ITP] pigz 2.8

2024-01-27 Thread Ihor via Cygwin-apps
Hi Marco, Jon!

I just was wondering should I change smth or no :) Thank you for your 
explanation and clarification!

So, I'm proceeding with package publishing according to 
https://www.cygwin.com/packaging-contributors-guide.html#acceptance

Best regards,
Ihor


Updated: proj-9.3.1-1

2024-01-27 Thread Marco Atzeri via Cygwin-announce

New versions 9.3.1-1 of

  proj
  libproj-devel
  libproj25

for cygwin are available in the Cygwin distribution:

CHANGES
Last upstream release.

NOTES
Additional Datumgrid for Europe, North America
and Oceania are available on
https://proj.org/download.html

while proj-datumgrid-1.8.tar.gz is included as basic
data in the packages.

DESCRIPTION
PROJ - Cartographic Projections Library and CLI

PROJ is a generic coordinate transformation software
that transforms geospatial coordinates from one coordinate
reference system (CRS) to another. This includes cartographic
projections as well as geodetic transformations.
PROJ is released under the X/MIT open source license

HOMEPAGE
https://proj.org/

Marco Atzeri

If you have questions or comments, please send them to the
cygwin mailing list at: cygwin (at) cygwin (dot) com .

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

The easiest way to unsubscribe is to visit 
, and click 'Unsubscribe'.

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



Updated: postgresql-16.1-1

2024-01-27 Thread Marco Atzeri via Cygwin-announce

Version 16.1-1  of packages

  libecpg-compat3
  libecpg-devel
  libecpg6
  libpgtypes3
  libpq-devel
  libpq5
  postgresql
  postgresql-client
  postgresql-contrib
  postgresql-devel
  postgresql-doc
  postgresql-plperl
  postgresql-plpython

are available in the Cygwin distribution:

CHANGES
This is the latest upstream 16.x release,
upstream and security info on
https://www.postgresql.org/about/news/postgresql-161-155-1410-1313-1217-and-1122-released-2749/

Migration to Version 16.x
https://www.postgresql.org/docs/16/release-16.html

ADVISE for major version UPGRADE
http://www.postgresql.org/support/versioning/

Major releases usually change the internal format of system tables
and data files. These changes are often complex, so we do not maintain
backward compatibility of all stored data. A dump/reload of the
database or use of the pg_upgrade module is required for major upgrades.


DESCRIPTION
PostgreSQL is a powerful, open source object-relational database system.
It has a proven architecture that has earned it a strong reputation for
reliability, data integrity, and correctness.
It is fully ACID compliant, has full support for foreign keys, joins, views,
triggers, and stored procedures (in multiple languages).
It includes most SQL:2008 data types

HOMEPAGE
http://www.postgresql.org

Marco Atzeri

If you have questions or comments, please send them to the
cygwin mailing list at: cygwin (at) cygwin (dot) com .

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

The easiest way to unsubscribe is to visit 
, and click 'Unsubscribe'.

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



Updated: mc-4.8.31-1

2024-01-27 Thread Marco Atzeri via Cygwin-announce

Version mc-4.8.31-1 of Midnight Commander
has been uploaded for cygwin

CHANGES
This is a upstream bugfix release
https://www.midnight-commander.org/wiki/NEWS-4.8.31

DESCRIPTION
GNU Midnight Commander is a visual file manager. It's a feature rich
full-screen text mode application that allows you to copy, move and
delete files and whole directory trees, search for files and run
commands in the subshell. Internal viewer and editor are included.

HOMEPAGE
https://midnight-commander.org/


Regards
Marco Atzeri

If you have questions or comments, please send them to the
cygwin mailing list at: cygwin (at) cygwin (dot) com .

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

The easiest way to unsubscribe is to visit 
, and click 'Unsubscribe'.

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



Updated: {mingw64-{i686,x86_64}-,}zlib-1.3.1-1

2024-01-27 Thread ASSI


The following packages have been uploaded to the Cygwin distribution:

* zlib0-1.3.1-1
* zlib-devel-1.3.1-1
* mingw64-i686-zlib-1.3.1-1
* mingw64-x86_64-zlib-1.3.1-1

zlib is designed to be a free, general-purpose, lossless
data-compression library for use on virtually any computer hardware and
operating system.  The zlib data format is itself portable across
platforms.

This is an update to the latest upstream release.

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

The easiest way to unsubscribe is to visit 
, and click 'Unsubscribe'.

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



Updated: {,{mingw64-{x86_64,i686}}xz 5.4.6-1

2024-01-27 Thread ASSI


The following packages have been uploaded to the Cygwin distribution:

 xz-5.4.6-1
 liblzma5-5.4.6-1
 liblzma-devel-5.4.6-1

 mingw64-i686-xz-5.4.6-1
 mingw64-x86_64-xz-5.4.6-1

XZ Utils is free general-purpose data compression software with high 
compression ratio. XZ Utils are the successor to LZMA Utils.


This is an update to the latest upstream release.

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

The easiest way to unsubscribe is to visit 
, and click 'Unsubscribe'.

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



Updated: Perl distributions

2024-01-27 Thread ASSI


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

x86_64
--
 perl-Math-Int64-0.57-1
 perl-XML-LibXML-2.0210-1
 perl-YAML-LibYAML-0.89-1

noarch
--
 mingw64-i686-xz-5.4.6-1
 mingw64-i686-zlib-1.3.1-1
 mingw64-x86_64-xz-5.4.6-1
 mingw64-x86_64-zlib-1.3.1-1
 perl-Business-ISBN-Data-20240126.001-1
 perl-IO-Socket-SSL-2.085-1
 perl-libwww-perl-6.76-1
 perl-LWP-Protocol-https-6.12-1
 perl-Net-DNS-1.43-1
 perl-Test-Warnings-0.033-1
 perl-URI-5.24-1

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

The easiest way to unsubscribe is to visit 
, and click 'Unsubscribe'.

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



Re: /usr/bin/fallocate missing in Cygwin 3.5's "util-linux" ...

2024-01-27 Thread Marco Atzeri via Cygwin

On 27/01/2024 11:06, Mark Geisert via Cygwin wrote:

On 1/26/2024 11:26 PM, ASSI via Cygwin wrote:

Mark Geisert via Cygwin writes:

A new build of the util-linux package, 2.33.1-3, now includes
fallocate and its man page.  The updated package is now making its way
to the Cygwin mirrors.  fallocate requires Cygwin version >= 3.5.0.


It also doesn't work at all on Cygwin 3.4.x and 3.5 isn't yet released,
so please add a dependency for cygwin(>= 3.5) to the hints file.


Done. I guess you answered my unasked question of how to limit one 
executable of a package to specific Cygwin version(s): you don't. You 
limit the whole package instead?

Thanks & Regards,

..mark



yes but put it as test, otherwise Setup will pull cygwin-3.5.0



--
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: [PATCH 1/5] Cygwin: Make 'ulimit -c' control writing a coredump

2024-01-27 Thread Jon Turney

On 26/01/2024 11:52, Corinna Vinschen wrote:

On Jan 26 12:12, Corinna Vinschen wrote:

On Jan 25 20:03, Jon Turney wrote:

On 25/01/2024 18:21, Corinna Vinschen wrote:

On Jan 25 14:50, Jon Turney wrote:

On 24/01/2024 14:39, Corinna Vinschen wrote:

On Jan 24 13:28, Jon Turney wrote:

On 23/01/2024 14:29, Corinna Vinschen wrote:

On Jan 23 14:20, Jon Turney wrote:

[...]

So this situation with a JIT debugger is even stranger than my emendations
to the documentation say.

Because we're hitting try_to_debug() in exception::handle(), which has some
code to replay the exception via ExceptionContinueExecution (which I guess
the debugger will catch as a first-chance) (and goes into a mode where it
ignores the next half-million exceptions... no idea what that's about!)

That's not the same as signal_exit() with a coredumping signal (haven't
checked if those are all generated from exceptions, but seems probable, so
the try_to_debug() there maybe isn't doing anything?), where we're going to
exit thereafter.


try_to_debug() is only calling IsDebuggerPresent() as test, and that's
nothing but a flag in the PEB which is set by the OS after a debugger
attached to the process.  So the test is by definition extremely
flaky, if the debugger is connecting and disconnecting, as you
already pointed out.

I'm wondering if we can't define our own way to attach to a process,
allowing to "WaitForDebugger" as long as the debugger is a Cygwin
debugger.  If we define a matching function (along the lines of
prctl(2) on Linux), we could change our debuggers, core dumpers
and stracers to call this attach function.

The idea would be to define some shared mutex object, the inferior
waits for and the debugger releases after having attached.

Is there really any need to support non-Cygwin debuggers?


idk

I think something like that used to exist a long time ago, see commit
8abeff1ead5f3824c70111bc0ff74ff835dafa55


Yeah, just, as was the default at the time, without any trace of a
*rational* why it has been removed.  Also, it was too simple anyway.

First, if we want to support WIndows debugger, the inferior has to check
if the debugger is a Cygwin or native debugger.  If a native debugger,
just stick to what we have today.  Otherwise:

- Create a named mutex with a reproducible name (no need to use
   the name as parameter) and immediately grab it.
- Call CreateProcess to start the debugger with CREATE_SUSPENDED
   flag.
- Create a HANDLE array with the mutex and the process HANDLE.


 On second thought, it might be a good idea to make this
 interruptible as well, but given this is called from the
 exception handler this may have weird results...
  

- Call ResumeThread on the primary debugger thread.
- Call WFMO with timeout.

Later on, the debugger either fails and exits or it calls
ReleaseMutex after having attached to the process.

- WFMO returns
- If the mutex has triggered, we're being debugged (but check
   IsDebuggerPresent() just to be sure)
- If the process has triggered, the debugger exited
- If the timeout triggers... oh well.


This seems like quite a lot of work, for very marginal benefit.

And doing lots of complex work inside the process when we're in the 
middle of handling a SEGV seems like asking for trouble.


I think I'll leave this alone for the moment, and we can see what (if 
any) problems surface.




Re: SSH public key (hope format isn't broken this time)

2024-01-27 Thread Jon Turney via Cygwin-apps

On 25/01/2024 19:13, Ihor via Cygwin-apps wrote:

Name: Ihor D
 BEGIN SSH2 PUBLIC KEY 
E2VjZHNhLXNoYTItbmlzdHA1MjEIbmlzdHA1MjEAAACFBABxhfjVjvtfyhDDtJ
D6Zd6J2QP729k61Ythm6HKcUQ0ghJrAl7PhTfHU9iA+6YyE/b8ulkRNxJ3wPj05UYsucrH
QAAY2ak1vc4jihRBaLE81V66Id41dBoOhy4asJROSkwXUqHC2mT03FQKiui52RkJ56O1II
ivoZtprhEPaSX2l5MbVQ==
 END SSH2 PUBLIC KEY 



Name: Ihor D
Email: Ihor D 
Creating ssh key for Ihor D
Fingerprint: 521 SHA256:PWfheXI521DT+ixbIkVr9IXGS7P/ECcJNR/v1vVPjQ8 no comment 
(ECDSA)


Done. Thanks.


Re: [ITP] pigz 2.8

2024-01-27 Thread Jon Turney via Cygwin-apps

On 26/01/2024 21:02, Ihor via Cygwin-apps wrote:

Hi Marco, Achim,

Thank you for your time, the suggestions and fixes.

Yes, looks like everything works fine with your changes.
Also, as I understand, line `# REQUIRES="zlib"` can be removed?


As Marco points out, this was never correct or needed, as the dependency 
is on the zlib0 package, which is automatically detected.



I'm attaching here latest pigz.cygport with your fixes and without  `# 
REQUIRES="zlib"` line.


This looks good. I added this to your authorized packages.



Re: /usr/bin/fallocate missing in Cygwin 3.5's "util-linux" ...

2024-01-27 Thread Mark Geisert via Cygwin

On 1/26/2024 11:26 PM, ASSI via Cygwin wrote:

Mark Geisert via Cygwin writes:

A new build of the util-linux package, 2.33.1-3, now includes
fallocate and its man page.  The updated package is now making its way
to the Cygwin mirrors.  fallocate requires Cygwin version >= 3.5.0.


It also doesn't work at all on Cygwin 3.4.x and 3.5 isn't yet released,
so please add a dependency for cygwin(>= 3.5) to the hints file.


Done. I guess you answered my unasked question of how to limit one 
executable of a package to specific Cygwin version(s): you don't. You 
limit the whole package instead?

Thanks & Regards,

..mark


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


Updated: tesseract-ocr-5.3.4-1

2024-01-27 Thread Marco Atzeri via Cygwin-announce

Version 5.3.4-1 of packages

   libtesseract-ocr_5
   tesseract-ocr
   tesseract-ocr-devel
   tesseract-training-util

are available in the Cygwin distribution:

Other language specific data are available upstream
  https://github.com/tesseract-ocr/tessdata/

while training data for building new language data are in
  https://github.com/tesseract-ocr/langdata


CHANGES
Upstream last release
https://github.com/tesseract-ocr/tesseract/releases


DESCRIPTION
Tesseract is probably the most accurate open source OCR engine
available. Combined with the Leptonica Image Processing Library
it can read a wide variety of image formats and convert them to
text in over 60 languages. It was one of the top 3 engines in
the 1995 UNLV Accuracy test.
Improved extensively by Google.
It is released under the Apache License 2.0.


HOMEPAGE
https://github.com/tesseract-ocr/


Marco Atzeri

If you have questions or comments, please send them to the
cygwin mailing list at: cygwin (at) cygwin (dot) com .

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

The easiest way to unsubscribe is to visit 
, and click 'Unsubscribe'.

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



Re: cygwin 3.4.10-1

2024-01-27 Thread Marco Atzeri via Cygwin-apps

On 29/11/2023 15:08, Corinna Vinschen via Cygwin-announce wrote:

The following packages have been uploaded to the Cygwin distribution:

* cygwin-3.4.10-1
* cygwin-devel-3.4.10-1
* cygwin-doc-3.4.10-1



just for me or the cygwin server still states 3.4.9 as last version ?




Re: Overlay server instructions

2024-01-27 Thread Marco Atzeri via Cygwin-apps

On 26/01/2024 23:04, Ihor via Cygwin-apps wrote:

Hi!

While I was trying to test how fine my package is installed and works, I relied on instructions at 
https://www.cygwin.com/package-server.html. Specifically on "Creating an overlay Cygwin 
package server" section, as it looked like the fastest way to test everything for me. But it 
was a bit complicated to follow all instructions correctly from the first attempt as some things 
there depend on environment setup and there where cross-references inside the guide. So, I've 
written alternative straightforward instruction for "Overlay method":

---
- Install packages: calm, php

- `cd` to directory where you want to build overlay server

- Run:
mkdir -p ./cygwin/{x86_64,x86,noarch}/release

- Copy your built package folder (e.g: pigz-2.8-1.x86_64\dist\pigz) to 
./cygwin/x86_64/release folder

- Run:
mksetupini --arch x86_64 --disable-check 
missing-required-package,missing-depended-package 
--inifile=./cygwin/x86_64/setup.ini --releasearea=./cygwin
cat ./cygwin/x86_64/setup.ini | bzip2 > ./cygwin/x86_64/setup.bz2
cat ./cygwin/x86_64/setup.ini | xz -6e > ./cygwin/x86_64/setup.xz
(Make sure ./cygwin/x86_64/setup.ini contains information about your package)

- Start http server in current dir:
php -S 0.0.0.0:1234


Hi Ihor,
this is superflous.
You can install from local "fake" download

I am using a shortcut to run setup from the local cache directory where 
both the main Mirror and my own tree is located


C:\Download\cygwin_cache\setup-x86_64.exe -X  -O -s 
https://mirrors.kernel.org/sourceware/cygwin/ -s 
http://matzeri.altervista.org -R C:\cygwin64 -n -L --local-package-dir 
C:\download\cygwin_cache



- Run normal cygwin installer (with -X flag), select there TWO mirrors:
- http://127.0.0.1:1234/cygwin
- Another your favorite mirror

- Install your package and try how it works

---
It's also attached to this Email.

Maybe there is sense to replace content of "Creating an overlay Cygwin package 
server" section by this manual? Am I writing this Email to correct mailing list?


we always appreciate any improvement to the documentation


Best regards,
Ihor


Regards
Marco



Re: [ITP] pigz 2.8

2024-01-27 Thread Marco Atzeri via Cygwin-apps

On 26/01/2024 22:02, pigz-cygwin-maintainer-0...@pm.me wrote:

Hi Marco, Achim,

Thank you for your time, the suggestions and fixes.

Yes, looks like everything works fine with your changes.
Also, as I understand, line `# REQUIRES="zlib"` can be removed?


you need to use REQUIRES is cygport "fails" to detect an application 
requirement


$ cygport pigz.cygport deps | cat
cygwin-3.4.10-1
zlib0-1.3-1

so cygport detects a library dependency to "/usr/bin/cygz.dll"
not to package zlib, as zlib is the source package or
as binary contains only the library manual

$ cygcheck -l zlib
/usr/share/doc/zlib/ChangeLog
/usr/share/doc/zlib/FAQ
/usr/share/doc/zlib/LICENSE
/usr/share/doc/zlib/README
/usr/share/man/man3/zlib.3.gz



I'm attaching here latest pigz.cygport with your fixes and without  `# 
REQUIRES="zlib"` line.

Best regards,
Ihor



Regards
Marco