GNOME Bugzilla – Bug 625438
test_gio.TestContentTypeGuess.testFromContents fails on x86-64
Last modified: 2010-07-30 13:05:33 UTC
testFromContents (test_gio.TestContentTypeGuess) ... Program received signal SIGSEGV, Segmentation fault. cache_magic_matchlet_compare_to_data (cache=0x8a4d40, offset=<value optimized out>, data=0x2aaa00000000, len=13) at xdgmimecache.c:199 199 if (((unsigned char *)cache->buffer)[data_offset + j] != ((unsigned char *) data)[j + i])
+ Trace 223015
data is an invalid pointer in the override for some reason. Doing the same test from C works. Issue with PyArg_ParseTupleAndKeywords?
The "|zz#i:g_content_type_guess" signature fails for z# (get the string and length). Removing the # and using strlen to get the length works.
Created attachment 166821 [details] [review] use strlen instead of z# to get the length of an argument * for some reason PyArg_ParseTupleAndKeywords returns an invalid pointer for |z# when the parameter is not supplied (should stay NULL) * use |z and then call strlen on the parameter if it is not NULL
Created attachment 166822 [details] [review] make sure we parse parameters to python object vars not glib vars * py_flags was already set up but due to a typo &flags was being passed instead
Review of attachment 166821 [details] [review]: We can still use z#. The problem is that data_size must be a Py_ssize_t (a machine word) rather than an int. I don't know whether we want compatibility with Python 2.4 or not. If so, we need to check that PY_SSIZE_T_CLEAN is defined, and use an int otherwise.
(In reply to comment #5) > Review of attachment 166821 [details] [review]: > > We can still use z#. The problem is that data_size must be a Py_ssize_t (a > machine word) rather than an int. I don't know whether we want compatibility > with Python 2.4 or not. If so, we need to check that PY_SSIZE_T_CLEAN is > defined, and use an int otherwise. Will this still work if data contains binary data instead of text?
Created attachment 166829 [details] [review] use strlen instead of z# to get the length of an argument * for some reason PyArg_ParseTupleAndKeywords returns an invalid pointer for |z# when the parameter is not supplied (should stay NULL) * use |z and then call strlen on the parameter if it is not NULL
Created attachment 166830 [details] [review] check if z# needs an int or Py_ssize_t
Review of attachment 166822 [details] [review]: Thanks.
Review of attachment 166830 [details] [review]: Thanks!
Tomeu, I don't get your question. Can you elaborate?