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.
Created attachment 862605 [details] build.log
Created attachment 862606 [details] gcc info
Can you include the standalone command for convenience please? Also, please run that command with -save-temps and attach the .ii file. Thanks!
(You'll need to kill it but it should generate one first silently and put it somewhere.)
Created attachment 862619 [details] qcustomplot.cpp.ii.tar.gz qcustomplot.cpp.ii compressed
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
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.
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?
Created attachment 862626 [details] packet-rnsap.c.i compressed
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.
You promise this time? ;) Thanks, let me try!
Reproduced, thank you! Reported upstream at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109983.
Thank you too!
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.