Thanks. I'm not sure what happened either. But this patch fixes the bug (attached). I'll upload it soon.



On 2023/1/15 19:59, Helmut Grohne wrote:
Source: libomxil-bellagio
Version: 0.9.3-7
Severity: serious
Tags: ftbfs

Hi,

libomxil-bellagio fails to build form source when built on mipsel. A
build ends as follows:

| gcc -DHAVE_CONFIG_H -I. -I..   -Wdate-time -D_FORTIFY_SOURCE=2 
-DOMXILCOMPONENTSPATH=\"/usr/lib/mipsel-linux-gnu/libomxil-bellagio0/\" 
-I../include -g -O2 -ffile-prefix-map=/root/libomxil-bellagio-0.9.3=. 
-fstack-protector-strong -Wformat -Werror=format-security -Wall -Werror 
-DCONFIG_DEBUG_LEVEL=0 -c -o omxregister_bellagio-omxregister.o `test -f 'omxregister.c' 
|| echo './'`omxregister.c
| In file included from /usr/include/string.h:535,
|                  from omxregister.c:42:
| In function ‘strncpy’,
|     inlined from ‘showComponentsList’ at omxregister.c:110:3,
|     inlined from ‘main’ at omxregister.c:454:9:
| /usr/include/mipsel-linux-gnu/bits/string_fortified.h:95:10: error: 
‘__builtin_strncpy’ destination unchanged after copying no bytes 
[-Werror=stringop-truncation]
|    95 |   return __builtin___strncpy_chk (__dest, __src, __len,
|       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|    96 |                                   __glibc_objsize (__dest));
|       |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~
| cc1: all warnings being treated as errors
| make[4]: *** [Makefile:719: omxregister_bellagio-omxregister.o] Error 1
| make[4]: Leaving directory '/root/libomxil-bellagio-0.9.3/src'
| make[3]: *** [Makefile:776: all-recursive] Error 1
| make[3]: Leaving directory '/root/libomxil-bellagio-0.9.3/src'
| make[2]: *** [Makefile:495: all-recursive] Error 1
| make[2]: Leaving directory '/root/libomxil-bellagio-0.9.3'
| make[1]: *** [Makefile:381: all] Error 2
| make[1]: Leaving directory '/root/libomxil-bellagio-0.9.3'
| dh_auto_build: error: make -j1 returned exit code 2
| make: *** [debian/rules:9: build] Error 2
| dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2

If you look at https://crossqa.debian.net/src/libomxil-bellagio, you can
guess that this is not entirely mipsel-specific, but probably also a
FTBFS on ppc64el and s390x. That said, I have only reproduced it on
mipsel and thus am filing it on mipsel.

A native build on amd64 succeeds.

I also briefly looked into it and couldn' really make sense of why gcc
thinks that the len parameter would become 0 here. Maybe someone else
figures?

Helmut
From: Ying-Chun Liu (PaulLiu) <paul...@debian.org>
Subject: fix FTBFS on mipsel
 We got /usr/include/mipsel-linux-gnu/bits/string_fortified.h:95:10:
 error: ‘__builtin_strncpy’ destination unchanged after copying no bes
 [-Werror=stringop-truncation]
 Thus we check the size before call strncpy.
Bug-Debian: http://bugs.debian.org/1028978
Index: libomxil-bellagio-0.9.3/src/omxregister.c
===================================================================
--- libomxil-bellagio-0.9.3.orig/src/omxregister.c
+++ libomxil-bellagio-0.9.3/src/omxregister.c
@@ -107,7 +107,9 @@ static int showComponentsList(FILE* omxr
 		while ((temp_buffer[i] != '\0') && (temp_buffer[i] != ' ')) {
 			i++;
 		}
-		strncpy(comp_name, temp_buffer, i);
+		if (i > 0) {
+			strncpy(comp_name, temp_buffer, i);
+		}
 		comp_name[i] = '\0';
 		temp_buffer += i;
 		if (*temp_buffer != '\0') {

Attachment: OpenPGP_0x44173FA13D058888.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to