Comments (10)
@robertwb commented
I haven't been able to use this to produce a crash on my machine, but it does look bad...
from cython.
@robertwb changed milestone to 0.9.8.2
commented
Lets try to come up with some specific examples here...
from cython.
@anonymous changed resolution to fixed
status from new
to closed
commented
Without further verification, this problem is most likely resolved by the new argument parsing code.
from cython.
@dagss changed milestone from 0.9.8.2
to wishlist
priority from major
to minor
resolution from fixed
to empty
status from closed
to reopened
commented
The danger of a crash is now gone but there is still some inconsistency within Cython whether the size of the type plays a role for external typedefs, and I'd like the behaviour to change here rather than other places personally. Reopening but making it a minor wishlist issue.
Details:
Does anyone have any thoughts about the external typedef issue with
argument unpacking? I see that with Stefan's code we get an exception
rather than a segfault which is a big step forward, but one could still
think a bit about what the behaviour should be (i.e. if people wants to
use numpy.uint16_t as a function argument type I want a defined
behaviour for that.)
Example:
test.h:
typedef long int my_int;
test.pyx:
cdef extern from "test.h":
ctypedef char myint
def myfunc(myint x):
pass
Now, myfunc(1000) will raise an overflow exception.
Granted, this is an extreme example. I just want a defined behaviour on
this somehow, and documenting the existing one could be ok. If we want
to support it without assumptions on the size, something like
#define __Pyx_FetchPyInt(result, from) switch(sizeof(result)) {\
case sizeof(char): result = __pyx_PyInt_char(from); break;
case sizeof(int):
....
default: __Pyx_RaiseFetchPyIntError(from); result = -1;
}
should do the trick (and it is only needed when the typedef is extern).
Will a patch like that be accepted? (It will have to wait a month or two
if I'm the one doing it, but I am not expecting anybody else to in the
meantime.)
from cython.
@robertwb commented
It should be noted that argument parsing has been entirely re-written and avoids explicit calls to PyArg_ParseTupleAndKeywords in most cases.
from cython.
scoder commented
We can make that "all cases" now.
from cython.
scoder changed milestone from wishlist
to 0.11
resolution to fixed
status from reopened
to closed
commented
no idea when exactly this was fixed (is that still a problem in 0.10.x?), but argument parsing has its own unpacking code now, so this is no longer an issue.
from cython.
scoder changed resolution from fixed
to empty
status from closed
to reopened
commented
from cython.
scoder changed owner from somebody
to scoder, robertwb
status from reopened
to new
commented
from cython.
scoder changed resolution to fixed
status from new
to closed
commented
from cython.
Related Issues (20)
- [BUG] Bug with limited API support in trivial program involving float literal HOT 5
- [BUG] Segmentation fault with Walrus-Operator and same named variables HOT 2
- [BUG] Generators after being cythonized cannot be inspect as generators HOT 13
- [ENH] Can Cython support the vector database function of redis? HOT 3
- [BUG] Function Wrapper yields unused-variable warning when compiled with pypy HOT 3
- [BUG] cppclass inheritance does not work with overloaded methods HOT 3
- [BUG] Deadlock in OpenMP Parallel Loop When Invoking LAPACK Functions in Cython>=3.0 HOT 4
- [BUG] Multi-line f-string literals do not adhere to """\ syntax HOT 1
- [bug] issues with "cppclass overloadable methods" HOT 1
- [ENH] Improve Cython install speed from source HOT 4
- [ENH] Reproducible output
- [ENH] Implement __Pyx_PyObject_LengthHint properly on the limited API HOT 1
- [BUG] 'except?' started failing in 3.0.10 HOT 16
- [BUG] New string::replace in Cython 3.0.9 feature overrides the bytes.replace method HOT 5
- [ENH] Can Cython support match statement in Python? HOT 1
- [ENH] Restrict instance methods on extension types to the actual type HOT 2
- [ENH] Allow customization of cpdef enum to Py conversions
- [ENH] Compilation does not support importing cython module from another module HOT 4
- [ENH/BUG?] Enum as C array index value: Invalid index type 'Test' HOT 1
- [BUG] 3.0.10: test suite fails in `End-to-end coverage_cmd_src_pkg_layout` unit with `coverage` 7.4.4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cython.