This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2011年05月01日 18:26 by DragonSA, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| patch-Modules-selectmodule.c | DragonSA, 2011年05月01日 18:26 | |||
| test_kqueue.py.diff | DragonSA, 2014年03月10日 15:28 | |||
| test_kqueue.py.diff | DragonSA, 2014年03月10日 15:28 | |||
| test_kqueue.py.diff | DragonSA, 2014年03月10日 15:28 | |||
| test_kqueue.py.diff | DragonSA, 2014年03月10日 15:28 | |||
| test_kqueue.py.diff | DragonSA, 2014年03月10日 15:28 | |||
| test_kqueue.py.diff | DragonSA, 2014年03月10日 15:28 | |||
| Messages (12) | |||
|---|---|---|---|
| msg134918 - (view) | Author: David Naylor (DragonSA) * | Date: 2011年05月01日 18:26 | |
kevent does not accept all legitimate parameters, such as KQ_NOTE_EXIT.
For example:
>> from select import *
>> kevent(0, KQ_FILTER_PROC, KQ_EV_ADD | KQ_EV_ENABLE, KQ_NOTE_EXIT)
OverflowError: signed integer is greater than maximum
While the following C code compiles (under -Wall -pedantic) without error, or warning:
"""
#include <sys/types.h>
#include <sys/event.h>
#include <sys/time.h>
int main(int argc, char **argv) {
struct kevent ke;
EV_SET(&ke, 0, EVFILT_PROC, EV_ADD | EV_ENABLE, NOTE_EXIT, 0, 0);
return (0);
}
"""
Looking at the Modules/selectmodule.c file it is clear that the fields "flags" and "fflags" are defined as T_USHORT and T_UINT however the flags passed to PyArg_ParseTupleAndKeywords are 'h' and 'i' respectively (implying signed numbers).
A workaround exists where values X > (2**31 - 1) are passed as (X - 2**32). Also the attached patch fixes the error.
|
|||
| msg196124 - (view) | Author: Christian Heimes (christian.heimes) * (Python committer) | Date: 2013年08月25日 12:48 | |
The patch looks good to me. |
|||
| msg196127 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2013年08月25日 12:58 | |
New changeset d5334d8907dc by Christian Heimes in branch '3.3': Issue #11973: Fix a problem in kevent. The flags and fflags fields are now http://hg.python.org/cpython/rev/d5334d8907dc New changeset 8345fb616cbd by Christian Heimes in branch 'default': Issue #11973: Fix a problem in kevent. The flags and fflags fields are now http://hg.python.org/cpython/rev/8345fb616cbd New changeset 8eac75276e5b by Christian Heimes in branch '2.7': Issue #11973: Fix a problem in kevent. The flags and fflags fields are now http://hg.python.org/cpython/rev/8eac75276e5b |
|||
| msg196128 - (view) | Author: Christian Heimes (christian.heimes) * (Python committer) | Date: 2013年08月25日 12:59 | |
Does somebody want to write a test for the issue, too? |
|||
| msg213039 - (view) | Author: David Naylor (DragonSA) * | Date: 2014年03月10日 15:28 | |
As requested, please find attached the unit tests that check `flags' can handle a u_short and `fflags' can handle a u_int. |
|||
| msg213040 - (view) | Author: David Naylor (DragonSA) * | Date: 2014年03月10日 15:28 | |
As requested, please find attached the unit tests that check `flags' can handle a u_short and `fflags' can handle a u_int. |
|||
| msg213041 - (view) | Author: David Naylor (DragonSA) * | Date: 2014年03月10日 15:28 | |
As requested, please find attached the unit tests that check `flags' can handle a u_short and `fflags' can handle a u_int. |
|||
| msg213042 - (view) | Author: David Naylor (DragonSA) * | Date: 2014年03月10日 15:28 | |
As requested, please find attached the unit tests that check `flags' can handle a u_short and `fflags' can handle a u_int. |
|||
| msg213043 - (view) | Author: David Naylor (DragonSA) * | Date: 2014年03月10日 15:28 | |
As requested, please find attached the unit tests that check `flags' can handle a u_short and `fflags' can handle a u_int. |
|||
| msg213044 - (view) | Author: David Naylor (DragonSA) * | Date: 2014年03月10日 15:28 | |
As requested, please find attached the unit tests that check `flags' can handle a u_short and `fflags' can handle a u_int. |
|||
| msg229176 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2014年10月12日 16:53 | |
New changeset 35542a32cd54 by R David Murray in branch '3.4': #11973: add test for previously fixed kevent signed/unsigned bug. https://hg.python.org/cpython/rev/35542a32cd54 New changeset a028299c9bc2 by R David Murray in branch 'default': Merge: #11973: add test for previously fixed kevent signed/unsigned bug. https://hg.python.org/cpython/rev/a028299c9bc2 New changeset 38fe09772b4f by R David Murray in branch '2.7': #11973: add test for previously fixed kevent signed/unsigned bug. https://hg.python.org/cpython/rev/38fe09772b4f |
|||
| msg229177 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2014年10月12日 16:55 | |
Committed the test finally. Thanks, David. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:16 | admin | set | github: 56182 |
| 2014年10月12日 16:55:04 | r.david.murray | set | status: open -> closed nosy: + r.david.murray messages: + msg229177 stage: commit review -> resolved |
| 2014年10月12日 16:53:58 | python-dev | set | messages: + msg229176 |
| 2014年03月10日 15:28:45 | DragonSA | set | files:
+ test_kqueue.py.diff messages: + msg213044 |
| 2014年03月10日 15:28:44 | DragonSA | set | files:
+ test_kqueue.py.diff messages: + msg213043 |
| 2014年03月10日 15:28:44 | DragonSA | set | files:
+ test_kqueue.py.diff messages: + msg213042 |
| 2014年03月10日 15:28:43 | DragonSA | set | files:
+ test_kqueue.py.diff messages: + msg213041 |
| 2014年03月10日 15:28:43 | DragonSA | set | files:
+ test_kqueue.py.diff messages: + msg213040 |
| 2014年03月10日 15:28:42 | DragonSA | set | files:
+ test_kqueue.py.diff keywords: + patch messages: + msg213039 |
| 2013年08月25日 12:59:41 | christian.heimes | set | resolution: fixed messages: + msg196128 stage: patch review -> commit review |
| 2013年08月25日 12:58:46 | python-dev | set | nosy:
+ python-dev messages: + msg196127 |
| 2013年08月25日 12:48:32 | christian.heimes | set | nosy:
+ christian.heimes messages: + msg196124 versions: + Python 3.4, - Python 3.1, Python 3.2 |
| 2013年08月25日 06:08:31 | koobs | set | nosy:
+ koobs |
| 2011年05月01日 18:50:22 | pitrou | set | nosy:
+ ronaldoussoren, ned.deily stage: patch review versions: - Python 2.6, Python 2.5, Python 3.4 |
| 2011年05月01日 18:26:33 | DragonSA | create | |