package: uwsgi
version: 0.9.8.3-2
severity: serious
tags: patch
x-debbugs-cc: ja...@resenje.org

Unfortunately the patch submitted for 640347 was incorrect. The architecture in the "openjdk-6-<arch>" part of the path needs to be the debian architecture name not the java architecture name (which is ambiguous). This error causes the package to FTBFS on architectures where the debian architecture and java architecture differ. Debian and java architecture names differ on armel, powerpc, armhf, sh4, and powerpcspe

In addition to further confuse matters java-arch.sh was returning incorrect java architecture names on armhf, sh4, powerpcspe and s390x, that has been sorted in a recent upload of javahelper for armhf, sh4 and powerpcspe. At the time of writing it's still an issue on s390x. Still I can poke the s390x buildd guys for a rebuild when that is sorted so don't let it stop you uploading this fix.

Anyway I prepared a fix for the debian architecture names VS java architecture names issue and then ran a test build on armel. Unfortunately it failed with "strict aliasing" errors in the python2.7 plugin. I then tested the package on amd64 and ran into the same issue.

gcc -pthread -fPIC -shared -o /uwsgi-0.9.8.3/python27_plugin.so -I. -O2 -Wall -Werror -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -DUWSGI_BUILD_DATE="\"17 January 2012 19:52:09\"" -DUWSGI_HAS_IFADDRS -DUWSGI_LOCK_USE_MUTEX -DUWSGI_EVENT_USE_EPOLL -DUWSGI_EVENT_TIMER_USE_TIMERFD -DUWSGI_EVENT_TIMER_USE_TIMERFD_NOINC -DUWSGI_EVENT_FILEMONITOR_USE_INOTIFY -DUWSGI_EMBEDDED -DUWSGI_UDP -DUWSGI_UUID -DUWSGI_VERSION="\"0.9.8.3-debian\"" -DUWSGI_VERSION_BASE="0" -DUWSGI_VERSION_MAJOR="9" -DUWSGI_VERSION_MINOR="8" -DUWSGI_VERSION_REVISION="3" -DUWSGI_VERSION_CUSTOM="\"debian\"" -DUWSGI_ASYNC -DUWSGI_MULTICAST -DUWSGI_MINTERPRETERS -DUWSGI_INI -DUWSGI_YAML -DUWSGI_LIBYAML -DUWSGI_JSON -DUWSGI_LDAP -DUWSGI_ZEROMQ -DUWSGI_SNMP -DUWSGI_THREADING -DUWSGI_SENDFILE -I/usr/include/libxml2 -DUWSGI_XML -DUWSGI_XML_LIBXML2 -DUWSGI_SQLITE3 -DUWSGI_PLUGIN_DIR=\"/uwsgi-0.9.8.3\" -DUWSGI_SPOOLER -I/usr/include/python2.7 -I/usr/include/python2.7 -Wno-unused-parameter -Wno-strict-prototypes -Dpython_plugin=python27_plugin -L/usr/lib/python2.7/config -lpthread -ldl -lutil -lm -lpython2.7 -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions /uwsgi-0.9.8.3/plugins/python27/../python/python_plugin.c /uwsgi-0.9.8.3/plugins/python27/../python/pyutils.c /uwsgi-0.9.8.3/plugins/python27/../python/pyloader.c /uwsgi-0.9.8.3/plugins/python27/../python/wsgi_handlers.c /uwsgi-0.9.8.3/plugins/python27/../python/wsgi_headers.c /uwsgi-0.9.8.3/plugins/python27/../python/wsgi_subhandler.c /uwsgi-0.9.8.3/plugins/python27/../python/gil.c /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c /uwsgi-0.9.8.3/plugins/python27/../python/profiler.c /uwsgi-0.9.8.3/plugins/python27/../python/symimporter.c -lpthread -ldl -lutil -lm -lpython2.7 /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c: In function ‘py_uwsgi_add_cron’: /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c:256:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c: In function ‘py_uwsgi_register_rpc’: /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c:500:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c: In function ‘py_uwsgi_attach_daemon’: /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c:517:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c: In function ‘py_uwsgi_signal_registered’: /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c:529:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c: In function ‘py_uwsgi_is_connected’: /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c:785:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c: In function ‘py_uwsgi_send’: /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c:820:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c: In function ‘py_uwsgi_advanced_sendfile’: /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c:884:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c: In function ‘py_uwsgi_warning’: /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c:937:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c: In function ‘py_uwsgi_log’: /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c:950:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c: In function ‘py_uwsgi_spooler_freq’: /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c:1184:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c: In function ‘py_uwsgi_load_plugin’: /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c:1614:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c: In function ‘py_uwsgi_multicast’: /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c:1635:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c: In function ‘py_uwsgi_reload’: /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c:2183:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c: In function ‘py_uwsgi_set_blocking’: /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c:2191:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c: In function ‘py_uwsgi_disconnect’: /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c:2245:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c: In function ‘py_uwsgi_grunt’: /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c:2393:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c: In function ‘py_uwsgi_suspend’: /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c:2431:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c: In function ‘py_uwsgi_cache_del’: /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c:2634:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c: In function ‘py_uwsgi_cache_set’: /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c:2671:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c: In function ‘py_uwsgi_cache_exists’: /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c:2694:4: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c:2699:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c: In function ‘py_uwsgi_queue_push’: /uwsgi-0.9.8.3/plugins/python27/../python/uwsgi_pymodule.c:2721:4: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
cc1: all warnings being treated as errors
*** unable to build python27 plugin ***
make: *** [debian/stamp-plugin-python] Error 1
dpkg-buildpackage: error: debian/rules build gave error exit status 2
root@debian:/uwsgi-0.9.8.3#

I took the easy fix for this and enabled -fno-strict-aliasing for python 2.x plugins (there was already code to apply the flag but only with older gcc versions. I just removed the gcc version check).

Patch is attatched, it has been test on armel, armhf and amd64.

P.S. I have put the patch author in cc for this bug report so that they are aware of the distinction between debian architectures and java architectures for any similar patches they submit in future.
diff -urN uwsgi-0.9.8.3/debian/patches/120117_01_disable_strict_aliasing_for_python2_plugins.patch uwsgi-0.9.8.3.new/debian/patches/120117_01_disable_strict_aliasing_for_python2_plugins.patch
--- uwsgi-0.9.8.3/debian/patches/120117_01_disable_strict_aliasing_for_python2_plugins.patch	1970-01-01 00:00:00.000000000 +0000
+++ uwsgi-0.9.8.3.new/debian/patches/120117_01_disable_strict_aliasing_for_python2_plugins.patch	2012-01-17 21:20:27.000000000 +0000
@@ -0,0 +1,28 @@
+Description: disable strict aliasing for python 2.x plugins 
+ It seems that as of 17-JAN-2011 the python 2.7 plugin won't built in sid
+ with strict aliasing enabled. This patch changes the tests in the build
+ script to disable strict aliasing for the python plugins regardless of
+ gcc version.
+Author: Peter Green <plugw...@p10link.net>
+Bug-Debian: http://bugs.debian.org/??????
+
+--- uwsgi-0.9.8.3.orig/uwsgiconfig.py
++++ uwsgi-0.9.8.3/uwsgiconfig.py
+@@ -30,7 +30,7 @@ binary_list = []
+ def binarize(name):
+     return name.replace('/', '_').replace('.','_').replace('-','_')
+ 
+-# add -fno-strict-aliasing only on python2 and gcc < 4.3
++# add -fno-strict-aliasing only on python2
+ def strict_aliasing_must_be_disabled(plugin_name, uconf):
+     is_python2_plugin = (
+         plugin_name.startswith('python2')
+@@ -38,7 +38,7 @@ def strict_aliasing_must_be_disabled(plu
+     gcc_version_earlier_than_43 = (
+         uconf.gcc_major < 4
+         or (uconf.gcc_major == 4 and uconf.gcc_minor < 3))
+-    return (is_python2_plugin and gcc_version_earlier_than_43)
++    return (is_python2_plugin)
+ 
+ 
+ def spcall(cmd):
diff -urN uwsgi-0.9.8.3/debian/patches/series uwsgi-0.9.8.3.new/debian/patches/series
--- uwsgi-0.9.8.3/debian/patches/series	2012-01-01 20:16:34.000000000 +0000
+++ uwsgi-0.9.8.3.new/debian/patches/series	2012-01-17 21:17:39.000000000 +0000
@@ -5,3 +5,4 @@
 110429_01_apply_GCC_no_strict_aliasing_option_only_to_python_plugin_building.patch
 110515_01_add_overriding_of_JVM_PATH_into_buildscript_of_jwsgi_plugin.patch
 110726_01_fix_indentation_of_uwsgidecorators_py.patch
+120117_01_disable_strict_aliasing_for_python2_plugins.patch
diff -urN uwsgi-0.9.8.3/debian/rules uwsgi-0.9.8.3.new/debian/rules
--- uwsgi-0.9.8.3/debian/rules	2012-01-01 20:16:34.000000000 +0000
+++ uwsgi-0.9.8.3.new/debian/rules	2012-01-17 21:39:22.000000000 +0000
@@ -296,6 +296,8 @@
 		         $(PLUGIN_NAME)
 	touch $@
 
+DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+
 # Build jvm_openjdk6.so and jwsgi_openjdk6.so
 debian/stamp-plugin-jvm-openjdk-6 debian/stamp-plugin-jwsgi-openjdk-6:
 	$(eval PLUGIN_NAME = $(call pkg_name_to_plugin_name, \
@@ -303,8 +305,8 @@
 	))
 	$(eval PLUGIN_SRC_SUBDIR = $(firstword $(subst _, ,$(PLUGIN_NAME))))
 	$(eval JAVA_ARCH := $(shell /usr/share/javahelper/java-arch.sh))
-	UWSGICONFIG_JVM_INCPATH='/usr/lib/jvm/java-6-openjdk-$(JAVA_ARCH)/include/ -I/usr/lib/jvm/java-6-openjdk-$(JAVA_ARCH)/include/linux' \
-	UWSGICONFIG_JVM_LIBPATH='/usr/lib/jvm/java-6-openjdk-$(JAVA_ARCH)/jre/lib/$(JAVA_ARCH)/server/' \
+	UWSGICONFIG_JVM_INCPATH='/usr/lib/jvm/java-6-openjdk-$(DEB_HOST_ARCH)/include/ -I/usr/lib/jvm/java-6-openjdk-$(DEB_HOST_ARCH)/include/linux' \
+	UWSGICONFIG_JVM_LIBPATH='/usr/lib/jvm/java-6-openjdk-$(DEB_HOST_ARCH)/jre/lib/$(JAVA_ARCH)/server/' \
 	$(PYTHON) $(UWSGI_BUILDER) \
 		--plugin $(CURDIR)/$(UWSGI_PLUGINS_SRC_DIR)/$(PLUGIN_SRC_SUBDIR) \
 		         $(CURDIR)/debian/buildconf/uwsgi-plugin.ini \

Reply via email to