[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#900126: libgit2: Testsuite failures on 32-bit targets with 64-bit file offsets



Source: libgit2
Version: 0.23.1-1
Severity: serious
Tags: patch upstream
Justification: fails to build from source
User: debian-mips@lists.debian.org
Usertags: mips

Hi!

Thanks for merging my patch to fix the alignment issue reported
in #900059. There is, however, an additional problem with libgit2
which causes the testsuite to fail on 32-bit systems [1]:

core::buffer..........................*** stack smashing detected ***: <unknown> terminated

3/3 Test #3: libgit2_clar-ssh .................***Exception: Child aborted  3.47 sec
Loaded 343 suites: 
Started (test status codes: OK='.' FAILURE='F' SKIPPED='S')

Since this issue is not visible in the git master branch of libgit2,
I assumed that this must have been fixed in the meantime. And, in
fact there is pull request which addresses this problem [2].

The fix is trivial and I can confirm it fixes the testsuite for me
on mipsel.

Please include the attached patch in the next upload.

Adrian

> [1] https://buildd.debian.org/status/fetch.php?pkg=libgit2&arch=i386&ver=0.27.0%2Bdfsg.1-0.3&stamp=1527339147&raw=0
> [2] https://github.com/libgit2/libgit2/pull/4631

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
>From fac7eac451f99f722b54e7cd8761926837dd0fa5 Mon Sep 17 00:00:00 2001
From: Andreas Baumann <mail@andreasbaumann.cc>
Date: Thu, 19 Apr 2018 15:21:52 +0200
Subject: [PATCH] fixed stack smashing due to wrong size of struct stat on the
 stack on 32-bit systems with 64-bit file descriptor offsets enabled (added
 -D_FILE_OFFSET_BITS=64 when compiling the test suite)

---
 tests/CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 775f33f2d..e73e7237c 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -9,6 +9,7 @@ SET(CLAR_FIXTURES "${CMAKE_CURRENT_SOURCE_DIR}/resources/")
 SET(CLAR_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
 ADD_DEFINITIONS(-DCLAR_FIXTURE_PATH=\"${CLAR_FIXTURES}\")
 ADD_DEFINITIONS(-DCLAR_TMPDIR=\"libgit2_tests\")
+ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64)
 
 INCLUDE_DIRECTORIES(${CLAR_PATH} ${libgit2_BINARY_DIR}/src)
 FILE(GLOB_RECURSE SRC_TEST ${CLAR_PATH}/*/*.c ${CLAR_PATH}/*/*.h)
-- 
2.17.0


Reply to: