Bug 15095 - Samba with new lorikeet-heimdal fails to build on gcc 12.1 in developer mode
Summary: Samba with new lorikeet-heimdal fails to build on gcc 12.1 in developer mode
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Build (show other bugs)
Version: 4.16.2
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Jule Anger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-14 00:43 UTC by Andrew Bartlett
Modified: 2022-07-18 11:18 UTC (History)
2 users (show)

See Also:


Attachments
Patch for v4-16-test (6.98 KB, patch)
2022-06-14 16:13 UTC, Samuel Cabrero
scabrero: review? (abartlet)
metze: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Bartlett 2022-06-14 00:43:18 UTC
Build a single file with -Wuse-after-free=1 if the compiler supports it to avoid an over-careful check by the compiler.
Comment 1 Samba QA Contact 2022-06-14 10:17:03 UTC
This bug was referenced in samba master:

89e0c732b1c45f6498ed0f39add77c2a52afddce
971441ca5244b0e56f6b664d785fcefa3867ede1
Comment 2 Samuel Cabrero 2022-06-14 16:13:08 UTC
Created attachment 17347 [details]
Patch for v4-16-test
Comment 3 Stefan Metzmacher 2022-07-15 08:36:31 UTC
Comment on attachment 17347 [details]
Patch for v4-16-test

This is wrong!

We need krb5_crypto_cflags.append('-Wno-error=use-after-free')
and it's also needed for other files not just crypto.c (at least) also dcache.c
Comment 4 Stefan Metzmacher 2022-07-15 09:02:00 UTC
(In reply to Stefan Metzmacher from comment #3)

Sorry, I guess I was wrong because I tested it on top of 4.16.0rc1

I guess the key is that -Wuse-after-free=1 will overwrite a default
of -Wuse-after-free=2, is that correct?
Comment 5 Stefan Metzmacher 2022-07-15 09:02:13 UTC
Comment on attachment 17347 [details]
Patch for v4-16-test

Looks good
Comment 6 Samuel Cabrero 2022-07-15 09:26:18 UTC
(In reply to Stefan Metzmacher from comment #4)

> I guess the key is that -Wuse-after-free=1 will overwrite a default
> of -Wuse-after-free=2, is that correct?

Yes, the default is -Wuse-after-free=2 and the patch overrides the default just for one file.
Comment 7 Jule Anger 2022-07-18 07:44:51 UTC
Pushed to autobuild-v4-16-test.
Comment 8 Samba QA Contact 2022-07-18 09:41:11 UTC
This bug was referenced in samba v4-16-test:

3537ef5acbb887495861bb1668876afd69999e74
17451c5a17a8867e9722666a28f14f52810d505a
Comment 9 Jule Anger 2022-07-18 11:02:33 UTC
Closing out bug report.

Thanks!
Comment 10 Samba QA Contact 2022-07-18 11:18:02 UTC
This bug was referenced in samba v4-16-stable (Release samba-4.16.3):

3537ef5acbb887495861bb1668876afd69999e74
17451c5a17a8867e9722666a28f14f52810d505a