Bug#1066629: ucspi-tcp: FTBFS: tcpserver.c:143:29: error: implicit declaration of function ‘getpid’ [-Werror=implicit-function-declaration]

2024-04-12 Thread Peter Pentchev
On Fri, Apr 12, 2024 at 02:56:02PM -0600, Zixing Liu wrote:
> Package: ucspi-tcp
> Followup-For: Bug #1066629
> User: ubuntu-de...@lists.ubuntu.com
> Usertags: origin-ubuntu noble ubuntu-patch
> Control: tags -1 patch
> 
> Dear Maintainer,
> 
> In Ubuntu, the attached patch was applied to achieve the following:
> 
>   * debian/patches/0006-implicit-declarations.patch: Add missing
> includes and prototypes.  Closes LP: #2061188.
>   * debian/ipv6-support.patch: Refresh deferred patch.

OK, this is a little creepy :) I am staring at my work-in-progress update of
the ucspi-tcp package and I see a patch named 0006-implicit-declarations.patch 
and
an update to the ipv6-support one :) But mine was not completely done yet,
while yours seems to be.

(and yes, of course, the patch naming is logical)

> Thanks for considering the patch.

Thanks! I will probably upload a new ucspi-tcp version in a couple of days.

G'luck,
Peter

-- 
Peter Pentchev  r...@ringlet.net r...@debian.org p...@storpool.com
PGP key:http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13


signature.asc
Description: PGP signature


Bug#1066629: ucspi-tcp: FTBFS: tcpserver.c:143:29: error: implicit declaration of function ‘getpid’ [-Werror=implicit-function-declaration]

2024-04-12 Thread Zixing Liu
Package: ucspi-tcp
Followup-For: Bug #1066629
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu noble ubuntu-patch
Control: tags -1 patch

Dear Maintainer,

In Ubuntu, the attached patch was applied to achieve the following:

  * debian/patches/0006-implicit-declarations.patch: Add missing
includes and prototypes.  Closes LP: #2061188.
  * debian/ipv6-support.patch: Refresh deferred patch.


Thanks for considering the patch.


-- System Information:
Debian Release: bookworm/sid
  APT prefers jammy-updates
  APT policy: (500, 'jammy-updates'), (500, 'jammy-security'), (500, 'jammy'), 
(100, 'jammy-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.5.0-26-generic (SMP w/10 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_CA:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff -Nru ucspi-tcp-0.88/debian/ipv6-support.patch 
ucspi-tcp-0.88/debian/ipv6-support.patch
--- ucspi-tcp-0.88/debian/ipv6-support.patch2024-02-27 02:57:42.0 
-0700
+++ ucspi-tcp-0.88/debian/ipv6-support.patch2024-04-12 14:19:46.0 
-0600
@@ -741,7 +741,7 @@
 index 0948b1a..f06c5a8 100644
 --- a/dns.h
 +++ b/dns.h
-@@ -34,51 +34,60 @@ struct dns_transmit {
+@@ -34,51 +34,61 @@ struct dns_transmit {
unsigned int curserver;
struct taia deadline;
unsigned int pos;
@@ -812,6 +812,7 @@
 -extern int dns_mx_packet(stralloc *,char *,unsigned int);
 -extern int dns_mx(stralloc *,stralloc *);
 +extern int dns_name4(stralloc *,const char *);
++extern int dns_name6(stralloc *,char *);
 +extern int dns_txt_packet(stralloc *,const char *,unsigned int);
 +extern int dns_txt(stralloc *,const stralloc *);
 +extern int dns_mx_packet(stralloc *,const char *,unsigned int);
@@ -1330,11 +1331,6 @@
 index b9892b4..2158ed4 100644
 --- a/dns_random.c
 +++ b/dns_random.c
-@@ -1,3 +1,4 @@
-+#include 
- #include "dns.h"
- #include "taia.h"
- #include "uint32.h"
 @@ -29,7 +30,7 @@ static void surf(void)
}
  }
@@ -1433,8 +1429,8 @@
 index 6f215ac..b0c8e6d 100644
 --- a/dns_rcrw.c
 +++ b/dns_rcrw.c
-@@ -1,16 +1,17 @@
-+#include 
+@@ -1,16 +1,16 @@
+ #include 
  #include "taia.h"
 -#include "env.h"
  #include "byte.h"
@@ -1511,17 +1507,7 @@
 index df12826..9511511 100644
 --- a/dns_transmit.c
 +++ b/dns_transmit.c
-@@ -1,12 +1,15 @@
-+#include 
-+#include 
-+#include 
-+#include 
- #include "socket.h"
--#include "alloc.h"
--#include "error.h"
-+#include 
- #include "byte.h"
--#include "readwrite.h"
+@@ -7,7 +7,8 @@
  #include "uint16.h"
  #include "dns.h"
 +#include "ip6.h"
@@ -1985,7 +1971,7 @@
 +#include "byte.h"
 +
 +extern unsigned int scan_ip6(const char *src,char *ip);
-+extern unsigned int fmt_ip6(char *dest,const char *ip);
++extern unsigned int ip6_fmt(char *dest,char *ip);
 +
 +extern unsigned int scan_ip6_flat(const char *src,char *);
 +extern unsigned int fmt_ip6_flat(char *dest,const char *);
@@ -2357,7 +2343,8 @@
 index 000..cf3b7c1
 --- /dev/null
 +++ b/remoteinfo6.c
-@@ -0,0 +1,98 @@
+@@ -0,0 +1,99 @@
++#include 
 +#include "fmt.h"
 +#include "buffer.h"
 +#include "socket.h"
@@ -3065,7 +3052,8 @@
 index 000..74099e2
 --- /dev/null
 +++ b/socket_tcp6.c
-@@ -0,0 +1,44 @@
+@@ -0,0 +1,45 @@
++#include 
 +#include 
 +#include 
 +#include 
diff -Nru ucspi-tcp-0.88/debian/patches/0006-implicit-declarations.patch 
ucspi-tcp-0.88/debian/patches/0006-implicit-declarations.patch
--- ucspi-tcp-0.88/debian/patches/0006-implicit-declarations.patch  
1969-12-31 17:00:00.0 -0700
+++ ucspi-tcp-0.88/debian/patches/0006-implicit-declarations.patch  
2024-04-12 14:33:32.0 -0600
@@ -0,0 +1,356 @@
+Description: Add missing includes and prototypes
+Author: Zixing Liu 
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1066629
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/ucspi-tcp/+bug/2061188
+Forwarded: no
+Last-Update: 2024-04-12
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: ucspi-tcp/dns_random.c
+===
+--- ucspi-tcp.orig/dns_random.c
 ucspi-tcp/dns_random.c
+@@ -1,3 +1,4 @@
++#include 
+ #include "dns.h"
+ #include "taia.h"
+ #include "uint32.h"
+Index: ucspi-tcp/dns_rcrw.c
+===
+--- ucspi-tcp.orig/dns_rcrw.c
 ucspi-tcp/dns_rcrw.c
+@@ -1,3 +1,4 @@
++#include 
+ #include "taia.h"
+ #include "env.h"
+ #include "byte.h"
+Index: ucspi-tcp/remoteinfo.c
+===
+--- ucspi-tcp.orig/remoteinfo.c
 ucspi-tcp/remoteinfo.c
+@@ -1,3 +1,4 @@
++#include 
+ #include "fmt.h"
+ #include "buffer.h"
+ #include "socket.h"
+Index: ucspi-tcp/tcpserver.c
+===
+--- ucspi-tcp.orig/tcpserver.c
 

Bug#1066629: ucspi-tcp: FTBFS: tcpserver.c:143:29: error: implicit declaration of function ‘getpid’ [-Werror=implicit-function-declaration]

2024-03-13 Thread Lucas Nussbaum
Source: ucspi-tcp
Version: 1:0.88-8
Severity: serious
Justification: FTBFS
Tags: trixie sid ftbfs
User: lu...@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):
> x86_64-linux-gnu-gcc -g -O2 -Werror=implicit-function-declaration 
> -ffile-prefix-map=/<>=. -fstack-protector-strong 
> -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection 
> -Wdate-time -D_FORTIFY_SOURCE=2 -c tcpserver.c
> tcpserver.c: In function ‘doit’:
> tcpserver.c:143:29: error: implicit declaration of function ‘getpid’ 
> [-Werror=implicit-function-declaration]
>   143 | strnum[fmt_ulong(strnum,getpid())] = 0;
>   | ^~
> tcpserver.c:148:5: error: implicit declaration of function 
> ‘socket_ipoptionskill’ [-Werror=implicit-function-declaration]
>   148 | socket_ipoptionskill(t);
>   | ^~~~
> tcpserver.c:150:5: error: implicit declaration of function 
> ‘socket_tcpnodelay’ [-Werror=implicit-function-declaration]
>   150 | socket_tcpnodelay(t);
>   | ^
> tcpserver.c:210:7: error: implicit declaration of function ‘close’ 
> [-Werror=implicit-function-declaration]
>   210 |   close(fdrules);
>   |   ^
> tcpserver.c: At top level:
> tcpserver.c:292:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
>   292 | main(int argc,char **argv)
>   | ^~~~
> tcpserver.c: In function ‘main’:
> tcpserver.c:408:12: error: implicit declaration of function ‘fork’ 
> [-Werror=implicit-function-declaration]
>   408 | switch(fork()) {
>   |^~~~
> cc1: some warnings being treated as errors
> make[2]: *** [Makefile:759: tcpserver.o] Error 1


The full build log is available from:
http://qa-logs.debian.net/2024/03/13/ucspi-tcp_0.88-8_unstable.log

All bugs filed during this archive rebuild are listed at:
https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=ftbfs-20240313;users=lu...@debian.org
or:
https://udd.debian.org/bugs/?release=na=ign=7=7=only=ftbfs-20240313=lu...@debian.org=1=1=1=1#results

A list of current common problems and possible solutions is available at
http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute!

If you reassign this bug to another package, please mark it as 'affects'-ing
this package. See https://www.debian.org/Bugs/server-control#affects

If you fail to reproduce this, please provide a build log and diff it with mine
so that we can identify if something relevant changed in the meantime.