Chew segmentation fault while building on Ubuntu/Debian

Tiberiu Chibici chibicitiberiu@gmail.com
Sat Jan 8 13:18:02 GMT 2022


Hello Alan,

I finally figured it out! The problem was that some of the variables in my
makefile (CC, CFLAGS, LD etc) were being applied to the binutils build.
After clearing these (by running CC= CFLAGS= LD= ./configure ...), the
problem was gone.

Thank you very much for your help, and best regards.
Tiberiu Chibici



On Sat, Jan 8, 2022 at 4:57 AM Mike Frysinger <vapier@gentoo.org> wrote:

> On 08 Jan 2022 04:38, Tiberiu Chibici via Binutils wrote:
> > I have some more information about this issue, another person running
> > Ubuntu 20.04.3 LTS was able to reproduce the same issue (using WSL).
> Also,
> > I tried to debug the issue in GDB, and this seems to be the origin of the
> > segmentation fault. Is there anything else I can help with to get closer
> to
> > the source of the problem?
> >
> > (gdb) run -f ../../../binutils-2.37/bfd/doc/doc.str <
> > ../../../binutils-2.37/bfd/doc/../archures.c
>
> the chew program is extremely simple.  you can enable more debugging info:
> $ cd bfd/doc
> $ make clean
> $ make CC_FOR_BUILD='gcc -O0 -ggdb3 -fsanitize=address'
> $ ./chew -f ../../../binutils-2.37/bfd/doc/doc.str <
> ../../../binutils-2.37/bfd/doc/../archures.c
>
> see if that triggers a failure with more logging.
>
> > Starting program:
> >
> /home/tibi/Nanobyte/nanobyte_os_with_interrupts/toolchain/binutils-build-2.37/bfd/doc/chew
> > -f ../../../binutils-2.37/bfd/doc/doc.str <
> > ../../../binutils-2.37/bfd/doc/../archures.c
> > [Thread debugging using libthread_db enabled]
> > Using host libthread_db library
> "/lib/x86_64-linux-gnu/libthread_db.so.1".
> >
> > Program received signal SIGSEGV, Segmentation fault.
> > __strcmp_avx2 () at ../sysdeps/x86_64/multiarch/strcmp-avx2.S:105
> > 105     ../sysdeps/x86_64/multiarch/strcmp-avx2.S: No such file or
> > directory.
> > (gdb) bt
> > #0  __strcmp_avx2 () at ../sysdeps/x86_64/multiarch/strcmp-avx2.S:105
> > #1  0x00005555555575a1 in lookup_word (word=0x55555555f890
> > "skip_past_newline") at ../../../binutils-2.37/bfd/doc/chew.c:1242
>
> you can set a break on lookup_word and see what the *root tree looks like.
> -mike
>


-- 
Chibici Tiberiu


More information about the Binutils mailing list