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

Bug#1066246: lcm: FTBFS: emit_cpp.c:306:19: error: implicit declaration of function ‘_exit’ [-Werror=implicit-function-declaration]



Tags: patch

Hi,
On Wed, Mar 13, 2024 at 12:40:02PM +0100, Lucas Nussbaum wrote:
Source: lcm
Version: 1.3.1+repack1-7
Severity: serious
Justification: FTBFS
Tags: trixie sid ftbfs
User: lucas@debian.org
Usertags: ftbfs-20240313 ftbfs-trixie ftbfs-impfuncdef

Hi,

During a rebuild of all packages in sid, your package failed to build
on amd64.

This is most likely caused by a change in dpkg 1.22.6, that enabled
-Werror=implicit-function-declaration. For more information, see
https://wiki.debian.org/qa.debian.org/FTBFS#A2024-03-13_-Werror.3Dimplicit-function-declaration

Relevant part (hopefully):
gcc -DPACKAGE_NAME=\"lcm\" -DPACKAGE_TARNAME=\"lcm\" -DPACKAGE_VERSION=\"1.3.1\" -DPACKAGE_STRING=\"lcm\ 1.3.1\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"lcm\" -DVERSION=\"1.3.1\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I.  -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -pthread  -Wdate-time -D_FORTIFY_SOURCE=2 -g -std=gnu99 -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_REENTRANT -Wno-unused-parameter -Wno-format-zero-length -Wshadow -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -c -o emit_csharp.o emit_csharp.c
emit_cpp.c: In function ‘emit_header_start’:
emit_cpp.c:306:19: error: implicit declaration of function ‘_exit’ [-Werror=implicit-function-declaration]
  306 |                   _exit(1);
      |                   ^~~~~
emit_cpp.c:306:19: warning: incompatible implicit declaration of built-in function ‘_exit’ [-Wbuiltin-declaration-mismatch]
In function ‘ensure_token_capacity’,
    inlined from ‘tokenize_next_internal’ at tokenize.c:325:14:
tokenize.c:127:28: warning: argument 2 range [18446744071562067968, 18446744073709551615] exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
  127 |         t->token = (char*) realloc(t->token, t->token_capacity);
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from tokenize.c:1:
/usr/include/stdlib.h: In function ‘tokenize_next_internal’:
/usr/include/stdlib.h:564:14: note: in a call to allocation function ‘realloc’ declared here
  564 | extern void *realloc (void *__ptr, size_t __size)
      |              ^~~~~~~
gcc -DPACKAGE_NAME=\"lcm\" -DPACKAGE_TARNAME=\"lcm\" -DPACKAGE_VERSION=\"1.3.1\" -DPACKAGE_STRING=\"lcm\ 1.3.1\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"lcm\" -DVERSION=\"1.3.1\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I.  -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -pthread  -Wdate-time -D_FORTIFY_SOURCE=2 -g -std=gnu99 -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_REENTRANT -Wno-unused-parameter -Wno-format-zero-length -Wshadow -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -c -o emit_python.o emit_python.c
gcc -DPACKAGE_NAME=\"lcm\" -DPACKAGE_TARNAME=\"lcm\" -DPACKAGE_VERSION=\"1.3.1\" -DPACKAGE_STRING=\"lcm\ 1.3.1\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"lcm\" -DVERSION=\"1.3.1\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I.  -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -pthread  -Wdate-time -D_FORTIFY_SOURCE=2 -g -std=gnu99 -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_REENTRANT -Wno-unused-parameter -Wno-format-zero-length -Wshadow -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -c -o emit_lua.o emit_lua.c
emit_python.c: In function ‘emit_package’:
emit_python.c:702:33: warning: ‘__builtin___sprintf_chk’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
  702 |     sprintf(package_dir, "%s%s%s", package_dir_prefix, pdname,
      |                                 ^
In file included from /usr/include/stdio.h:906,
                 from emit_python.c:1:
In function ‘sprintf’,
    inlined from ‘emit_package’ at emit_python.c:702:5:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:30:10: note: ‘__builtin___sprintf_chk’ output 2 or more bytes (assuming 4097) into a destination of size 4096
   30 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   31 |                                   __glibc_objsize (__s), __fmt,
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   32 |                                   __va_arg_pack ());
      |                                   ~~~~~~~~~~~~~~~~~
emit_python.c: In function ‘emit_package’:
emit_python.c:44:13: warning: ‘__builtin_strncpy’ output may be truncated copying between 0 and 4094 bytes from a string of length 4095 [-Wstringop-truncation]
   44 |             strncpy(dirpath, path, i);
      |             ^
cc1: some warnings being treated as errors
emit_lua.c: In function ‘emit_package’:
emit_lua.c:762:33: warning: ‘__builtin___sprintf_chk’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
  762 |     sprintf(package_dir, "%s%s%s", package_dir_prefix, pdname,
      |                                 ^
In file included from /usr/include/stdio.h:906,
                 from emit_lua.c:1:
In function ‘sprintf’,
    inlined from ‘emit_package’ at emit_lua.c:762:5:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:30:10: note: ‘__builtin___sprintf_chk’ output 2 or more bytes (assuming 4097) into a destination of size 4096
   30 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   31 |                                   __glibc_objsize (__s), __fmt,
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   32 |                                   __va_arg_pack ());
      |                                   ~~~~~~~~~~~~~~~~~
emit_lua.c: In function ‘emit_package’:
emit_lua.c:45:13: warning: ‘__builtin_strncpy’ output may be truncated copying between 0 and 4094 bytes from a string of length 4095 [-Wstringop-truncation]
   45 |             strncpy(dirpath, path, i);
      |             ^
make[3]: *** [Makefile:513: emit_cpp.o] Error 1

Here is a simple fix and I uploaded it to mentor:
https://mentors.debian.net/package/lcm/

But jose.luis.rivero.partida has uploaded it with new upstream release
1.5.1 under the same mentor and the issue was fixed already also.

https://mentors.debian.net/package/lcm/ see v1.

So I am not sure situation how to deal with: if we upload 1.5.1 to
unstale maybe we need SOANME bump first, this is disturb currently t64
transition, right? if we fix the FTBFS first within 1.3.1 the patch is
fine.

--
Regards,
--
  Bo YU

diff -Nru lcm-1.3.1+repack1/debian/changelog lcm-1.3.1+repack1/debian/changelog
--- lcm-1.3.1+repack1/debian/changelog	2023-12-07 04:48:38.000000000 +0800
+++ lcm-1.3.1+repack1/debian/changelog	2024-03-22 16:45:50.000000000 +0800
@@ -1,3 +1,10 @@
+lcm (1.3.1+repack1-8) unstable; urgency=medium
+
+  * QA upload.
+  * Fix implicit-function-declaration error issue. (Closes: #1066246)
+
+ -- Bo YU <tsu.yubo@gmail.com>  Fri, 22 Mar 2024 16:45:50 +0800
+
 lcm (1.3.1+repack1-7) unstable; urgency=medium
 
   * QA upload.
diff -Nru lcm-1.3.1+repack1/debian/patches/0006-fix-implicit-function-declaration-issue.patch lcm-1.3.1+repack1/debian/patches/0006-fix-implicit-function-declaration-issue.patch
--- lcm-1.3.1+repack1/debian/patches/0006-fix-implicit-function-declaration-issue.patch	1970-01-01 08:00:00.000000000 +0800
+++ lcm-1.3.1+repack1/debian/patches/0006-fix-implicit-function-declaration-issue.patch	2024-03-22 16:44:30.000000000 +0800
@@ -0,0 +1,27 @@
+Description: fix -Werror=implicit-function-declaration issue
+Author: Bo YU <tsu.yubo@gmail.com>
+Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1066246 
+Forwarded: https://github.com/lcm-proj/lcm/issues/498
+Last-Update: 2024-03-22
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/lcm-logger/lcm_logger.c
++++ b/lcm-logger/lcm_logger.c
+@@ -8,6 +8,7 @@
+ 
+ #include <glib.h>
+ #include <glib/gstdio.h>
++#include <unistd.h>
+ 
+ #include <lcm/lcm.h>
+ 
+--- a/lcmgen/emit_cpp.c
++++ b/lcmgen/emit_cpp.c
+@@ -11,6 +11,7 @@
+ 
+ #include <sys/stat.h>
+ #include <sys/types.h>
++#include <unistd.h>
+ 
+ #include "lcmgen.h"
+ 
diff -Nru lcm-1.3.1+repack1/debian/patches/series lcm-1.3.1+repack1/debian/patches/series
--- lcm-1.3.1+repack1/debian/patches/series	2023-12-06 08:27:57.000000000 +0800
+++ lcm-1.3.1+repack1/debian/patches/series	2024-03-22 14:50:00.000000000 +0800
@@ -4,3 +4,4 @@
 0004-doxygen-docs-go-to-a-subdir.patch
 0005-I-default-to-java-1.6-instead-of-1.5.patch
 remove-epydoc
+0006-fix-implicit-function-declaration-issue.patch

Attachment: signature.asc
Description: PGP signature


Reply to: