Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1500862

Summary: DW_AT_decl_file and DW_AT_decl_line incorrectly generated
Product: [Fedora] Fedora Reporter: Yauheni Kaliuta <ykaliuta>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 26CC: aoliva, davejohansen, fweimer, jakub, jwakely, law, mpolacek, skozina, ykaliuta
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: gcc-7.3.1-2.fc26 gcc-7.3.1-2.fc27 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-06 10:51:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Preprocessed source none

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:11 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.