Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 877711 - =media-libs/zvbi-0.2.35-r2: undefined behavior with aggressive loop optimizations
Summary: =media-libs/zvbi-0.2.35-r2: undefined behavior with aggressive loop optimizat...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-20 05:26 UTC by Jocelyn Mayer
Modified: 2023-02-06 23:49 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Output from emerge --info =media-libs/zvbi-0.2.35-r2 (S1-emerge-infos,24.88 KB, text/plain)
2022-10-20 05:28 UTC, Jocelyn Mayer
Details
Emerge failure build log (zvbi-0.2.35-r2:20221020-005854.log,269.40 KB, text/plain)
2022-10-20 05:29 UTC, Jocelyn Mayer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jocelyn Mayer 2022-10-20 05:26:22 UTC
While building zvbi using gcc (clang untested) with
 -faggressive-loop-optimizations CFLAG set, I get this kind of message:
iteration 24 invokes undefined behavior in src/xds_demux.c

Then, forcing adding -fno-aggressive-loop-optimizations
and -fno--unsafe-loop-optimizations too all flags (for safety) solves the issue.

Reproducible: Always

Steps to Reproduce:
1.Put -faggressive-loop-optimizations -Wno-aggressive-loop-optimizations in compilation flags
2. Emerge media-libs/zvbi
3. See the output
Actual Results:  
I got the 'undefined behavior' warning message

Expected Results:  
It seems better not to have any undefined behavior.

Seems like it has been long reported upstream:
https://sourceforge.net/p/zapping/bugs/201/
Comment 1 Jocelyn Mayer 2022-10-20 05:28:10 UTC
Created attachment 824823 [details]
Output from emerge --info =media-libs/zvbi-0.2.35-r2
Comment 2 Jocelyn Mayer 2022-10-20 05:29:10 UTC
Created attachment 824825 [details]
Emerge failure build log
Comment 3 Jocelyn Mayer 2022-10-20 05:30:50 UTC
The thing I did to solve this issue is to create a file in /etc/portage/env with the following and use it for zvbi adding a reference in /etc/portage/package.env

ADD_FLAGS="-fno-aggressive-loop-optimizations -fno-unsafe-loop-optimizations"
CFLAGS="${CFLAGS} ${ADD_FLAGS} "
CXXFLAGS="${CXXFLAGS} ${ADD_FLAGS}"
FCFLAGS="${FCFLAGS} ${ADD_FLAGS}"
FFLAGS="${FFLAGS} ${ADD_FLAGS}"
LDFLAGS="${LDFLAGS} ${ADD_FLAGS}"