Bug 1500862 - DW_AT_decl_file and DW_AT_decl_line incorrectly generated
Summary: DW_AT_decl_file and DW_AT_decl_line incorrectly generated
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 26
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-10-11 15:34 UTC by Yauheni Kaliuta
Modified: 2018-02-06 15:32 UTC (History)
9 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2018-02-06 10:51:05 UTC


Attachments (Terms of Use)
Preprocessed source (2.15 MB, text/plain)
2017-10-11 16:23 UTC, Yauheni Kaliuta
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
GNU Compiler Collection 83550 None None None 2018-01-01 12:42 UTC

Description Yauheni Kaliuta 2017-10-11 15:34:56 UTC
Looks like we hit a bug pretty similar to the old one  https://bugzilla.redhat.com/show_bug.cgi?id=1423460

With the current Fedora (26) gcc (gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)) at least during the kernel build for some symbols in some CUs the attributes point to the forward declaration:

$ readelf --debug-dump kernel/fork.o:

 <1><7ccd>: Abbrev Number: 72 (DW_TAG_structure_type)
    <7cce>   DW_AT_name        : (indirect string, offset: 0x72c4): user_namespace
    <7cd2>   DW_AT_byte_size   : 480
    <7cd4>   DW_AT_decl_file   : 165
    <7cd5>   DW_AT_decl_line   : 17
    <7cd6>   DW_AT_sibling     : <0x7dc6>
...

  165   2       0       0       uidgid.h

The source code is (include/linux/uidgid.h):

14 #include <linux/types.h>
15 #include <linux/highuid.h>
16
17 struct user_namespace;
18 extern struct user_namespace init_user_ns;

(in the final vmlinux it points to the same file)


When with the RHEL gcc it points to include/linux/user_namespace.h:47 (correctly).

Comment 1 Jakub Jelinek 2017-10-11 15:40:04 UTC
Please provide preprocessed source (fork.i) and gcc options used to compile that file.

Comment 2 Yauheni Kaliuta 2017-10-11 16:23 UTC
Created attachment 1337297 [details]
Preprocessed source

fork.i generation:

make -f scripts/Makefile.build obj=kernel kernel/fork.i
  gcc -E -Wp,-MD,kernel/.fork.i.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/7/include -I./arch/x86/include -Iarch/x86/include/generated  -Iinclude -I./arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -std=gnu89 -O2 -m64 -mno-mmx -mno-sse -mpreferred-stack-boundary=3 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -Wframe-larger-than=2048 -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -DCONFIG_AS_AVX512=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -pg -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -DCC_HAVE_ASM_GOTO    -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(fork)"  -D"KBUILD_MODNAME=KBUILD_STR(fork)" -o kernel/fork.i kernel/fork.c


fork.o generation

make -f scripts/Makefile.build obj=kernel kernel/fork.o
  gcc -Wp,-MD,kernel/.fork.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/7/include -I./arch/x86/include -Iarch/x86/include/generated  -Iinclude -I./arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -std=gnu89 -O2 -m64 -mno-mmx -mno-sse -mpreferred-stack-boundary=3 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -Wframe-larger-than=2048 -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -DCONFIG_AS_AVX512=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -pg -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -DCC_HAVE_ASM_GOTO    -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(fork)"  -D"KBUILD_MODNAME=KBUILD_STR(fork)" -c -o kernel/.tmp_fork.o kernel/fork.c
  if [ "-pg" = "-pg" ]; then if [ kernel/fork.o != "scripts/mod/empty.o" ]; then ./scripts/recordmcount  "kernel/fork.o"; fi; fi;

Comment 3 Fedora Update System 2018-01-31 07:49:55 UTC
gcc-7.3.1-2.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-75d88970d0

Comment 4 Fedora Update System 2018-01-31 07:56:19 UTC
gcc-7.3.1-2.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2018-aa879be08e

Comment 5 Fedora Update System 2018-01-31 18:43:30 UTC
gcc-7.3.1-2.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-aa879be08e

Comment 6 Fedora Update System 2018-01-31 22:46:23 UTC
gcc-7.3.1-2.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-75d88970d0

Comment 7 Fedora Update System 2018-02-06 10:51:05 UTC
gcc-7.3.1-2.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2018-02-06 15:32:30 UTC
gcc-7.3.1-2.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.