Hi, Bilal Akhtar <bilalakh...@ubuntu.com> writes: >> I noticed you patched src/xmalloc.c to not exit in xmalloc_fatal. Does >> the rest of the code handle this change correctly? > > Yes it does. This change has been around for more than a month in Debian > experimental and Ubuntu natty, and through some tests I found no > problems with it so far.
Did you ever run into an out of memory condition where the modified xmalloc_fatal is called? I did "sabotage" xmalloc to always call xmalloc_fatal using the attached patch. With this the test suite failed with a segmentation fault. So it seems the upstream code does *not* handle xmalloc_fatal returning correctly: --8<---------------cut here---------------start------------->8--- make check-TESTS make[3]: Entering directory `/build/sbuild-liboauth_0.9.4-1.1-amd64-mIm2gv/liboauth-0.9.4' Out of memory./bin/bash: line 5: 23730 Segmentation fault ${dir}$tst FAIL: tests/tcwiki Out of memory./bin/bash: line 5: 23754 Segmentation fault ${dir}$tst FAIL: tests/tceran Out of memory./bin/bash: line 5: 23778 Segmentation fault ${dir}$tst FAIL: tests/tcother ======================================== 3 of 3 tests failed --8<---------------cut here---------------end--------------->8--- Regards, Ansgar
Description: Upstream changes introduced in version 0.9.4-1.1 This patch has been created by dpkg-source during the package build. Here's the last changelog entry, hopefully it gives details on why those changes were made: . liboauth (0.9.4-1.1) UNRELEASED; urgency=low . * Non-maintainer upload. * Sabotage xmalloc. . The person named in the Author field signed this changelog entry. Author: Ansgar Burchardt <ans...@debian.org> --- The information above should follow the Patch Tagging Guidelines, please checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here are templates for supplementary fields that you might want to add: Origin: <vendor|upstream|other>, <url of original patch> Bug: <url in upstream bugtracker> Bug-Debian: http://bugs.debian.org/<bugnumber> Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber> Forwarded: <no|not-needed|url proving that it has been forwarded> Reviewed-By: <name and email of someone who approved the patch> Last-Update: <YYYY-MM-DD> --- liboauth-0.9.4.orig/src/xmalloc.c +++ liboauth-0.9.4/src/xmalloc.c @@ -34,7 +34,8 @@ static void *xmalloc_fatal(size_t size) void *xmalloc (size_t size) { void *ptr = malloc (size); - if (ptr == NULL) return xmalloc_fatal(size); + /* if (ptr == NULL) return xmalloc_fatal(size); */ + return xmalloc_fatal(size); return ptr; }