Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751868AbeACN73 (ORCPT + 1 other); Wed, 3 Jan 2018 08:59:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41450 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751849AbeACN71 (ORCPT ); Wed, 3 Jan 2018 08:59:27 -0500 Date: Wed, 3 Jan 2018 07:59:24 -0600 From: Josh Poimboeuf To: Markus Cc: Greg Kroah-Hartman , lkml , Ingo Molnar Subject: Re: objtool segfault with ORC unwinder enabled Message-ID: <20180103135924.ajpb5kslhkwtd5gb@treble> References: <1537667.mbZVOcHbLR@markus> <20180103111941.GB5412@kroah.com> <1954665.Z2ZbY5be2g@markus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1954665.Z2ZbY5be2g@markus> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 03 Jan 2018 13:59:27 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Wed, Jan 03, 2018 at 01:22:07PM +0100, Markus wrote: > On Wed, Jan 03, 2018 at 12:19:41 CET Greg Kroah-Hartman wrote: > > On Wed, Jan 03, 2018 at 11:49:08AM +0100, Markus wrote: > > > Hello! > > > > > > ORC unwinder is enabled in stable for wider testing but still at least one > > > bug is open: > > > https://bugzilla.kernel.org/show_bug.cgi?id=197035 > > > > Random web links on mailing lists don't help much, please put the > > information here in the email. > > Its not a random web link. Its the official kernel.org bugtracker. But nobody > seems to be looking at it. > > > > objtool will segfault because a NULL pointer is dereferenced. > > > > And how are you reproducing this? > > Just building the kernel with ORC enabled. > (At least for me. Using framepointers compiles, enabling ORC again breaks it.) > gcc 6.4.0 (In bug report others were tested as well.) > elfutils 0.170 > What else may be interesting? > > > > Is a NULL pointer sym valid? > > > If a NULL pointer is invalid, it has to be checked why it is sometimes > > > NULL. > > What .config is triggering this problem? > See attachment. > > > And does this show up on 4.14.11, and 4.15-rc6? > Both: yes. > > /tools/objtool/objtool orc generate --no-fp "arch/x86/kernel/irq.o" > > => segfault. > > Changing CFLAGS for objtool to O1 and starting from gdb: > > (gdb) r orc generate --no-fp "arch/x86/kernel/irq.o" > Starting program: tools/objtool/objtool orc generate --no-fp "arch/x86/kernel/ > irq.o" > > Program received signal SIGSEGV, Segmentation fault. > 0x000055555555e06c in elf_rebuild_rela_section (sec=sec@entry=0x7ffff690d010) > at elf.c:554 > 554 relas[idx].r_info = GELF_R_INFO(rela->sym->idx, rela- > >type); > (gdb) bt > #0 0x000055555555e06c in elf_rebuild_rela_section > (sec=sec@entry=0x7ffff690d010) at elf.c:554 > #1 0x000055555555d0aa in create_orc_sections (file=file@entry=0x7ffffff7d740) > at orc_gen.c:210 > #2 0x000055555555c146 in check (_objname=, _no_fp= out>, no_unreachable=, orc=orc@entry=true) at check.c:1971 > #3 0x000055555555811f in cmd_orc (argc=, argv=0x7fffffffd8d8) > at builtin-orc.c:54 > #4 0x000055555555f490 in handle_internal_command (argv=0x7fffffffd8d0, > argc=4) at objtool.c:108 > #5 main (argc=4, argv=0x7fffffffd8d0) at objtool.c:131 > (gdb) p rela->sym > $1 = (struct symbol *) 0x0 Hi Markus, I'm unable to recreate. Can you attach one of the .o files (like the above irq.o)? -- Josh