Merge ~alextu/libhybris/+git/libhybris:LP1536940_fixed_location_service_crash into ~libhybris-maintainers/libhybris/+git/libhybris:staging

Proposed by Alex Tu
Status: Merged
Merge reported by: Simon Fels
Merged at revision: not available
Proposed branch: ~alextu/libhybris/+git/libhybris:LP1536940_fixed_location_service_crash
Merge into: ~libhybris-maintainers/libhybris/+git/libhybris:staging
Diff against target: 193 lines (+114/-18)
4 files modified
debian/changelog (+66/-9)
debian/control (+0/-2)
debian/rules (+11/-6)
hybris/common/hooks.c (+37/-1)
Reviewer Review Type Date Requested Status
Libhybris Maintainers Pending
Review via email: mp+285038@code.launchpad.net

Description of the change

add freeaddrinfo to the hooks, fix a missmatch between glibc's addrinfo and bionic's getaddrinfo

from:
    https://github.com/krnlyng/libhybris/commit/cf7483232edb8b461b5f335d9d32326b17623ded
    Author: Franz-Josef <email address hidden>
    Date: Fri Jan 17 22:31:52 2014 +0200

        add freeaddrinfo to the hooks, fix a missmatch between glibc's addrinfo and bionic's getaddrinfo

Bug: https://bugs.launchpad.net/avila-private/+bug/1536940

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 9fdad27..374065a 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,17 +1,74 @@
6-libhybris (0.1.0+git20151016+6d424c9-0ubuntu4) UNRELEASED; urgency=medium
7+libhybris (0.1.0+git20151016+6d424c9-0ubuntu5) xenial; urgency=medium
8
9- * Hook missing pthread functions, localtime, gmtime, getlogin,
10- __sprintf_chk, __snprintf_chk, pthread_mutex_timedlock
11- * Add quirk for Mali GLES driver
12- * debian/rules:
13- - Enable Mali quirks
14- * Fix audio test case to work on Android 5.x
15+ * debian: drop requirement of gcc 4.7
16
17- -- Simon Fels <simon.fels@canonical.com> Thu, 07 Jan 2016 11:03:31 +0100
18+ -- Simon Fels <simon.fels@canonical.com> Tue, 26 Jan 2016 12:37:21 +0100
19
20-libhybris (0.1.0+git20151016+6d424c9-0ubuntu2) vivid; urgency=medium
21+libhybris (0.1.0+git20151016+6d424c9-0ubuntu4) xenial; urgency=medium
22+
23+ [ You-Sheng Yang ]
24+ * wifi: fix hardware_legacy/wifi.h not found
25+ * tests: fix test_audio compilation on Android 5 or above
26+
27+ [ Carsten Munk ]
28+ * Hook getlogin, __sprintf_chk, __snprintf_chk
29+
30+ [ Simon Fels ]
31+ * hybris: common: dump mutex address
32+ * hybris: common: add ugly workaround for malit-hist-dump thread
33+ * hybris: common: also hook prctl to workaround mali-hist-dump
34+ * hybris: common: also log name when prctl called with PR_SET_NAME
35+ * hybris: common: add exit workaround for mali-hist-dump thread
36+ * hybris: common: be more precise on prctl log messages
37+ * hybris: add configuration option to enable mali related quirks
38+ * hybris: common: hook localtime, gmtime and friends
39+ * debian: enable mali quirks
40+ * hybris: common: hook missing pthread functions
41+ * hybris: common: add further debug statements for symbol hooking
42+ * debian: update changelog
43+
44+ [ You-Sheng Yang ]
45+ * compat: media: remove wrong BOARD_HAS_MEDIA_PLAYER_PAUSE guard
46+ * compat: media: implement android::IMediaRecorder::resume
47+
48+ [ Simon Fels ]
49+ * debian: drop files listed twice in .install files
50+ * debian: drop -dbg package as we generate them automatically
51+
52+ [ You-Sheng Yang ]
53+ * hooks: add pthread_mutex_timedlock
54+
55+ [ Thomas Voß ]
56+ * Hook pthread_kill such that pthread_t values of 0 do not lead to segfaults.
57+
58+ [ Simon Fels ]
59+ * debian: update changelog
60+ * debian: correct vcs reference to point to launchpad
61+
62+ [ You-Sheng Yang ]
63+ * hook: add pthread_condattr_setclock
64+ * hook: skip only symbol names prefixed with "pthread" or "__pthread"
65+
66+ [ Mikko Harju ]
67+ * [libhybris] Add cache for socket based property lookups.
68+
69+ [ Simon Fels ]
70+ * hybris: common: add simple macro to check for existing symbols
71+ * debian: drop stripping of not existing package
72+ * Revert "debian: don't package NFC stuff anymore"
73+ * utils: fix binding wrapper macro generator script
74+ * debian: sync changelog up with what is released
75+ * debian: enable property cache for x86 and armhf
76+ * debian: rules: cleanup formatting for autoconf options
77+
78+ -- Simon Fels <simon.fels@canonical.com> Tue, 26 Jan 2016 11:05:14 +0100
79+
80+libhybris (0.1.0+git20151016+6d424c9-0ubuntu3) vivid; urgency=medium
81
82 * Various fixes to allow camera access to work in the web browser
83+ * Fix compat layer compilation when API functions are missing on
84+ certain devices in the media player implementation.
85+ * Add initial support for Android 5.x
86
87 -- Simon Fels <simon.fels@canonical.com> Thu, 07 Jan 2016 08:07:11 +0100
88
89diff --git a/debian/control b/debian/control
90index 50ae6e7..9ab338f 100644
91--- a/debian/control
92+++ b/debian/control
93@@ -5,8 +5,6 @@ Build-Depends: debhelper (>= 9.0.0),
94 autotools-dev,
95 dh-autoreconf,
96 android-headers (>= 4.4.2),
97- gcc-4.7,
98- g++-4.7,
99 quilt,
100 pkg-config,
101 libgles2-mesa-dev,
102diff --git a/debian/rules b/debian/rules
103index acb0a21..8fe083a 100755
104--- a/debian/rules
105+++ b/debian/rules
106@@ -17,10 +17,6 @@ DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
107 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
108 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
109
110-# Compiler
111-export CC=gcc-4.7
112-export CXX=g++-4.7
113-
114 # Strong needs at least gcc 4.9
115 export DEB_BUILD_MAINT_OPTIONS=hardening=-stackprotectorstrong
116
117@@ -61,9 +57,18 @@ get-packaged-orig-source:
118
119 override_dh_auto_configure:
120 ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), armhf))
121- dh_auto_configure --sourcedirectory=hybris -- --enable-wayland --enable-arch=arm --with-android-headers=/usr/include/android --enable-mali-quirks
122+ dh_auto_configure --sourcedirectory=hybris -- \
123+ --enable-wayland \
124+ --enable-arch=arm \
125+ --with-android-headers=/usr/include/android \
126+ --enable-mali-quirks \
127+ --enable-property-cache
128 else
129- dh_auto_configure --sourcedirectory=hybris -- --enable-wayland --enable-arch=x86 --with-android-headers=/usr/include/android
130+ dh_auto_configure --sourcedirectory=hybris -- \
131+ --enable-wayland \
132+ --enable-arch=x86 \
133+ --with-android-headers=/usr/include/android \
134+ --enable-property-cache
135 endif
136
137 override_dh_install:
138diff --git a/hybris/common/hooks.c b/hybris/common/hooks.c
139index 62b28b1..a7c761f 100644
140--- a/hybris/common/hooks.c
141+++ b/hybris/common/hooks.c
142@@ -1386,6 +1386,41 @@ static int my_readdir_r(DIR *dir, struct bionic_dirent *entry,
143 return res;
144 }
145
146+static inline void swap(void **a, void **b)
147+{
148+ void *tmp = *a;
149+ *a = *b;
150+ *b = tmp;
151+}
152+
153+static int my_getaddrinfo(const char *hostname, const char *servname,
154+ const struct addrinfo *hints, struct addrinfo **res)
155+{
156+ // make a local copy of hints
157+ struct addrinfo *fixed_hints = (struct addrinfo*)malloc(sizeof(struct addrinfo));
158+ memcpy(fixed_hints, hints, sizeof(struct addrinfo));
159+ // fix bionic -> glibc missmatch
160+ swap((void**)&(fixed_hints->ai_canonname), (void**)&(fixed_hints->ai_addr));
161+ // do glibc getaddrinfo
162+ int result = getaddrinfo(hostname, servname, fixed_hints, res);
163+ // release the copy of hints
164+ free(fixed_hints);
165+ // fix bionic <- glibc missmatch
166+ struct addrinfo *it = *res;
167+ while(NULL != it)
168+ {
169+ swap((void**)&(it->ai_canonname), (void**)&(it->ai_addr));
170+ it = it->ai_next;
171+ }
172+ return result;
173+}
174+
175+static void my_freeaddrinfo(struct addrinfo *__ai)
176+{
177+ swap((void**)&(__ai->ai_canonname), (void**)&(__ai->ai_addr));
178+ freeaddrinfo(__ai);
179+}
180+
181 extern long my_sysconf(int name);
182
183 FP_ATTRIB static double my_strtod(const char *nptr, char **endptr)
184@@ -1745,7 +1780,8 @@ static struct _hook hooks[] = {
185 {"__errno", __errno_location},
186 {"__set_errno", my_set_errno},
187 /* net specifics, to avoid __res_get_state */
188- {"getaddrinfo", getaddrinfo},
189+ {"getaddrinfo", my_getaddrinfo},
190+ {"freeaddrinfo", my_freeaddrinfo},
191 {"gethostbyaddr", gethostbyaddr},
192 {"gethostbyname", gethostbyname},
193 {"gethostbyname2", gethostbyname2},

Subscribers

People subscribed via source and target branches