-
-
Notifications
You must be signed in to change notification settings - Fork 474
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
Request.SetPostData() and GetPostData don't work. All strings are expected to be byte strings. #228
Comments
You are setting an empty data. Does the error occur also when setting non-empty data or when not calling SetPostData at all? |
I've tried with a dict {'key': 'value'} and with a list ["--data=1"]. It only seg faults when calling SetPostData. |
You can get stacktrace using gdb, no need to build from source to do that. See: |
Here is the source code for SetPostData: |
The cef stacktrace isn't very useful:
Still trying to get cython debugging working. But is the issue reproduceable on your end? |
The stacktrace at least says something useful - the error is in the cefpython code. It fails on this line:
https://github.com/cztomczak/cefpython/blob/cefpython31/cefpython/request_cef3.pyx#L116 I looked at upstream CEF code and postdata is set to NULL when it's empty, meaning that postData.get() may return NULL. Thus you can't call RemoveElements() on it. Looks like these functions (GetPostData, SetPostData) were never really tested. This code also fails:
Fails on this line:
https://github.com/cztomczak/cefpython/blob/cefpython31/cefpython/request_cef3.pyx#L69 Similarly, postData.get() returns NULL, thus segmentation fault when calling GetElementCount(). Fix: always check postData.get() for non-NULL value before calling a method on it. |
Already fixed in my local repo, will commit today. Pasting test code which passes OK x6 after fixes:
|
Update to Cython 0.25.2. Fix Certificate Transparency support causing some SSL sites fail to load after some time (#279). Fix ApplicationSettings.cache_path not working (#283). Fix: Not a clean shutdown in examples, when closing app while browser is still loading a website (#282). Fix loading local filesystem urls that contained any of ? & = characters (#273). Fix Request.SetPostData and GetPostData segmentation faults (#228). Add ApplicationSettings.net_security_expiration_enabled. Update ExecuteJavascript docs with scriptUrl="" and startLine=1 default params. Also worth noting that ExecuteJavascript crashed in earlier CEF versions when startLine wasn't provided or was <= 0 (Issue #268). Add a test that measures execution time for calling Python function from javascript and then js callback. Add Contributing guidelines / Issue template. Update automate.py, include ceftests executable.
Fixed in bfc0a25. v55.2 released. Please test. |
This issue seems to be still unresolved.
Reported on the Forum: |
Tested on v57.0, v55.3 and v55.2. |
The code in question is here:
If someone can analyze the code and find the bug that would be helpful. |
You are missing this line at the end of SetPostData function:- |
@sonya75 Thanks Sonya, that was it! Fixed in revision 82ed469. This time tested properly. Code:
Output:
The fix was applied to master branch and will be available in the next release (schedule not yet known). If you want this applied now, then apply the fix from the commit above to the "cefpython57" branch and follow the quick instructions from the docs/Build-instructions.md document to build the cefpython module from sources by using prebuilt CEF binaries from GitHub. With these quick instructions building cefpython takes about 10 minutes. |
Further fixes for Python 3 in rev 4c5cf09. |
Can't seem to get SetPostData() to work, should accept a list or a dict:
Python 2.7.11+
cefpython 31.2-1
The text was updated successfully, but these errors were encountered: