Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 907182 - sys-devel/gcc: >= gcc 12 hangs when compiling net-analyzer/wireshark-4.0.6 with -fipa-pta
Summary: sys-devel/gcc: >= gcc 12 hangs when compiling net-analyzer/wireshark-4.0.6 wi...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-25 17:15 UTC by Kai-Chun Ning
Modified: 2023-06-24 22:58 UTC (History)
1 user (show)

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


Attachments
build.log (build.log,28.87 KB, text/x-log)
2023-05-25 17:17 UTC, Kai-Chun Ning
Details
gcc info (gcc.txt,1.09 KB, text/plain)
2023-05-25 17:19 UTC, Kai-Chun Ning
Details
qcustomplot.cpp.ii.tar.gz (qcustomplot.cpp.ii.tar.gz,945.44 KB, application/gzip)
2023-05-25 23:22 UTC, Kai-Chun Ning
Details
packet-rnsap.c.i compressed (packet-rnsap.c.i.tar.gz,488.78 KB, application/gzip)
2023-05-26 09:06 UTC, Kai-Chun Ning
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kai-Chun Ning 2023-05-25 17:15:46 UTC
Compiling wireshark-4.0.6 with gcc and flag -fipa-pta hangs indefinitely. Compiling wireshark-4.0.5 with the same toolchain did not have this issue.

The source file in question is ui/qt/widgets/qcustomplot.cpp. One can manually trigger the bahavior by issuing the same command in build.log. This command does not return and hangs for hours.

If one removes '-fipa-pta' from the very same command, the compilation succeeds.

It's likely that this is a compiler bug, so please find attached info about my gcc build.
Comment 1 Kai-Chun Ning 2023-05-25 17:17:45 UTC
Created attachment 862605 [details]
build.log
Comment 2 Kai-Chun Ning 2023-05-25 17:19:04 UTC
Created attachment 862606 [details]
gcc info
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-25 20:58:17 UTC
Can you include the standalone command for convenience please?

Also, please run that command with -save-temps and attach the .ii file. Thanks!
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-25 20:58:36 UTC
(You'll need to kill it but it should generate one first silently and put it somewhere.)
Comment 5 Kai-Chun Ning 2023-05-25 23:22:16 UTC
Created attachment 862619 [details]
qcustomplot.cpp.ii.tar.gz

qcustomplot.cpp.ii compressed
Comment 6 Kai-Chun Ning 2023-05-25 23:26:14 UTC
command:

cd /tmp/wireshark-4.0.6_build/ui/qt/CMakeFiles/qtui.dir/widgets && /usr/bin/x86_64-pc-linux-gnu-g++ -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_NETWORK_LIB -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -I/tmp/portage/net-analyzer/wireshark-4.0.6/work/wireshark-4.0.6_build/ui/qt/qtui_autogen/include -I/tmp/portage/net-analyzer/wireshark-4.0.6/work/wireshark-4.0.6_build -I/tmp/portage/net-analyzer/wireshark-4.0.6/work/wireshark-4.0.6 -I/tmp/portage/net-analyzer/wireshark-4.0.6/work/wireshark-4.0.6/include -isystem /usr/include/glib-2.0 -isystem /usr/lib64/glib-2.0/include -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtCore -isystem /usr/lib64/qt5/mkspecs/linux-g++ -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtPrintSupport -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtConcurrent -isystem /usr/include/qt5/QtMultimedia -isystem /usr/include/qt5/QtNetwork -isystem /tmp/portage/net-analyzer/wireshark-4.0.6/work/wireshark-4.0.6_build/ui/qt -isystem /tmp/portage/net-analyzer/wireshark-4.0.6/work/wireshark-4.0.6/ui/qt  -fexcess-precision=fast -Wall -Wextra -Wendif-labels -Wpointer-arith -Wformat-security -fwrapv -fno-strict-overflow -Wvla -Waddress -Wattributes -Wdiv-by-zero -Wignored-qualifiers -Wpragmas -Wno-overlength-strings -Wno-long-long -Wredundant-decls -Wno-error=maybe-uninitialized -Wno-error=alloc-size-larger-than= -Wno-format-truncation -Wframe-larger-than=32768 -fdiagnostics-color=always -Wextra-semi -march=x86-64 -O2 -pipe -fipa-pta -fPIC -DPIC -fmacro-prefix-map=/tmp/portage/net-analyzer/wireshark-4.0.6/work/wireshark-4.0.6/= -fmacro-prefix-map=/tmp/portage/net-analyzer/wireshark-4.0.6/work/wireshark-4.0.6_build/= -std=c++11 -fipa-pta --verbose -fPIC -MD -MT ui/qt/CMakeFiles/qtui.dir/widgets/qcustomplot.cpp.o -MF ui/qt/CMakeFiles/qtui.dir/widgets/qcustomplot.cpp.o.d -o ui/qt/CMakeFiles/qtui.dir/widgets/qcustomplot.cpp.o -c /tmp/portage/net-analyzer/wireshark-4.0.6/work/wireshark-4.0.6/ui/qt/widgets/qcustomplot.cpp -save-temps
Comment 7 Kai-Chun Ning 2023-05-25 23:31:43 UTC
I'm sorry. I should have grabbed a coffee before submitting this bug report.
Manually compiling the qcustomplot.cpp with the command above works. It only hangs during emerge.

I compared qcustomplot.cpp.ii from manual compilation, and from emerge. They are identical.

I have archived the whole wireshark-4.0.6_build dir from emerge. If you need .ii for other sources, please let me know.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-26 01:16:48 UTC
I wonder if it's actually qcustomplot.cpp which is hanging or something just after it? I've had issues like that with make buffering output in the past (with ffmpeg, the hanging command wasn't being shown).

Could you double check via looking at `ps faux` output when it hangs via emerge, perhaps?
Comment 9 Kai-Chun Ning 2023-05-26 09:06:42 UTC
Created attachment 862626 [details]
packet-rnsap.c.i compressed
Comment 10 Kai-Chun Ning 2023-05-26 09:10:15 UTC
You are right about qcustomplot.cpp. With ps faux I can see the cause is epan/dissectors/packet-rnsap.c, and I can manually trigger the issue by running:

/usr/bin/x86_64-pc-linux-gnu-gcc -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES -DWS_BUILD_DLL -I/tmp/portage/net-analyzer/wireshark-4.0.6/work/wireshark-4.0.6_build -I/tmp/portage/net-analyzer/wireshark-4.0.6/work/wireshark-4.0.6 -I/tmp/portage/net-analyzer/wireshark-4.0.6/work/wireshark-4.0.6/include -isystem /usr/include/glib-2.0 -isystem /usr/lib64/glib-2.0/include -isystem /tmp/portage/net-analyzer/wireshark-4.0.6/work/wireshark-4.0.6_build/epan/dissectors -isystem /tmp/portage/net-analyzer/wireshark-4.0.6/work/wireshark-4.0.6/epan/dissectors -isystem /tmp/portage/net-analyzer/wireshark-4.0.6/work/wireshark-4.0.6/epan -fvisibility=hidden -fexcess-precision=fast -Wall -Wextra -Wendif-labels -Wpointer-arith -Wformat-security -fwrapv -fno-strict-overflow -Wvla -Waddress -Wattributes -Wdiv-by-zero -Wignored-qualifiers -Wpragmas -Wno-overlength-strings -Wno-long-long -Wredundant-decls -Wno-error=maybe-uninitialized -Wno-error=alloc-size-larger-than= -Wno-format-truncation -Wframe-larger-than=32768 -fdiagnostics-color=always -Wunused-const-variable -Wshadow -Wold-style-definition -Wstrict-prototypes -Wlogical-op -Werror=implicit -Wno-pointer-sign -march=x86-64 -O2 -save-temps -fipa-pta -fmacro-prefix-map=/tmp/portage/net-analyzer/wireshark-4.0.6/work/wireshark-4.0.6/= -fmacro-prefix-map=/tmp/portage/net-analyzer/wireshark-4.0.6/work/wireshark-4.0.6_build/= -std=gnu11 -fPIC -MD -MT epan/dissectors/CMakeFiles/dissectors.dir/packet-rnsap.c.o -MF epan/dissectors/CMakeFiles/dissectors.dir/packet-rnsap.c.o.d -o epan/dissectors/CMakeFiles/dissectors.dir/packet-rnsap.c.o -c /tmp/portage/net-analyzer/wireshark-4.0.6/work/wireshark-4.0.6/epan/dissectors/packet-rnsap.c

I don't see packet-rnsap.c.ii, only packet-rnsap.c.{i,c.o.d,.s}. Please find packet-rnsap.c.i attached.
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-26 09:13:04 UTC
You promise this time? ;)

Thanks, let me try!
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-26 09:26:46 UTC
Reproduced, thank you!

Reported upstream at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109983.
Comment 13 Kai-Chun Ning 2023-05-26 09:29:12 UTC
Thank you too!
Comment 14 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-06-24 22:58:24 UTC
This should be a fair bit better with:

commit 0608930b1989198a3d5c0b3471a2c4c8e3dc659d (HEAD -> master, origin/master, origin/HEAD)
Author: Sam James <sam@gentoo.org>
Date:   Sat Jun 24 23:47:11 2023 +0100

    sys-devel/gcc: add 13.1.1_p20230624

    Signed-off-by: Sam James <sam@gentoo.org>

as it contains https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109983#c17.

But note the recommendation in the bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109983#c9, i.e. don't use -fipa-pta unconditionally unless you know it helps for a package. Of course though, the bug report is still welcome.