New submission from Mark Shannon ma...@dcs.gla.ac.uk:
Attached program fails.
See comments in file for details and possible diagnosis
--
files: binary_op_mimic.py
messages: 117216
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Incorrect semantics of __radd__
Mark Shannon ma...@dcs.gla.ac.uk added the comment:
Please reopen this bug as the fix is wrong.
This fix merely hides the symptoms of _PyType_Lookup returning a dead object,
by calling PyType_Modified() frequently, thus ensuring the type method cache is
almost always invalidated.
This results
Mark Shannon m...@hotpy.org added the comment:
Absolutely. subtype_dealloc deals with deallocation of subtype
*instances*, not the types themselves.
Maybe we can try and explore the reference graph again?
This sort of thing is one of the reasons that the cycle GC does not call
any
Mark Shannon m...@hotpy.org added the comment:
What's happening is that the cycle GC calls type_clear to clear the type, but
the method-cache is not invalidated.
I have added a call to PyType_Modified in type_clear (as well as type_set_name
and type_set_qualname, which also modify the type
Mark Shannon m...@hotpy.org added the comment:
Beat me to it, Antoine!
Don't forget type_set_name and type_set_qualname.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12149
Mark Shannon m...@hotpy.org added the comment:
Antoine Pitrou wrote:
Antoine Pitrou pit...@free.fr added the comment:
I have added a call to PyType_Modified in type_clear (as well as
type_set_name and type_set_qualname, which also modify the type).
Can __name__ and __qualname__ be looked
New submission from Mark Shannon m...@hotpy.org:
test_clear_dict_in_ref_cycle in test_module only works by coincidence,
if the name of the variable on line 77 is changed from 'a' to 'x', then the
test fails.
This is a result of the arbitrary ordering of removals of values from a modules
Changes by Mark Shannon m...@hotpy.org:
--
nosy: +Mark.Shannon
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13703
___
___
Python-bugs-list
Mark Shannon m...@hotpy.org added the comment:
What is the mechanism by which the attacker can determine the seeds?
The actual hash value is not directly observable externally.
The attacker can only determine the timing effects of multiple
insertions into a dict, or have I missed something
Mark Shannon m...@hotpy.org added the comment:
But that's not the issue we are supposed to be dealing with.
A single (genuinely random) seed will deal with the attack described in
the talk and it is (almost) as fast as using 0 as a seed.
Why make things complicated dealing with a hypothetical
Mark Shannon m...@hotpy.org added the comment:
I agree.
+1 for strings. -0 for numbers.
This might cause problems with dict subclasses and the like,
so I'm -1 on this.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13703
Mark Shannon m...@hotpy.org added the comment:
Without the context, that last message didn't make much sense.
I agree with Terry that we should copy Perl and Ruby (for strings).
I'm -1 on hash() returning a different value than dict uses internally
Mark Shannon m...@hotpy.org added the comment:
* the method would need to be implemented for all hashable Python types
It was already discussed, and it was said that only hash(str) need to
be modified.
Really ? What about the much simpler attack on integer hash values ?
You only have
New submission from Mark Shannon m...@hotpy.org:
The frame object has a number of fields which belong to the generator object.
By creating a CoState struct, these fields can be moved to
generator/threadstate where they belong.
The interpreter no longer has to swap around exception state
Mark Shannon m...@hotpy.org added the comment:
Amaury Forgeot d'Arc wrote:
- Why is it called CoState? is it related to coroutines?
Yes it is related to coroutines, threads and generators *are*
(a limited form of) asymmetric coroutines, even if we don't usually
think of them that way
Mark Shannon m...@hotpy.org added the comment:
Nick Coghlan wrote:
Nick Coghlan ncogh...@gmail.com added the comment:
The division of responsibilities between generator objects and the eval loop
is currently a little messy. The eval loop deals almost entirely with frame
objects and also
New submission from Mark Shannon m...@hotpy.org:
The proposed dictionary implementation allows sharing of keys hashes between
dictionaries. This leads to substantial memory savings for object-oriented
programs. For non-OO programs the impact is negligible.
--
components: Interpreter
Changes by Mark Shannon m...@hotpy.org:
Added file: http://bugs.python.org/file24360/6a21f3b35e20.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13903
Mark Shannon m...@hotpy.org added the comment:
The important part is not the change of name, but wrapping them in a
struct which can be embedded in both PyThreadState and PyGenObject.
The state-exc_XXX trio of values are the currently handled exception
(sys.exc_info()) and are shadowed
New submission from Mark Shannon m...@hotpy.org:
The function test_set_reprs() includes the comment:
Consequently, this test is fragile and implementation-dependent
Changing the dictionary iteration ordering breaks it.
--
components: Tests
messages: 152272
nosy: Mark.Shannon
priority
Mark Shannon m...@hotpy.org added the comment:
Barry A. Warsaw wrote:
Barry A. Warsaw ba...@python.org added the comment:
On Jan 28, 2012, at 07:26 PM, Dave Malcolm wrote:
This turns out to pass without PYTHONHASHRANDOMIZATION in the
environment, and fail intermittently with it.
Note
New submission from Mark Shannon m...@hotpy.org:
This only seems to apply to free variables, not local or cell variables.
The offending tests are lines 429 430 of Lib/test/test_dis.py
(tricky, code_info_tricky),
(co_tricky_nested_f, code_info_tricky_nested_f),
Changing
New submission from Mark Shannon m...@hotpy.org:
Changing PyDict_MINSIZE to 4 causes the following failure:
python -m test.test_packaging
...
Traceback (most recent call last):
File /home/mark/python/cpython/Lib/runpy.py, line 160, in
_run_module_as_main
__main__, fname, loader, pkg_name
New submission from Mark Shannon m...@hotpy.org:
Changing PyDict_MINSIZE to 4 causes the following failure
python -m test.test_trace
...
==
ERROR: test_coverage (__main__.TestCoverage
Mark Shannon m...@hotpy.org added the comment:
Does this really need a PEP?
There is no new language feature and no change to any API.
It is just saving some memory.
The only possible issue is changing dict repr() ordering,
but issue 13703 will do that anyway
Mark Shannon m...@hotpy.org added the comment:
Raymond Hettinger wrote:
Raymond Hettinger raymond.hettin...@gmail.com added the comment:
Changing dictionaries is a big deal. You're changing many pieces at once
(not a good idea) including changing tunable parameters that are well-studied
Changes by Mark Shannon m...@hotpy.org:
--
nosy: +Mark.Shannon
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16676
___
___
Python-bugs-list
New submission from Mark Shannon:
The restriction that line numbers must be monotonically increasing w.r.t
bytecode offset in the co_lnotab array prevents a number of beneficial
transformations in the bytecode compiler.
This patch allows negative line number deltas and uses this capability
Changes by Mark Shannon m...@hotpy.org:
--
keywords: +patch
Added file: http://bugs.python.org/file28718/dd04caae6647.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16956
Mark Shannon added the comment:
The interaction between bdb/pdb and the line number table is via the
frame.f_lineno attribute.
Allowing signed offsets changes the one-to-one line muber = bytecode offset
relation into a one-to-many relation.
Reading frame.f_lineno is not an issue as each
Changes by Mark Shannon m...@hotpy.org:
--
nosy: +Mark.Shannon
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17170
___
___
Python-bugs-list
Changes by Mark Shannon m...@hotpy.org:
--
nosy: +Mark.Shannon
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12370
___
___
Python-bugs-list
New submission from Mark Shannon m...@hotpy.org:
dictnotes.txt is out of date w.r.t. dictobject.c
Remove notes from dictnotes.txt that duplicate comments in dictobject.c
and ensure comments in dictobject.c cover all aspects of tunable parameters.
Patch attached.
--
assignee: docs
Mark Shannon m...@hotpy.org added the comment:
Raymond,
I don't think this is the place to discuss the changes to the tunables in
dictobject.c.
This patch merely ensures that dictnotes.txt and the comments in dictobject.c
are in agreement. It doesn't change any code (apart from creating
Mark Shannon m...@hotpy.org added the comment:
There is one call to PyGen_FetchStopIterationValue in ceval.c.
But I don't think it should be public.
There is no real reason for the Gen in the name. The function is used by
generator handling code, but the code itself relates to StopIteration
Mark Shannon m...@hotpy.org added the comment:
-1 for the reasons Nick stated.
--
nosy: +Mark.Shannon
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15003
Mark Shannon m...@hotpy.org added the comment:
Is there any reason not to commit this patch?
The docs are out of sync with the code and need to be updated.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15055
Mark Shannon m...@hotpy.org added the comment:
No apology needed :)
Thanks.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15055
___
___
Python
Mark Shannon m...@hotpy.org added the comment:
io.UnsupportedOperation.__new__(io.UnsupportedOperation)
behaves correctly now (rev d9c98730e2e8)
This bug was (I believe) caused somehow by an error in OSError_new() which did
not initialize self-args if OSError_init() was not called.
Here
Mark Shannon m...@hotpy.org added the comment:
Larry, you're the expert on this.
Looks to me like the format character in PyArg_ParseTuple in posix_fchown and
kin should be 'k' (unsigned long) rather than 'l' (signed long).
--
nosy: +Mark.Shannon, larry
type: - behavior
Mark Shannon added the comment:
I've re-reviewed Andrea's patch (I was looking over Andrea's shoulder at the
EuroPython sprint when he wrote it).
It looks good and applies cleanly.
Could someone commit it please.
--
nosy: +Mark.Shannon
___
Python
Changes by Mark Shannon m...@hotpy.org:
--
hgrepos: -109
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13903
___
___
Python-bugs-list mailing
Changes by Mark Shannon m...@hotpy.org:
--
hgrepos: +112
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13903
___
___
Python-bugs-list mailing list
Changes by Mark Shannon m...@hotpy.org:
Added file: http://bugs.python.org/file24453/a9138aba7896.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13903
Changes by Mark Shannon m...@hotpy.org:
Removed file: http://bugs.python.org/file24360/6a21f3b35e20.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13903
Changes by Mark Shannon m...@hotpy.org:
Removed file: http://bugs.python.org/file24453/a9138aba7896.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13903
Changes by Mark Shannon m...@hotpy.org:
Added file: http://bugs.python.org/file24454/1f703b2607af.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13903
Mark Shannon m...@hotpy.org added the comment:
Antoine Pitrou wrote:
Antoine Pitrou pit...@free.fr added the comment:
Looking at your latest patch, I worry about any deletion
+(including pop popitem) causes a split table to become a combined table.
Why wouldn't you use a dummy pointer
Changes by Mark Shannon m...@hotpy.org:
Removed file: http://bugs.python.org/file24454/1f703b2607af.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13903
Changes by Mark Shannon m...@hotpy.org:
Added file: http://bugs.python.org/file24455/bc286099ce9a.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13903
Changes by Mark Shannon m...@hotpy.org:
Removed file: http://bugs.python.org/file24455/bc286099ce9a.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13903
Changes by Mark Shannon m...@hotpy.org:
Added file: http://bugs.python.org/file24456/20702d1acf17.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13903
New submission from Mark Shannon m...@hotpy.org:
The f_yieldfrom field should not be visible at Python level, it is an internal
implementation detail.
Patch attached.
--
files: remove_f_yieldfrom.patch
keywords: patch
messages: 152895
nosy: Mark.Shannon
priority: normal
severity
Mark Shannon m...@hotpy.org added the comment:
Failure occurs in test_pprint which is covered by issue 13907
--
resolution: - duplicate
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13911
Changes by Mark Shannon m...@hotpy.org:
Added file: http://bugs.python.org/file24465/e50db1b7ad7b.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13903
Changes by Mark Shannon m...@hotpy.org:
Removed file: http://bugs.python.org/file24456/20702d1acf17.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13903
Mark Shannon m...@hotpy.org added the comment:
This issue was too broad. The new patch is focussed on sys.exc_info.
All hints of coroutines have been removed and f_yieldfrom is untouched.
New patch reduces code by 65 lines and does not conflict with issue 13607.
--
title: Move fields
Changes by Mark Shannon m...@hotpy.org:
Removed file: http://bugs.python.org/file24350/coro.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13897
Mark Shannon m...@hotpy.org added the comment:
Why do the codes used internally by ceval have to be the same as those made
public?
Have you considered returning the exit code directly, rather than
adding another field to frameobject?
yieldfrom can be handled in a similar way to yield
Changes by Mark Shannon m...@hotpy.org:
Added file: http://bugs.python.org/file24510/691ce331f955.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13903
Changes by Mark Shannon m...@hotpy.org:
Removed file: http://bugs.python.org/file24465/e50db1b7ad7b.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13903
Mark Shannon m...@hotpy.org added the comment:
Fixed by revisions 224ebf9d428a and 38828f0c9312
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13909
Changes by Mark Shannon m...@hotpy.org:
Added file: http://bugs.python.org/file24670/49b7e7e4a27c.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13903
Mark Shannon m...@hotpy.org added the comment:
Jim Jewett wrote:
Jim Jewett jimjjew...@gmail.com added the comment:
As of Feb 28, 2012, the PEP mentions an additional optimization of storing
the values in an array indexed by (effectively) key insertion order, rather
than key position
Mark Shannon m...@hotpy.org added the comment:
Could you run the benchamrks at http://hg.python.org/benchmarks/
and report the results, for 3.3 (rather than 2.7), please?
Adding a new bytecode because it speeds up one 4 line program does not seem
such a good idea.
--
nosy
Mark Shannon m...@hotpy.org added the comment:
I much prefer dict_lookup.patch to nomodify.patch.
It doesn't increase the memory use of dict. One extra word per dict could be a
lot of memory for a large application.
There is a very subtle semantic change, but I think it is a positive one
Mark Shannon m...@hotpy.org added the comment:
Looks good to me.
The INCREF/DECREFs are outside of the loops so will have negligible performance
impact.
--
nosy: +Mark.Shannon
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Mark Shannon m...@hotpy.org added the comment:
Jim Jewett wrote:
Jim Jewett jimjjew...@gmail.com added the comment:
Can't this be triggered by non-malicious code that just happened to have a
python comparison and get hit with a thread switch?
So, they are writing to a dict in one thread
Mark Shannon m...@hotpy.org added the comment:
Jim Jewett wrote:
http://bugs.python.org/review/13897/diff/4186/14521
File Python/sysmodule.c (right):
http://bugs.python.org/review/13897/diff/4186/14521#newcode211
Python/sysmodule.c:211: while ((exc_info-exc_type == NULL ||
exc_info
New submission from Mark Shannon m...@hotpy.org:
Delegating generators do not show always up in stack traces, such as
inspect.stack().
The show up during the first delegation, but not thereafter.
I have attached a patch. It alters the way the YIELD_FROM bytecode works; it
loops back on itself
Mark Shannon m...@hotpy.org added the comment:
I've just added issue 14230 which overlaps with this issue somewhat.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14220
Mark Shannon m...@hotpy.org added the comment:
Unmodified CPython (without the patch) already passes the new test in the patch.
The unmodified code already raises a Runtime error; a recursion limit exceeded
error!
--
___
Python tracker rep
New submission from Mark Shannon m...@hotpy.org:
I get the following compiler warning (rev 2a142141e5fd)
Its not strictly an error, but an unitialised variable in such an
important function is dangerous.
Objects/object.c: In function ‘_PyObject_GenericSetAttrWithDict’:
Objects/object.c:1144
Changes by Mark Shannon m...@hotpy.org:
Added file: http://bugs.python.org/file24766/257e16e71654.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13903
New submission from Mark Shannon m...@hotpy.org:
io.UnsupportedOperation.__new__(io.UnsupportedOperation)
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: ValueError.__new__(UnsupportedOperation) is not safe, use
OSError.__new__()
Looking at the mro
Mark Shannon m...@hotpy.org added the comment:
STINNER Victor wrote:
STINNER Victor victor.stin...@gmail.com added the comment:
Guido Given all this I think we should keep it as you have committed
Guido and add it to the docs and whatsnew.
I updated What's New in Python 3.3 document. I
Mark Shannon m...@hotpy.org added the comment:
Review of set-with-Set.patch:
Looks good overall.
I agree that restricting operations to instances of Set rather than Iterable is
correct.
Implementing __rsub__ in terms of - (subtraction) means that infinite
recursion is a possibility. It also
Mark Shannon m...@hotpy.org added the comment:
Updated Patch
--
Added file: http://bugs.python.org/file24870/yieldfrom.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14230
Changes by Mark Shannon m...@hotpy.org:
Removed file: http://bugs.python.org/file24759/yieldfrom.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14230
Mark Shannon m...@hotpy.org added the comment:
Could you try this new patch (with white space changes included)?
--
Added file: http://bugs.python.org/file24872/yieldfrom.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Mark Shannon m...@hotpy.org added the comment:
The magic number has not been updated
Patch attached.
--
Added file: http://bugs.python.org/file24889/magic.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14230
Changes by Mark Shannon m...@hotpy.org:
Added file: http://bugs.python.org/file25096/372d0bca85ae.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13903
Mark Shannon m...@hotpy.org added the comment:
I'm not bothered by the regression in silent_logging,
as it is a micro benchmark with a very short running time.
The regression in mako is, I think, caused by competition for the
data cache between the new dict implementation and the method-cache
Mark Shannon m...@hotpy.org added the comment:
Antoine Pitrou wrote:
Antoine Pitrou pit...@free.fr added the comment:
I'm not bothered by the regression in silent_logging,
as it is a micro benchmark with a very short running time.
I'm not concerned about the micro-benchmark itself
Mark Shannon m...@hotpy.org added the comment:
How about changing the method-cache size in a separate patch?
On my machine, reducing the method-cache size from 2**10 to 2**9 results
in a very small improvement in performance (with the original dict).
That way we don't get a performance
Mark Shannon m...@hotpy.org added the comment:
3rd party code should not be accessing fields in the threadstate object,
but without the accessors proposed in issue 14098 there may be no alternative.
Once the patch for issue 14098 has been applied it, would it then be acceptable
to remove
Mark Shannon m...@hotpy.org added the comment:
Rather than ensuring that f_tstate always points to the current frame,
just remove it altogether.
Patch attached
--
nosy: +Mark.Shannon
Added file: http://bugs.python.org/file25176/remove_f_tstate.patch
Mark Shannon m...@hotpy.org added the comment:
According to PEP 384 (Defining a Stable ABI) the thread state object is opaque,
so we should be free to add or remove fields.
Nevertheless, I have added a new patch that simply moves the f_exc... fields
from the frame object to the generator
Mark Shannon m...@hotpy.org added the comment:
I don't really understand your objection to changing the method-cache size. As
I said, I can remove the change, but that will cause the performance regression
that Antoine noticed.
--
___
Python
Changes by Mark Shannon m...@hotpy.org:
Added file: http://bugs.python.org/file25313/73423916a242.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13903
Mark Shannon m...@hotpy.org added the comment:
I've updated the repository and uploaded a new patch in response to Benjamin's
review. (And the contributor form is in the post).
One remaining issue is the return value of __sizeof__().
If it is an int, then it cannot accurately reflect
Mark Shannon m...@hotpy.org added the comment:
I fixed it back then, but didn't add the test.
It subsequently regressed.
Should know better.
Patch (with test this time) attached.
--
resolution: fixed -
status: closed - open
Added file: http://bugs.python.org/file25318
Mark Shannon m...@hotpy.org added the comment:
Failing to maintain GC tracking in setdefault and copy (for split-tables)
Patch attached
--
Added file: http://bugs.python.org/file25339/gc_tracking.patch
___
Python tracker rep...@bugs.python.org
http
Changes by Mark Shannon m...@hotpy.org:
--
nosy: +Mark.Shannon
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14658
___
___
Python-bugs-list
Mark Shannon m...@hotpy.org added the comment:
Failed to differentiate between failure and error in make_split_table().
Patch attached
--
Added file: http://bugs.python.org/file25340/make_split_table_error.patch
___
Python tracker rep
Mark Shannon m...@hotpy.org added the comment:
Decref cached-keys when type is deallocated.
Patch attached.
--
Added file: http://bugs.python.org/file25381/cached_keys.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13903
Mark Shannon m...@hotpy.org added the comment:
Change insertdict to follow normal (non-stealing) ref-counting behaviour which
fixes possible leakage.
Patch attached.
--
Added file: http://bugs.python.org/file25422/insertdict.patch
___
Python
New submission from Mark Shannon m...@hotpy.org:
classmethod_descriptor should either be uncallable or (better) accept the
correct number of arguments.
The classmethod_descriptor can be regarded as the Python object corresponding
directly to the underlying C function, as well as a descriptor
Mark Shannon m...@hotpy.org added the comment:
New patch in response to review.
--
Added file: http://bugs.python.org/file25431/classmethoddescr_call.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14699
Mark Shannon m...@hotpy.org added the comment:
python-gdb.py was modified for the new dictionary implementation.
Can you check that your 3.3 installation isn't using an earlier version of
python-gdb.py?
--
nosy: +Mark.Shannon
___
Python tracker rep
1 - 100 of 1194 matches
Mail list logo