Charles-François Natali added the comment:
To reproduce the issue, try this:
# echo > /proc/sys/kernel/hostname
> the locale encoding + surrogateescape error handler
Sounds reasonable.
--
nosy: +neologix
___
Python tracker
<http://bugs.p
Changes by Charles-François Natali :
--
nosy: +haypo
___
Python tracker
<http://bugs.python.org/issue17683>
___
___
Python-bugs-list mailing list
Unsubscribe:
Charles-François Natali added the comment:
Why open this issue, since it's obviously a duplicate of #18109?
--
nosy: +neologix
___
Python tracker
<http://bugs.python.org/is
Charles-François Natali added the comment:
I'm not convinced it's really useful.
Furthermore, the complexity is rather bad: if T is the average number
of waiting threads, an C the number of conditions being waited on, the
wait is O(C) (appending to C wait queues) and wakeup is O(CT)
Charles-François Natali added the comment:
> Which just means that waiting on C conditions is C times more expensive than
> waiting on 1 currently is. That seems reasonable enough to me, and anyway,
> I would expect C to be fairly small.
Waking up a single thread (through not
Charles-François Natali added the comment:
I don't like the idea of adding such a kludge to workaround an OS bug -
especially since Solaris 9 won't be supported for too long.
--
nosy: +neologix
___
Python tracker
<http://bu
Charles-François Natali added the comment:
I still fail to understand why you just don't ditch the Python implementation.
--
___
Python tracker
<http://bugs.python.org/is
Changes by Charles-François Natali :
--
resolution: -> fixed
stage: patch review -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Charles-François Natali added the comment:
Well, tstate is freed, but is not used afterwards, it's just comparing the
pointer against the TLS.
--
nosy: +neologix
___
Python tracker
<http://bugs.python.org/is
Charles-François Natali added the comment:
> I think it's unsafe. The address of a pointer should not be used once the
> pointer has been freed.
Dereferencing a freed pointer is unsafe. A pointer is just an address,
there's nothing inherently unsafe with comparing a pointer w
Changes by Charles-François Natali :
--
assignee: -> neologix
___
Python tracker
<http://bugs.python.org/issue11185>
___
___
Python-bugs-list mailing list
Un
Charles-François Natali added the comment:
> I think the safest solution is not to compare scope_id when comparing
> addresses.
Agreed.
However, it might be simpler to special-case the IPv6 addresses
comparison by overriding it in the IPv6 sendmsg base test.
Could you try the patch at
Charles-François Natali added the comment:
Fixed, thanks!
--
resolution: -> fixed
stage: -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Charles-François Natali added the comment:
This is just a special-case of the more general problem of forking() in a
multi-threaded program (see #16500 and #6721).
Since fork() can occur at any time, even though your data structures are
protected by locks, they can end up in an inconsistent
Charles-François Natali added the comment:
> If you want a consistent reproducible test case for this I believe you will
> need to replace the Thread object's __started with a test wrapper who's set()
> method blocks waiting for for the fork to have happened before doin
Charles-François Natali added the comment:
Victor, how about adding pyfailmalloc to the main repo (maybe under Tools),
with a script making it easy to run the tests suite with it enabled?
This way, it'll make it easier to run it from time to time (one could eve
imagine making it part o
Charles-François Natali added the comment:
> Bump.
Did you see my review at http://bugs.python.org/review/18418/#ps8668 ?
--
___
Python tracker
<http://bugs.python.org/issu
Charles-François Natali added the comment:
The warning is due to the Py_ADDRESS_IN_RANGE() macro: it's a know limitation,
we have the same problem with valgrind.
This would be a nice neature. It would IMO be even nicer to have an
ASAN-enabled buildbot.
--
nosy: +neo
Charles-François Natali added the comment:
Is there a hope to get this fixed?
It can be needed to e.g. run python as nobody user (used for example for CGI
scripts, etc).
--
___
Python tracker
<http://bugs.python.org/issue10
Charles-François Natali added the comment:
Marking #10496 as a dependency (since it could prevent Python from running
with low level privileges).
--
dependencies: +Python startup should not require passwd entry
___
Python tracker
<h
Charles-François Natali added the comment:
I've posted another review (not sure you receive notifications).
--
___
Python tracker
<http://bugs.python.org/is
Changes by Charles-François Natali :
--
keywords: +needs review
___
Python tracker
<http://bugs.python.org/issue10496>
___
___
Python-bugs-list mailing list
Unsub
Changes by Charles-François Natali :
--
status: open -> pending
___
Python tracker
<http://bugs.python.org/issue1611154>
___
___
Python-bugs-list mai
Charles-François Natali added the comment:
Time to close this one, since the PEP has been superseeded by PEP 446?
--
___
Python tracker
<http://bugs.python.org/issue17
Changes by Charles-François Natali :
--
status: pending -> closed
___
Python tracker
<http://bugs.python.org/issue11757>
___
___
Python-bugs-list mai
Charles-François Natali added the comment:
OK, let's close then.
We can still re-open if this pops up again.
--
status: pending -> closed
___
Python tracker
<http://bugs.python.org
Charles-François Natali added the comment:
I changed my mind, and think we should keep the current behavior: it guarantees
resize() won't break, and doesn't cost much. One extra FD per mmap is not a
huge hit. If that's a problem, then the user can raise th
Changes by Charles-François Natali :
--
status: open -> pending
___
Python tracker
<http://bugs.python.org/issue12588>
___
___
Python-bugs-list mailing list
Un
Charles-François Natali added the comment:
So, what now?
--
___
Python tracker
<http://bugs.python.org/issue16038>
___
___
Python-bugs-list mailing list
Unsub
Charles-François Natali added the comment:
Should be fixed now.
Thanks for the report, and sorry for the delay!
--
resolution: -> fixed
stage: -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Changes by Charles-François Natali :
--
resolution: -> rejected
stage: -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Charles-François Natali added the comment:
Here's a patch, based on the version in tulip's repo.
I've added doc update and tests.
I also made the following changes:
- BaseSelector is an abstract base class (so one could imagine user code
implementing its own select
Charles-François Natali added the comment:
Version addressing Antoine and Christian's comments.
--
Added file: http://bugs.python.org/file31133/selector-12.diff
___
Python tracker
<http://bugs.python.org/is
Charles-François Natali added the comment:
> Guido van Rossum added the comment:
> Can you try again with the failing assert replaced with this?
>
> self.assertTrue(0.018 <= t2-t0 <= 0.028, t2-t0)
>
> That should be a better way to check that code works.
I'm
Charles-François Natali added the comment:
> This can only be raised (above the hard limit) by a privileged
> process, so I would be out of luck there, as I could not convince
> my sysadmins to raise this further.
We all know that feeling :-)
> Meanwhile, I will just use my own mod
Charles-François Natali added the comment:
The problem is that the test passes a DNS address to connect(), which means
that it has to perform a name resolution first.
And since there's not timeout on gethostbyname()/getaddrinfo() you can end up
well above the timeout.
The hostnames shou
Charles-François Natali added the comment:
And here's a patch.
--
keywords: +patch
Added file: http://bugs.python.org/file31137/connect_timeout.diff
___
Python tracker
<http://bugs.python.org/issue16463>
New submission from Charles-François Natali:
socketpair() is quite useful, notably for tests.
Currently, it's not defined on Windows.
Since it's rather easy to implement, it would be nice to have it, if not in the
stdlib, at least in test.support.
--
components: Library (Lib
Charles-François Natali added the comment:
Unless anyone objects, I'll backport it soonish.
--
stage: -> commit review
___
Python tracker
<http://bugs.python.org
Changes by Charles-François Natali :
--
keywords: +easy, needs review
stage: -> patch review
type: -> enhancement
versions: +Python 3.4 -Python 3.3
___
Python tracker
<http://bugs.python.org/i
Charles-François Natali added the comment:
The test shouldn't pass 4096 as nbytes: apparently, recent FreeBSD kernels
zero-fill.
--
nosy: +neologix
___
Python tracker
<http://bugs.python.org/is
Charles-François Natali added the comment:
> Charles-Francois: why did you commit this to default only, and not
> to 3.3?
I overlooked it (apparently, the issue was tagged 3.4 only, and I didn't
double-check that the code was present in 3.3 as well).
Should be better now!
Charles-François Natali added the comment:
> FWIW, I don't support adding this functionality. I don't see precedents for
> Condition Variables behaving this way in other languages. Also, I don't
> think it is worth the added complexity, learning curve, and maintena
Charles-François Natali added the comment:
I've just had a quick look at the patch, but from what I can see,
socket.getaddrinfo() will return a raw integer for the family, and not an
AddressFamily instance. That's unfortunate.
--
___
Pyth
Charles-François Natali added the comment:
I was thinking about dropping the C wrapper from socketmodule.c, and
replacing it with a pure Python implementation (e.g. the one posted by
Richard on python-dev).
What do you think?
--
___
Python tracker
Charles-François Natali added the comment:
Here's an updated patch using the lru_cache decorator.
--
Added file: http://bugs.python.org/file31312/connect_timeout-1.diff
___
Python tracker
<http://bugs.python.org/is
Charles-François Natali added the comment:
Unfortunately, there's not much we can do about it: if dlsym() fails - which is
the case here either because read() fails with EBADF, or because the file
descriptor now points to another stream (i.e. not libgcc), the libc aborts
(here
Charles-François Natali added the comment:
> Perhaps the only thing we could do would be try to "preload" libgcc by
> calling one of those APIs at startup?
Yeah, I was thinking about doing this in PyThread_init_thread() but...
> But I'm not sure it's a good
Charles-François Natali added the comment:
>> If os.urandom() doesn't fail, something else will fail soon after.
>
> the random pool can be exhausted, but this is not "soon after" I think. In
> Linux and Mac OS X, ulimit -n defaults to 512 and 256.
I don't
Charles-François Natali added the comment:
2013/8/16, Tarek Ziadé :
> I use greenlets. But, I don't know - are you suggesting os.urandom() should
> be marked in the documentation as "DOES NOT SCALE" and I should use another
> API ? Which one ?
Well, even with greenlets,
Charles-François Natali added the comment:
> I do many calls on urandom() so that's the FD bottleneck.
>
>> So os.urandom() isn't your biggest problem here.
>
> Of course it is. But it looks like you know better without having looked at
> the code. :)
So please
Charles-François Natali added the comment:
>> Why locking? /dev/urandom is a pseudo char device. You can have multiple
>> readers on the same fd without any locking.
>
> You must put a lock around the open() call, though, to avoid calling it
> several times and losing an fd.
Charles-François Natali added the comment:
> In the light of the recent Android issue with PRNGs [1] I don't think
> that Python should roll out its own CPRNG. I'd rather use the operation
> system's CPRNG or OpenSSL's CPRNG. After all we aren't crypto expert
Charles-François Natali added the comment:
> Attaching a patch to make error reporting better.
Why didn't you include ENODEV?
Apparently it can be reported in some corner cases, e.g. in this patch:
http://lfs-matrix.net/patches/downloads/linux/linux-2.6.14.2-pseudo_random-1.patch
O
Changes by Charles-François Natali :
Added file: http://bugs.python.org/file31320/connect_timeout-2.diff
___
Python tracker
<http://bugs.python.org/issue16463>
___
___
Charles-François Natali added the comment:
> Updated error handling patch testing for ENODEV.
LGTM, you can apply to 2.7 and 3.x (I just hope all those errnos are
available on every POSIX platform ;-).
--
___
Python tracker
<http://bugs.pyth
Charles-François Natali added the comment:
> The attached patch fixes it in a similar vein to what was done for the
> family accessor: getaddrinfo is overridden in Python and does the necessary
> conversion.
Am I the only one thinking that wrapping every C function with a
Python count
New submission from Charles-François Natali:
Currently, when passed close_fds=True, the subprocess module closes FDs before
calling preexec_fn (if provided). This can be an issue if preexec_fn opens some
file descriptors, which would then be inherited in the child process.
Here's a patch
Charles-François Natali added the comment:
Should be fixed now!
--
resolution: -> fixed
stage: commit review -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Charles-François Natali added the comment:
2013/8/17 Christian Heimes :
> Here is a patch that is based on Apache's mod_ssl code. mod_ssl perturbs the
> PRNG state more often but I think that's overkill for Python.
>
> The new patch only affects the PRNG state of th
Charles-François Natali added the comment:
With patch :)
--
Added file: http://bugs.python.org/file31342/subprocess_close.diff
___
Python tracker
<http://bugs.python.org/issue18763>
___diff -r 5d4fe1da2c
Charles-François Natali added the comment:
> On Linux, you can try to set the LD_PRELOAD environment variable as a
> workaround.
>
> LD_PRELOAD=libgcc_s.so.1 python bug.py
>
> You may need to specify the full path.
I don't think that'll work.
Despite its name, usi
Changes by Charles-François Natali :
--
stage: -> patch review
___
Python tracker
<http://bugs.python.org/issue18418>
___
___
Python-bugs-list mailing list
Un
Charles-François Natali added the comment:
Just to be explicit (there are typos in Victor's original messages): it's about
select.devpoll, for Solaris-derivatives with /dev/poll, and not for
select.poll, based on poll() syscall.
--
Charles-François Natali added the comment:
> I've lost track -- who is waiting for whom? I reviewed the patch
> selector-12.diff and received zero response AFAICT. (Maybe the email from
> Rietveld didn't make it?)
I was on vacation, and then had to cope with many emails
Charles-François Natali added the comment:
> Some ftplib tests sometimes time out. Seem they seem to try to connect to
> "localhost" (rather than "127.0.0.1"), I was wondering if this could be a DNS
> issue and if we should resolve "localhost" in advanc
Charles-François Natali added the comment:
Changing support.HOST from 'localhost' to '127.0.0.1' means that on dual-stack
hosts (I don't think the test suite would run on IPv6-only hosts anyway), the
tests will now always use IPv4, whereas they are currently using eith
Charles-François Natali added the comment:
> That would only be true if the server we are contacting happens to
> listen on both IPv6 and IPv4, right? I don't think we have such a
> situation in the test suite.
Ah, I thought some code was using getaddrinfo() to select an
Charles-François Natali added the comment:
> Christian Heimes added the comment:
>
> I have taken care of Antoine's and Victor's reviews. The fix has landed in
> Python 2.7, 3.3 and 3.4. What about 2.6, 3.1 and 3.2? After all it's a
> security fix (although I
Charles-François Natali added the comment:
> Which part of the function is not async-signal safe? It doesn't interact
> with any file descriptors nor does it use any syscalls except for
> getpid() and time().
gettimeofday() and RAND_add()
The functions which are guaranteed to b
Charles-François Natali added the comment:
2013/8/21 Antoine Pitrou :
> Instead of reseeding in the child, you can perturb the state in the parent
> after fork.
> As far as I understand, only the "child" callback in pthread_atfork() needs
> to be async-signal-safe:
That
Charles-François Natali added the comment:
>> Another, probably cleaner way would be to finally add the atfork()
>> module (issue #16500), and register this reseed hook (which could then
>> be implemented in ssl.py).
>
> Wouldn't that still suffer from the doub
Charles-François Natali added the comment:
Backported to 2.7.
--
resolution: -> fixed
stage: commit review -> committed/rejected
status: open -> closed
versions: -Python 3.2
___
Python tracker
<http://bugs.python.or
Charles-François Natali added the comment:
LGTM
--
___
Python tracker
<http://bugs.python.org/issue18792>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Charles-François Natali :
--
nosy: +sbt
___
Python tracker
<http://bugs.python.org/issue18763>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Charles-François Natali :
--
resolution: -> duplicate
stage: needs patch -> committed/rejected
status: open -> closed
superseder: -> Add an 'atfork' module
___
Python tracker
<http://
Changes by Charles-François Natali :
--
title: Test -> Remove -mno-cygwin from distutils
___
Python tracker
<http://bugs.python.org/issue12641>
___
___
Python-
New submission from Charles-François Natali:
Currently, setipaddr() has this code to special-case numeric IPv4 addresses and
avoid a name resolution:
"""
if (sscanf(name, "%d.%d.%d.%d%c", &d1, &d2, &d3, &d4, &ch) == 4 &&
0 &l
Charles-François Natali added the comment:
Hum...
Apparently, before this bug was fixed, glibc's getaddrinfo() would
retrieve the list of interfaces at every call, even if AI_ADDRCONFIG
was not set:
http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=fa3fc0fe5f452d0aa7e435d8f32e9929586
Charles-François Natali added the comment:
> So it might be better to just use inet_pton() instead.
But then it won't set the scope ID if the user doesn't provide it...
--
___
Python tracker
<http://bugs.pytho
Charles-François Natali added the comment:
> STINNER Victor added the comment:
>
> PySSL_RAND_atfork_parent() still uses getpid(). This number is not
> very random in the *parent* process :-)
:-)
IMO this patch has been rushed in and should be reverted for now.
It's still not
Charles-François Natali added the comment:
>> PySSL_RAND_atfork_parent() still uses getpid(). This number is not
>> very random in the *parent* process :-)
>
> That's fine and doesn't diminish the properties of the PRNG. In fact the
> patch could use a hard coded
New submission from Charles-François Natali:
Now that the ssl module exposes RAND_bytes() (issue #12049), it might be
interesting to implement a SSLRandom generator to the random module, to have a
cryptographically strong generator without the os.urandom() overhead.
Thoughts
Charles-François Natali added the comment:
> It doesn't look like OpenSSL's PRNG is much faster than /dev/urandom if
> Python keeps a persistent fd:
>
> $ python3.3 prng.py
> loops: 100
> bytes: 16
> /dev/urandom (fd)1.2181
> os.urandom()
Charles-François Natali added the comment:
> Using self.assertLessEqual() would provide better message on error.
Done.
> You don't want to fix Python 2.7 and 3.3? It is a bug in my opinion.
Patch for 2.7 attached (without test though, because 2.7 lacks a
fd_status.py helper, which
Charles-François Natali added the comment:
Could you post your patch without the '--git' option?
Apparently it doesn't work well with the code review tool.
> It would be nice if there was a more explicit way to test the
> creation of core files, however.
One possibility
Charles-François Natali added the comment:
> I propose to add an optional keyword parameter with default value "SYNC"
> (compatibility) but that can be "ASYNC", "INVALIDATE" (can be
> "SYNC|INVALIDATE" and "ASYNC|INVALIDATE" too).
AF
Charles-François Natali added the comment:
> How about we generalize SystemRandom so users can implement
> a custom RNG class wby providing a method rng(amount) -> bytes?
The random module already makes it easy:
"""
Class Random can also be subclassed if you want
Charles-François Natali added the comment:
Here's a patch with a more robust test: the previous test worked, but assume
that only stdin, stdout and stderr FDs would be open in the child process. This
might not hold anymore in a near future (/dev/urandom persistent FD).
The new test is
Charles-François Natali added the comment:
> I don't understand why os.dup2() is more reliable than os.pipe() for a unit
> test?
I use dup2() because it allows me to specify a target FD, so the
parent can know precisely which FD was opened by the preexec hook, and
check it's clo
Charles-François Natali added the comment:
> You might also add a check:
>
> self.assertLessEqual(remaining_fds, {0, 1, 2})
Well no, because the interpreter might have other FDs open than stdin,
stdout and stderr.
--
___
Pytho
Charles-François Natali added the comment:
> Close_fds is not supposed to close them?
Yes, but some new fds might be open in the child process, e.g. for /dev/urandom.
That's why it's better to check that this precise FD is closed. Of
course, if the /dev/urandom FD gets assigned t
Charles-François Natali added the comment:
Here's a patch.
Note that I'm still not sure whether it belong to the socket module or
test.support.
--
keywords: +needs review, patch
stage: needs patch -> patch review
versions: +Python 3.4
Added file: http://bugs.python.
Charles-François Natali added the comment:
> On Linux, many tests of test_socket are failing with the pure Python
> implementation.
The only failing tests I see are due to the fact that the Python
implementation uses AF_INET instead of AF_UNIX, which is normal since
Windows doesn't h
Charles-François Natali added the comment:
Alright, I've updated the patch to have a distinct selectors module,
and with Guido's comments.
Before I post it for final review, I have three more questions:
1) In the documentation, I don't know how to best refer to files
object regis
Charles-François Natali added the comment:
> New changeset fe949918616c by Antoine Pitrou in branch 'default':
> Issue #18756: Improve error reporting in os.urandom() when the failure is due
> to something else than /dev/urandom not existing.
> http://hg.python.org/cp
Charles-François Natali added the comment:
Or more precisely, just run the test in a subprocess. That should fix
the OS X failure if we don't restore the RLIMIT_NOFILE limits, and
will make the test more robust (but you can't reuse the new test,
since it won't work wi
Charles-François Natali added the comment:
> Didn't you forget to upload it?
I wanted to have answer to my questions first :-):
> Before I post it for final review, I have three more questions:
--
___
Python tracker
<http://b
Charles-François Natali added the comment:
> self.assertEqual(sock.family, socket.AF_UNIX)
> AssertionError: 2 != 1
This is normal.
==
> FAIL: test_sendall_interrupted (test.test_socket.GeneralMo
Charles-François Natali added the comment:
The test is failing on Tiger buildbots:
"""
==
FAIL: test_parse_cert_CVE_2013_4238 (test.test_ssl.B
1201 - 1300 of 2227 matches
Mail list logo