Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-33164: blake2 fix for HP-UX #13633

Merged
merged 3 commits into from May 29, 2019
Merged

bpo-33164: blake2 fix for HP-UX #13633

merged 3 commits into from May 29, 2019

Conversation

ghost
Copy link

@ghost ghost commented May 28, 2019

Backporting fix on blake2 side too.

Fixes from @michael-o mainly.

https://bugs.python.org/issue33164

@@ -140,6 +140,9 @@ static inline void secure_zero_memory(void *v, size_t n)
{
#if defined(_WIN32) || defined(WIN32)
SecureZeroMemory(v, n);
#elif deifned(__hpux)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo, should be "defined"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch ...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is my upstream fix: BLAKE2/libb2@37062e5

configure.ac Outdated
@@ -3527,7 +3527,9 @@ AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \
getpriority getresuid getresgid getpwent getpwnam_r getpwuid_r getspnam getspent getsid getwd \
if_nameindex \
madvise mkfifoat mknod mknodat mktime mremap nice openat pathconf pause pipe2 plock poll \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What and why did you modify the configure script?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact I got the fixes from a HP-UX specialist, if it works without the better.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will remove the changes ...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change comes actually from the original PR which broke it, 51aa35e#diff-67e997bcfdac55191033d57a16d1408a too much has been removed as opposed to the configure script.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The configure.ac needs to retain:

initgroups kill killpg lchmod lchown lockf linkat lstat lutimes mmap \
memrchr mbrtowc mkdirat mkfifo \

Copy link
Contributor

@michael-o michael-o May 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the patch I have sent via email:

# diff -U 1 configure.ac.orig configure.ac
--- configure.ac.orig   2019-05-28 14:34:58 +0000
+++ configure.ac        2019-05-28 14:38:23 +0000
@@ -3526,6 +3526,8 @@
 getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \
 getpriority getresuid getresgid getpwent getpwnam_r getpwuid_r getspnam getspent getsid getwd \
 if_nameindex \
+ initgroups kill killpg lchmod lchown lockf linkat lstat lutimes mmap \
+ memrchr mbrtowc mkdirat mkfifo \
 mkfifoat mknod mknodat mktime mremap nice openat pathconf pause pipe2 plock poll \
 posix_fallocate posix_fadvise posix_spawn posix_spawnp pread preadv preadv2 \
 pthread_condattr_setclock pthread_init pthread_kill putenv pwrite pwritev pwritev2 \

Please reinstantiate otherwise all of these won't be available at compile time.

@dcarlier-afilias please readd otherwise people are back to the configure error.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry about I merged the previous PR. I thought travis checked configure script is really generated from configure.ac.

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@@ -140,6 +140,9 @@ static inline void secure_zero_memory(void *v, size_t n)
{
#if defined(_WIN32) || defined(WIN32)
SecureZeroMemory(v, n);
#elif defined(__hpux)
static void *(*const volatile memset_v)(void *, int, size_t) = &memset;
memset_v(v, 0,n);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one misses a space after the second comma

@@ -140,6 +140,9 @@ static inline void secure_zero_memory(void *v, size_t n)
{
#if defined(_WIN32) || defined(WIN32)
SecureZeroMemory(v, n);
#elif deifned(__hpux)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is my upstream fix: BLAKE2/libb2@37062e5

David Carlier added 2 commits May 28, 2019 21:15
@michael-o
Copy link
Contributor

@dcarlier-afilias looks very good now. Let me double check on the server tomorrow and then you can merge into master! Thank you very much for the quick reaction.

@methane
Copy link
Member

methane commented May 29, 2019

I will merge this after @michael-o 's check.

Copy link
Contributor

@michael-o michael-o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compiles for me on top of 0ae022c with my outstanding PR: https://github.com/python/cpython/pulls/michael-o. Would be nice if someone could take a look at them. They are trivial.

@methane methane merged commit d8b7551 into python:master May 29, 2019
@tiran
Copy link
Member

tiran commented May 29, 2019

@methane please revert the merge. The modifications to autoconf script are incorrect.

@michael-o
Copy link
Contributor

@tiran, why? It restores the configure.ac before it was broken by the blake2 upgrade + added functions.

@methane
Copy link
Member

methane commented May 29, 2019

@tiran "minimize patch manually after autoreconf" makes this type of trouble.
I created #13651 which commit all generated files by autoreconf as-is.

@tiran
Copy link
Member

tiran commented May 29, 2019

@michael-o The commit d8b7551 only changes configure.ac. CPython also has the configure script in VCS. Any change to configure.ac must also update configure.

@methane
Copy link
Member

methane commented May 29, 2019

@tiran Mismatch between configure and configure.ac was introduced by #6286.
https://github.com/python/cpython/pull/6286/files?short_path=2328065#diff-e2d5a00791bce9a01f99bc6fd613a39d

This PR resolves the mismatch. I'm sorry about merging #6286.

@methane
Copy link
Member

methane commented May 30, 2019

I re-run autoreconf and commit generated files without manual modification, except aclocal.m4 (GH-13651).

DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants