Merge ~sergiodj/ubuntu/+source/open-iscsi:fix-gcc12-ftbfs into ubuntu/+source/open-iscsi:ubuntu/devel

Proposed by Sergio Durigan Junior
Status: Merged
Merged at revision: 7e0a8c21798da373bae56e7c1884109435b5f474
Proposed branch: ~sergiodj/ubuntu/+source/open-iscsi:fix-gcc12-ftbfs
Merge into: ubuntu/+source/open-iscsi:ubuntu/devel
Diff against target: 180 lines (+153/-0)
4 files modified
debian/changelog (+7/-0)
debian/patches/lp1979692-fix-gcc12-ftbfs-01.patch (+99/-0)
debian/patches/lp1979692-fix-gcc12-ftbfs-02.patch (+45/-0)
debian/patches/series (+2/-0)
Reviewer Review Type Date Requested Status
Lucas Kanashiro (community) Approve
Canonical Server Reporter Pending
Canonical Server packageset reviewers Pending
Review via email: mp+425342@code.launchpad.net

Description of the change

This fixes open-iscsi's FTBFS with GCC 12, as reported by Graham here:

https://people.canonical.com/~ginggs/ftbfs-report/test-rebuild-20220617-kinetic-gcc12-kinetic.html#ubuntu-server-pkgset

Upstream has fixes for this (https://github.com/open-iscsi/open-iscsi/pull/297), which have been released as part of v2.1.6, so this is just a backport.

I set up a special PPA that depends on Foundation's "volatile" and "binutils" PPAs (which contain GCC 12 and binutils 2.38) here:

https://launchpad.net/~sergiodj/+archive/ubuntu/gcc12-ftbfs

I will post the autopkgtest results as soon as I have them.

To post a comment you must log in.
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Results from https://autopkgtest.ubuntu.com/results/autopkgtest-kinetic-sergiodj-gcc12-ftbfs/?format=plain:
  open-iscsi @ amd64:
    23.06.22 22:51:28 Log πŸ—’οΈ βœ… Triggers: ['open-iscsi/2.1.5-1ubuntu2~ppa2']
  open-iscsi @ arm64:
    23.06.22 22:47:09 Log πŸ—’οΈ βœ… Triggers: ['open-iscsi/2.1.5-1ubuntu2~ppa2']
  open-iscsi @ armhf:
    23.06.22 22:29:04 Log πŸ—’οΈ βœ… Triggers: ['open-iscsi/2.1.5-1ubuntu2~ppa2']
  open-iscsi @ ppc64el:
    23.06.22 22:38:10 Log πŸ—’οΈ βœ… Triggers: ['open-iscsi/2.1.5-1ubuntu2~ppa2']
  open-iscsi @ s390x:
    23.06.22 22:32:55 Log πŸ—’οΈ βœ… Triggers: ['open-iscsi/2.1.5-1ubuntu2~ppa2']

Revision history for this message
MichaΕ‚ MaΕ‚oszewski (michal-maloszewski99) :
Revision history for this message
Sergio Durigan Junior (sergiodj) :
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

LGTM, +1.

review: Approve
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

On Friday, June 24 2022, Lucas Kanashiro wrote:

> Review: Approve
>
> LGTM, +1.

$ dput open-iscsi_2.1.5-1ubuntu2_source.changes
Trying to upload package to ubuntu
Checking signature on .changes
gpg: /home/sergio/work/open-iscsi/open-iscsi_2.1.5-1ubuntu2_source.changes: Valid signature from 106DA1C8C3CBBF14
Checking signature on .dsc
gpg: /home/sergio/work/open-iscsi/open-iscsi_2.1.5-1ubuntu2.dsc: Valid signature from 106DA1C8C3CBBF14
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading open-iscsi_2.1.5-1ubuntu2.dsc: done.
  Uploading open-iscsi_2.1.5-1ubuntu2.debian.tar.xz: done.
  Uploading open-iscsi_2.1.5-1ubuntu2_source.buildinfo: done.
  Uploading open-iscsi_2.1.5-1ubuntu2_source.changes: done.
Successfully uploaded packages.

--
Sergio
GPG key ID: E92F D0B3 6B14 F1F4 D8E0 EB2F 106D A1C8 C3CB BF14

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index b1bd9d9..adbc089 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+open-iscsi (2.1.5-1ubuntu2) kinetic; urgency=medium
7+
8+ * d/p/lp1979692-fix-gcc12-ftbfs-0*.patch: Fix FTBFS with GCC 12.
9+ (LP: #1979692)
10+
11+ -- Sergio Durigan Junior <sergio.durigan@canonical.com> Thu, 23 Jun 2022 17:28:56 -0400
12+
13 open-iscsi (2.1.5-1ubuntu1) jammy; urgency=medium
14
15 * Merge with Debian unstable (LP: #1946835). Remaining changes:
16diff --git a/debian/patches/lp1979692-fix-gcc12-ftbfs-01.patch b/debian/patches/lp1979692-fix-gcc12-ftbfs-01.patch
17new file mode 100644
18index 0000000..c97e8af
19--- /dev/null
20+++ b/debian/patches/lp1979692-fix-gcc12-ftbfs-01.patch
21@@ -0,0 +1,99 @@
22+From: Lee Duncan <lduncan@suse.com>
23+Date: Tue, 25 Jan 2022 10:11:58 -0800
24+Subject: Fix issues discovered by gcc12
25+
26+Gcc-12 caught a few errors in the code where we were checking
27+for an array being empty incorrectly, so this commit fixes those.
28+
29+Origin: upstream, https://github.com/open-iscsi/open-iscsi/commit/151e701d08e16dce545d017e57c3d5ac957b7c1e
30+Bug: https://github.com/open-iscsi/open-iscsi/issues/296
31+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/open-iscsi/+bug/1979692
32+Applied-Upstream: 2.1.6
33+---
34+ usr/auth.c | 3 +--
35+ usr/login.c | 18 +++++++++---------
36+ 2 files changed, 10 insertions(+), 11 deletions(-)
37+
38+diff --git a/usr/auth.c b/usr/auth.c
39+index 2f7506f..46c328e 100644
40+--- a/usr/auth.c
41++++ b/usr/auth.c
42+@@ -109,7 +109,7 @@ acl_chap_auth_request(struct iscsi_acl *client, char *username, unsigned int id,
43+ unsigned char verify_data[client->chap_challenge_len];
44+
45+ /* the expected credentials are in the session */
46+- if (session->username_in == NULL) {
47++ if (session->username_in[0] == '\0') {
48+ log_error("failing authentication, no incoming username "
49+ "configured to authenticate target %s",
50+ session->target_name);
51+@@ -122,7 +122,6 @@ acl_chap_auth_request(struct iscsi_acl *client, char *username, unsigned int id,
52+ }
53+
54+ if ((session->password_in_length < 1) ||
55+- (session->password_in == NULL) ||
56+ (session->password_in[0] == '\0')) {
57+ log_error("failing authentication, no incoming password "
58+ "configured to authenticate target %s",
59+diff --git a/usr/login.c b/usr/login.c
60+index 8af8756..096deda 100644
61+--- a/usr/login.c
62++++ b/usr/login.c
63+@@ -657,7 +657,7 @@ iscsi_process_login_response(iscsi_session_t *session, int cid,
64+ struct iscsi_acl *auth_client;
65+ iscsi_conn_t *conn = &session->conn[cid];
66+
67+- auth_client = (session->auth_buffers && session->num_auth_buffers) ?
68++ auth_client = (session->num_auth_buffers > 0) ?
69+ (struct iscsi_acl *)session->auth_buffers[0].address : NULL;
70+
71+ end = text + ntoh24(login_rsp->dlength) + 1;
72+@@ -1135,7 +1135,7 @@ iscsi_make_login_pdu(iscsi_session_t *session, int cid, struct iscsi_hdr *hdr,
73+ struct iscsi_acl *auth_client;
74+ iscsi_conn_t *conn = &session->conn[cid];
75+
76+- auth_client = (session->auth_buffers && session->num_auth_buffers) ?
77++ auth_client = (session->num_auth_buffers > 0) ?
78+ (struct iscsi_acl *)session->auth_buffers[0].address : NULL;
79+
80+ /* initialize the PDU header */
81+@@ -1170,7 +1170,7 @@ iscsi_make_login_pdu(iscsi_session_t *session, int cid, struct iscsi_hdr *hdr,
82+ return 0;
83+ }
84+
85+- if ((session->target_name && session->target_name[0]) &&
86++ if ((session->target_name[0] != '\0') &&
87+ (session->type == ISCSI_SESSION_TYPE_NORMAL)) {
88+ if (!iscsi_add_text(hdr, data, max_data_length,
89+ "TargetName", session->target_name))
90+@@ -1248,16 +1248,16 @@ check_for_authentication(iscsi_session_t *session,
91+ return LOGIN_FAILED;
92+ }
93+
94+- if (session->username &&
95++ if ((session->username[0] != '\0') &&
96+ (acl_set_user_name(auth_client, session->username) !=
97+- AUTH_STATUS_NO_ERROR)) {
98++ AUTH_STATUS_NO_ERROR)) {
99+ log_error("Couldn't set username");
100+ goto end;
101+ }
102+
103+- if (session->password && (acl_set_passwd(auth_client,
104+- session->password, session->password_length) !=
105+- AUTH_STATUS_NO_ERROR)) {
106++ if ((session->password[0] != '\0') &&
107++ (acl_set_passwd(auth_client, session->password, session->password_length) !=
108++ AUTH_STATUS_NO_ERROR)) {
109+ log_error("Couldn't set password");
110+ goto end;
111+ }
112+@@ -1366,7 +1366,7 @@ iscsi_login_begin(iscsi_session_t *session, iscsi_login_context_t *c)
113+ conn->current_stage = ISCSI_INITIAL_LOGIN_STAGE;
114+ conn->partial_response = 0;
115+
116+- if (session->auth_buffers && session->num_auth_buffers) {
117++ if (session->num_auth_buffers > 0) {
118+ c->ret = check_for_authentication(session, c->auth_client);
119+ if (c->ret != LOGIN_OK)
120+ return 1;
121diff --git a/debian/patches/lp1979692-fix-gcc12-ftbfs-02.patch b/debian/patches/lp1979692-fix-gcc12-ftbfs-02.patch
122new file mode 100644
123index 0000000..159412f
124--- /dev/null
125+++ b/debian/patches/lp1979692-fix-gcc12-ftbfs-02.patch
126@@ -0,0 +1,45 @@
127+From: Lee Duncan <lduncan@suse.com>
128+Date: Wed, 26 Jan 2022 11:44:09 -0800
129+Subject: Fix more issues discovered by gcc12
130+
131+Gcc-12 caught a few more errors in the code, where we are
132+still checking an array address for NULL, which will never
133+happen.
134+
135+Origin: upstream, https://github.com/open-iscsi/open-iscsi/commit/1cab1efc813f750f9fa68e35dc16e8e54a1ba1e8
136+Bug: https://github.com/open-iscsi/open-iscsi/issues/296
137+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/open-iscsi/+bug/1979692
138+Applied-Upstream: 2.1.6
139+---
140+ usr/discovery.c | 2 +-
141+ usr/iscsi_sysfs.c | 4 ++--
142+ 2 files changed, 3 insertions(+), 3 deletions(-)
143+
144+diff --git a/usr/discovery.c b/usr/discovery.c
145+index 7dec696..587af6d 100644
146+--- a/usr/discovery.c
147++++ b/usr/discovery.c
148+@@ -623,7 +623,7 @@ add_target_record(char *name, char *end, discovery_rec_t *drec,
149+
150+ /* if no address is provided, use the default */
151+ if (text >= end) {
152+- if (drec->address == NULL) {
153++ if (drec->address[0] == '\0') {
154+ log_error("no default address known for target %s",
155+ name);
156+ return 0;
157+diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c
158+index abefde2..8bc1f57 100644
159+--- a/usr/iscsi_sysfs.c
160++++ b/usr/iscsi_sysfs.c
161+@@ -1416,8 +1416,8 @@ int iscsi_sysfs_get_sessioninfo_by_id(struct session_info *info, char *session)
162+ log_debug(7, "found targetname %s address %s pers address %s port %d "
163+ "pers port %d driver %s iface name %s ipaddress %s "
164+ "netdev %s hwaddress %s iname %s",
165+- info->targetname, info->address ? info->address : "NA",
166+- info->persistent_address ? info->persistent_address : "NA",
167++ info->targetname, info->address[0] ? info->address : "NA",
168++ info->persistent_address[0] ? info->persistent_address : "NA",
169+ info->port, info->persistent_port, info->iface.transport_name,
170+ info->iface.name, info->iface.ipaddress,
171+ info->iface.netdev, info->iface.hwaddress,
172diff --git a/debian/patches/series b/debian/patches/series
173index e3bb90a..33b358e 100644
174--- a/debian/patches/series
175+++ b/debian/patches/series
176@@ -1,2 +1,4 @@
177 lp1755858-default-iscsid_conf-to-iscsid_socket.patch
178 fix-ftbfs-strcpy-destination-size.patch
179+lp1979692-fix-gcc12-ftbfs-01.patch
180+lp1979692-fix-gcc12-ftbfs-02.patch

Subscribers

People subscribed via source and target branches