Bug 1225852 - Package libgnomesu does not build with gcc14 because of new errors
Summary: Package libgnomesu does not build with gcc14 because of new errors
Status: RESOLVED FIXED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: GNOME (show other bugs)
Version: Current
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Stanislav Brabec
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: modern_C
  Show dependency treegraph
 
Reported: 2024-06-03 14:33 UTC by Martin Jambor
Modified: 2024-07-11 08:15 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Jambor 2024-06-03 14:33:47 UTC
GCC 14 newly by default treats as errors a number of situations which
before were only warnings.  For more information see
https://gcc.gnu.org/gcc-14/porting_to.html and meta bug #1220571.

Because of this, package $PKG fails to compile.  This can be seen online
at:
https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:Gcc7/libgnomesu/standard/x86_64

It can be reproduced locally with command: osc build --clean
--alternative-project home:rguenther:nextgcc


The (first) error (that halts the build) is:

[   20s] xmalloc.c:61:7: error: conflicting types for ‘rpl_realloc’; have ‘void *(char *, size_t)’ {aka ‘void *(char *, long unsigned int)’}
[   20s]    61 | void *rpl_realloc (char *p, size_t n);
[   20s]       |       ^~~~~~~~~~~
[   20s] <command-line>: note: previous declaration of ‘rpl_realloc’ with type ‘void *(void *, size_t)’ {aka ‘void *(void *, long unsigned int)’}
Comment 1 Stanislav Brabec 2024-06-10 22:09:54 UTC
With a correct "losetup -d" in the script, error rate increased to 55 of 20000 attempts. (losetup -d is faster, as it attempts to detach only a single loop device

I stepped forward, and added "losetup -a -l" in case of failure. In the most cases, the device did not exist any more, but in 2/50000 attempts it did.

And what surprise:
NAME       SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE      DIO LOG-SEC
/dev/loop0         0      0         1  0 /root/file.img   0     512

This indicates a problem. It should not be 512.

Digging deeper, calling "losetup -a -l" multiple times, I realized that even if the loop device is created by a single
ioctl(4, LOOP_CONFIGURE, {fd=3, block_size=4096, info={lo_offset=0, lo_number=0, lo_flags=LO_FLAGS_DIRECT_IO, lo_file_name="/root/file1.img", ...}})
internally in the kernel it is created as a basic device, and a latter it sets DIO and logical sector size:

NAME       SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE      DIO LOG-SEC
/dev/loop0         0      0         1  0 /root/file.img   0     512

NAME       SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE      DIO LOG-SEC
/dev/loop0         0      0         0  0 /root/file.img   1    4096

This indicates a bug in the kernel: kernel sometimes fails to sed DIO and logical block size, but but the ioctl returns 0.

And for some reason, that buggy device exists even after "udevadm settle".
Comment 2 Martin Jambor 2024-06-10 22:19:27 UTC
(In reply to Stanislav Brabec from comment #1)
> With a correct "losetup -d" in the script, error rate increased to 55 of
> 20000 attempts. (losetup -d is faster, as it attempts to detach only a
> single loop device
> [...]

Did you perhaps intend to write the above to a different bug?
Comment 3 Stanislav Brabec 2024-06-10 23:38:58 UTC
(In reply to Martin Jambor from comment #2)
> Did you perhaps intend to write the above to a different bug?

Yes, sorry.
Comment 4 Martin Jambor 2024-07-10 16:30:47 UTC
I have created https://build.opensuse.org/request/show/1186647 for this issue.

The patch messes directly with the configure script which generates code
snippets which are not compliant with C99.  I patched directly those, the
patch can be dropped once upstream also encounters GCC 14 and will
re-generate their configure script.
Comment 5 Stanislav Brabec 2024-07-10 23:53:16 UTC
The upstream is dead for a long time. We forked it at https://github.com/openSUSE/libgnomesu, as it is still used in our menu system. I made last several releases.

I'll check where the code comes from and either fix it or re-generate.
Comment 6 Stanislav Brabec 2024-07-11 00:59:16 UTC
Your fix in the upstream:
https://github.com/openSUSE/libgnomesu/commit/2a3e247623693c74284debc3cbfe71f6f6c706e2

Released and submitted. Thanks for your work.
https://build.opensuse.org/request/show/1186721
Comment 7 OBSbugzilla Bot 2024-07-11 08:15:03 UTC
This is an autogenerated message for OBS integration:
This bug (1225852) was mentioned in
https://build.opensuse.org/request/show/1186764 Factory / libgnomesu