Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python.core from packet.pyx #27

Open
halayli opened this issue Jun 15, 2012 · 4 comments
Open

python.core from packet.pyx #27

halayli opened this issue Jun 15, 2012 · 4 comments

Comments

@halayli
Copy link
Member

halayli commented Jun 15, 2012

I saw a python.core today that came from packet.pyx. I couldn't get gdb to load the symbols properly but from the traceback it seems that it received an empty response and we proceeded to unpack it. The daemon has been running for a month or so now and that's the first time I see this issue.

https://github.com/ironport/shrapnel/blob/master/coro/dns/stub_resolver.py#L43

I added a check to make sure that the reply is not empty before we pass it to unpacker. I'll see if it happens again.

I can provide the python core if anyone is interested in it.

@samrushing
Copy link
Member

Yeah, that code is relatively new and could probably use some 'fuzz' testing...

@halayli
Copy link
Member Author

halayli commented Jun 16, 2012

got it. No problem I'll submit a patch after I let it soak for a couple of days.

@ehuss
Copy link
Contributor

ehuss commented Jun 18, 2012

Sam, whenever you have a "cpdef" or "cdef" function that returns a non-python value, you need to explicitly tell Cython what return value means "exception" (or "except *" to mean always check).

@samrushing
Copy link
Member

I assume you're talking about getbyte()... looks a little tricky, actually, since there are no 'invalid' characters in a dns packet. How about this, have it return an 'int', declare it as "except -1"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants