Title: Build failure on 32-bit OS: incompatible type in tp_hash in PyTypeObject · Issue #149 · grisha/mod_python · GitHub
Open Graph Title: Build failure on 32-bit OS: incompatible type in tp_hash in PyTypeObject · Issue #149 · grisha/mod_python
X Title: Build failure on 32-bit OS: incompatible type in tp_hash in PyTypeObject · Issue #149 · grisha/mod_python
Description: Current mod_python v3.5.0.6 fails to build on 32-bit OS (e.g., armhf, i386, ...): Build log: https://buildd.debian.org/status/fetch.php?pkg=libapache2-mod-python&arch=i386&ver=3.5.0.6-1&stamp=1767544870&raw=0 Building mod_python.so. /usr...
Open Graph Description: Current mod_python v3.5.0.6 fails to build on 32-bit OS (e.g., armhf, i386, ...): Build log: https://buildd.debian.org/status/fetch.php?pkg=libapache2-mod-python&arch=i386&ver=3.5.0.6-1&stamp=17675...
X Description: Current mod_python v3.5.0.6 fails to build on 32-bit OS (e.g., armhf, i386, ...): Build log: https://buildd.debian.org/status/fetch.php?pkg=libapache2-mod-python&arch=i386&ver=3.5.0.6-1&...
Opengraph URL: https://github.com/grisha/mod_python/issues/149
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Build failure on 32-bit OS: incompatible type in tp_hash in PyTypeObject","articleBody":"Current mod_python v3.5.0.6 fails to build on 32-bit OS (e.g., armhf, i386, ...):\n\n* Build log: https://buildd.debian.org/status/fetch.php?pkg=libapache2-mod-python\u0026arch=i386\u0026ver=3.5.0.6-1\u0026stamp=1767544870\u0026raw=0\n\n```\nBuilding mod_python.so.\n\n/usr/bin/apxs2 -I/build/reproducible-path/libapache2-mod-python-3.5.0.6/src/include -I/usr/include/python3.13 -I/usr/include/python3.13 -Wc,-ffile-prefix-map=/build/reproducible-path/libapache2-mod-python-3.5.0.6=. -c mod_python.c _apachemodule.c requestobject.c tableobject.c util.c serverobject.c connobject.c filterobject.c hlist.c hlistobject.c finfoobject.c version.c include/_apachemodule.h include/filterobject.h include/hlist.h include/mod_python.h include/psp_flex.h include/psp_parser.h include/requestobject.h include/tableobject.h include/connobject.h include/finfoobject.h include/hlistobject.h include/mp_version.h include/_pspmodule.h include/psp_string.h include/serverobject.h include/util.h -L/usr/lib/python3.13/config-3.13-i386-linux-gnu -L/usr/lib/i386-linux-gnu -lpython3.13 -ldl -lm \n/usr/share/apr-1.0/build/libtool --mode=compile --tag=disable-static i686-linux-gnu-gcc -prefer-pic -pipe -g -O2 -Werror=implicit-function-declaration -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apache2 -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -ffile-prefix-map=/build/reproducible-path/libapache2-mod-python-3.5.0.6=. -I/build/reproducible-path/libapache2-mod-python-3.5.0.6/src/include -I/usr/include/python3.13 -I/usr/include/python3.13 -c -o mod_python.lo mod_python.c \u0026\u0026 touch mod_python.slo\nlibtool: compile: i686-linux-gnu-gcc -pipe -g -O2 -Werror=implicit-function-declaration -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apache2 -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -ffile-prefix-map=/build/reproducible-path/libapache2-mod-python-3.5.0.6=. -I/build/reproducible-path/libapache2-mod-python-3.5.0.6/src/include -I/usr/include/python3.13 -I/usr/include/python3.13 -c mod_python.c -fPIC -DPIC -o .libs/mod_python.o\n/usr/share/apr-1.0/build/libtool --mode=compile --tag=disable-static i686-linux-gnu-gcc -prefer-pic -pipe -g -O2 -Werror=implicit-function-declaration -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apache2 -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -ffile-prefix-map=/build/reproducible-path/libapache2-mod-python-3.5.0.6=. -I/build/reproducible-path/libapache2-mod-python-3.5.0.6/src/include -I/usr/include/python3.13 -I/usr/include/python3.13 -c -o _apachemodule.lo _apachemodule.c \u0026\u0026 touch _apachemodule.slo\nlibtool: compile: i686-linux-gnu-gcc -pipe -g -O2 -Werror=implicit-function-declaration -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apache2 -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -ffile-prefix-map=/build/reproducible-path/libapache2-mod-python-3.5.0.6=. -I/build/reproducible-path/libapache2-mod-python-3.5.0.6/src/include -I/usr/include/python3.13 -I/usr/include/python3.13 -c _apachemodule.c -fPIC -DPIC -o .libs/_apachemodule.o\n/usr/share/apr-1.0/build/libtool --mode=compile --tag=disable-static i686-linux-gnu-gcc -prefer-pic -pipe -g -O2 -Werror=implicit-function-declaration -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apache2 -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -ffile-prefix-map=/build/reproducible-path/libapache2-mod-python-3.5.0.6=. -I/build/reproducible-path/libapache2-mod-python-3.5.0.6/src/include -I/usr/include/python3.13 -I/usr/include/python3.13 -c -o requestobject.lo requestobject.c \u0026\u0026 touch requestobject.slo\nlibtool: compile: i686-linux-gnu-gcc -pipe -g -O2 -Werror=implicit-function-declaration -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apache2 -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -ffile-prefix-map=/build/reproducible-path/libapache2-mod-python-3.5.0.6=. -I/build/reproducible-path/libapache2-mod-python-3.5.0.6/src/include -I/usr/include/python3.13 -I/usr/include/python3.13 -c requestobject.c -fPIC -DPIC -o .libs/requestobject.o\n/usr/share/apr-1.0/build/libtool --mode=compile --tag=disable-static i686-linux-gnu-gcc -prefer-pic -pipe -g -O2 -Werror=implicit-function-declaration -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apache2 -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -ffile-prefix-map=/build/reproducible-path/libapache2-mod-python-3.5.0.6=. -I/build/reproducible-path/libapache2-mod-python-3.5.0.6/src/include -I/usr/include/python3.13 -I/usr/include/python3.13 -c -o tableobject.lo tableobject.c \u0026\u0026 touch tableobject.slo\nlibtool: compile: i686-linux-gnu-gcc -pipe -g -O2 -Werror=implicit-function-declaration -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apache2 -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -ffile-prefix-map=/build/reproducible-path/libapache2-mod-python-3.5.0.6=. -I/build/reproducible-path/libapache2-mod-python-3.5.0.6/src/include -I/usr/include/python3.13 -I/usr/include/python3.13 -c tableobject.c -fPIC -DPIC -o .libs/tableobject.o\ntableobject.c:1203:5: error: initialization of 'Py_hash_t (*)(PyObject *)' {aka 'int (*)(struct _object *)'} from incompatible pointer type 'long int (*)(PyObject *)' {aka 'long int (*)(struct _object *)'} [-Wincompatible-pointer-types]\n 1203 | table_nohash, /* tp_hash */\n | ^~~~~~~~~~~~\ntableobject.c:1203:5: note: (near initialization for 'MpTable_Type.tp_hash')\ntableobject.c:1161:13: note: 'table_nohash' declared here\n 1161 | static long table_nohash(PyObject *self)\n | ^~~~~~~~~~~~\napxs:Error: Command failed with rc=65536\n.\nmake[3]: *** [Makefile:57: mod_python.so] Error 1\n```\n\nThe reason is that `*hashfunc` as defined in https://docs.python.org/3/c-api/typeobj.html#c.hashfunc has type `Py_hash_t`, which is of type `signed integer` as defined at https://docs.python.org/3/c-api/hash.html#c.Py_hash_t . However, in https://github.com/grisha/mod_python/blob/52f8975829a0a3c467f089894e884d29c83e8a5e/src/tableobject.c#L1161 you are using `long` instead. On 32-bit OS, `long` may not equal to `int` and thus the build error happens.\n\nThe solution could be directly using `Py_hash_t`, instead of hardcoding `int` or `long` for function return.","author":{"url":"https://github.com/hosiet","@type":"Person","name":"hosiet"},"datePublished":"2026-01-04T17:39:05.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/149/mod_python/issues/149"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:241fb4d7-63a5-1d88-0058-d75d9bc4e791 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8C30:29E627:BA896C:FD13FB:6A4D5826 |
| html-safe-nonce | f8de565cb501258b1d2909af66b3adaabbb93bf6cf973e149b53f83b2c256f39 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QzMwOjI5RTYyNzpCQTg5NkM6RkQxM0ZCOjZBNEQ1ODI2IiwidmlzaXRvcl9pZCI6Ijc0ODU4MjQ4NjQyMTQ2NjkzNTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9295c83dd2790e6ab40b75899a5a046a6675492f203b386e38ed7292facf7f5c |
| hovercard-subject-tag | issue:3779472697 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/grisha/mod_python/149/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3d17646b1155ed46dcad295d0b2ac8cff1b4dfd4b4f15320d76f277055058132/grisha/mod_python/issues/149 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3d17646b1155ed46dcad295d0b2ac8cff1b4dfd4b4f15320d76f277055058132/grisha/mod_python/issues/149 |
| og:image:alt | Current mod_python v3.5.0.6 fails to build on 32-bit OS (e.g., armhf, i386, ...): Build log: https://buildd.debian.org/status/fetch.php?pkg=libapache2-mod-python&arch=i386&ver=3.5.0.6-1&stamp=17675... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hosiet |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2a1443ff9733a3016431263ea73c93d8fe00c195eb4a7670ac30e7848f045441 |
| turbo-cache-control | no-preview |
| go-import | github.com/grisha/mod_python git https://github.com/grisha/mod_python.git |
| octolytics-dimension-user_id | 243835 |
| octolytics-dimension-user_login | grisha |
| octolytics-dimension-repository_id | 7504434 |
| octolytics-dimension-repository_nwo | grisha/mod_python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7504434 |
| octolytics-dimension-repository_network_root_nwo | grisha/mod_python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f3bdd3157ea1f0fd738d408eceeead721acf1dc3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width