[issue29877] compileall hangs when accessing urandom even if number of workers is 1

2018-11-23 Thread INADA Naoki


Change by INADA Naoki :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29877] compileall hangs when accessing urandom even if number of workers is 1

2018-11-23 Thread miss-islington


miss-islington  added the comment:


New changeset 879f5f3d9c1f5b66e2a080c712e2323e9c03d558 by Miss Islington (bot) 
in branch '3.6':
bpo-29877: compileall: import ProcessPoolExecutor only when needed (GH-4856)
https://github.com/python/cpython/commit/879f5f3d9c1f5b66e2a080c712e2323e9c03d558


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29877] compileall hangs when accessing urandom even if number of workers is 1

2018-11-23 Thread miss-islington


miss-islington  added the comment:


New changeset 903a3e8d67b61594c0fa17fb201769ca924b38f8 by Miss Islington (bot) 
in branch '3.7':
bpo-29877: compileall: import ProcessPoolExecutor only when needed (GH-4856)
https://github.com/python/cpython/commit/903a3e8d67b61594c0fa17fb201769ca924b38f8


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29877] compileall hangs when accessing urandom even if number of workers is 1

2018-11-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9939

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29877] compileall hangs when accessing urandom even if number of workers is 1

2018-11-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9938

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29877] compileall hangs when accessing urandom even if number of workers is 1

2018-11-23 Thread miss-islington


miss-islington  added the comment:


New changeset 1d817e4c8259f49602eefe9729743f6d9d748e8d by Miss Islington (bot) 
(Dustin Spicuzza) in branch 'master':
bpo-29877: compileall: import ProcessPoolExecutor only when needed (GH-4856)
https://github.com/python/cpython/commit/1d817e4c8259f49602eefe9729743f6d9d748e8d


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29877] compileall hangs when accessing urandom even if number of workers is 1

2018-11-22 Thread INADA Naoki


INADA Naoki  added the comment:

I am not sure PR 4856 is enhancement or bugfix.
But I think it's worth enough to backport to 3.6 and 3.7.
It caused a real UX problem.

--
nosy: +inada.naoki

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29877] compileall hangs when accessing urandom even if number of workers is 1

2017-12-22 Thread Dustin Spicuzza

Dustin Spicuzza  added the comment:

Finally got around to looking at this.

# cat /proc/sys/kernel/random/entropy_avail 
183

.. ran python3 -c 'import os; os.getrandom(1, flags=os.GRND_NONBLOCK)' a few 
times, but didn't run into a hang. Seems like the entropy_avail is staying at 
about the same level?

It's worth noting that I ran into this error with last year's firmware image, 
and I haven't actually tested this year's firmware image for this particular 
issue... just that I had it on my TODO list to fix for this year. :)

I think it's still a good change to make regardless.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29877] compileall hangs when accessing urandom even if number of workers is 1

2017-12-19 Thread STINNER Victor

STINNER Victor  added the comment:

In kernel logs (look at dmesg), I found two messages:

vstinner@apu$ journalctl -k|grep random
déc. 14 23:10:28 apu kernel: random: fast init done
déc. 14 23:10:32 apu kernel: random: crng init done

Sadly, I don't know which one means that urandom is initialized.

See also https://wiki.archlinux.org/index.php/Random_number_generation

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29877] compileall hangs when accessing urandom even if number of workers is 1

2017-12-19 Thread Dustin Spicuzza

Dustin Spicuzza  added the comment:

I'm sure that the platform (a RT linux customized by National Instruments) has 
issues related to urandom, as this has reared it's ugly head with other PEP 525 
related issues also: https://bugs.python.org/issue29208

I'll have to try those suggestions to investigate the os.urandom issue.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29877] compileall hangs when accessing urandom even if number of workers is 1

2017-12-19 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Le 19/12/2017 à 15:50, STINNER Victor a écrit :
> 
> Hum, it looks like an "embedded device", likely with no entropy source.

If it does I/O (which it probably does, being used for robotics), it
should certainly be able to extract entropy from the outside world.

If it doesn't, it's an OS implementation issue.

Of course it probably doesn't hurt to import concurrent.futures lazily.
However, people should generally not expect us to never call urandom()
when importing stdlib modules.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29877] compileall hangs when accessing urandom even if number of workers is 1

2017-12-19 Thread STINNER Victor

STINNER Victor  added the comment:

> Found on Python 3.6 on a low-resource platform (NI RoboRIO), ...

Hum, it looks like an "embedded device", likely with no entropy source.

To check if os.urandom() will block, try to call the following function in your 
main script:

>>> import os; os.getrandom(1, flags=os.GRND_NONBLOCK)
b'\xd1'

os.urandom() blocks at system startup until the entropy pool is initialized 
with 128 bytes of entropy. Once it's initialized, os.urandom() will never block 
again.

You may also check the number of entropy bytes available to /dev/random (Python 
uses /dev/urandom which is different):

$ cat /proc/sys/kernel/random/entropy_avail 
3748

For a longer explanation, see the PEP 524.

--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29877] compileall hangs when accessing urandom even if number of workers is 1

2017-12-19 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

So calling urandom() hangs on your device because there's not enough entropy?  
What OS is this running?  Modern Linux, at least, should never block in 
urandom() (AFAIK).

--
nosy: +christian.heimes, pitrou
type: behavior -> resource usage
versions: +Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29877] compileall hangs when accessing urandom even if number of workers is 1

2017-12-13 Thread Dustin Spicuzza

Change by Dustin Spicuzza :


--
keywords: +patch
pull_requests: +4745
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29877] compileall hangs when accessing urandom even if number of workers is 1

2017-05-14 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +Claudiu.Popa, brett.cannon

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29877] compileall hangs when accessing urandom even if number of workers is 1

2017-03-22 Thread Dustin Spicuzza

Changes by Dustin Spicuzza :


--
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29877] compileall hangs when accessing urandom even if number of workers is 1

2017-03-21 Thread Dustin Spicuzza

Changes by Dustin Spicuzza :


--
title: compileall fails with urandom error even if number of workers is 1 -> 
compileall hangs when accessing urandom even if number of workers is 1

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com