bug-m4
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AIX stackoverflow detection hang [was: Reporting m4 bug]


From: Eric Blake
Subject: Re: AIX stackoverflow detection hang [was: Reporting m4 bug]
Date: Fri, 8 Jul 2022 15:24:08 -0500
User-agent: NeoMutt/20220429-157-d20c88

On Tue, Jun 28, 2022 at 01:10:54PM +0000, Neha Jain33 wrote:
> Hi,
> 
> I am trying to build m4 package but its hanging during testcase validation

Thanks for the report.  I'm adding in Bruno, as one of the authors of
the libsigsegv library that the code in lib/stackvma.c is derived
from; perhaps he'll have more ideas on what to test next.

> 
> Package details
> m4 1.4.19
> 
> Machine details
> operating system: AIX/PPC
> oslevel: 7.1.0.0
> 
> what is the issue:
> one of the testcase is hanging
> 
> hanged after this
> PASS: test-sigsegv-catch-segv1
> PASS: test-sigsegv-catch-segv2
> PASS: test-sigsegv-catch-stackoverflow1
> 
> ps -ef output:
> root 11010342  7078448   0 05:44:31  pts/0  0:00 /bin/sh 
> ../build-aux/test-driver --test-name test-sigsegv-catch-stackoverflow2 
> --log-file test-sigsegv-catch-stackoverflow2.log --trs-file 
> test-sigsegv-catch-stackoverflow2.trs --color-tests no --enable-hard-errors 
> yes --expect-failure no -- ./test-sigsegv-catch-stackoverflow2
> root 11927964 11010342  61 05:44:31  pts/0 12:57 
> ./test-sigsegv-catch-stackoverflow2
> 
> If I run this testcase manually its working but if we run it with all test 
> cases then its hanging
> # r-tests no --enable-hard-errors yes --expect-failure no -- 
> ./test-sigsegv-catch-stackoverflow2                                           
>                                                <
> + /bin/sh ../build-aux/test-driver --test-name 
> test-sigsegv-catch-stackoverflow2 --log-file 
> test-sigsegv-catch-stackoverflow2.log --trs-file 
> test-sigsegv-catch-stackoverflow2.trs --color-tests no --enable-hard-errors 
> yes --expect-failure no -- ./test-sigsegv-catch-stackoverflow2
> PASS: test-sigsegv-catch-stackoverflow2
> 
> # ./test-sigsegv-catch-stackoverflow2
> + ./test-sigsegv-catch-stackoverflow2
> Starting recursion pass 1.
> Stack overflow 1 caught.
> Starting recursion pass 2.
> Stack overflow 2 caught.
> Segmentation violation correctly detected.
> Segmentation violation correctly detected.
> Test passed.

That's odd that the test is passing in isolation, but not when run as
part of 'make check'.  Is there something that 'make' is changing in
the environment handed to children that could explain why the test
gets confused when invoked through more layers?

> 
> 
> Info on stack
> attached a process to dbx and found below details
> 
> Waiting to attach to process 7733970 ...
> Successfully attached to test-sigsegv-catch-stackoverflow.
> Type 'help' for help.
> reading symbolic information ...
> stopped in is_mapped at line 621 in file ""
> is_mapped(addr = 9), line 621 in "stackvma.c"
> is_unmapped(addr1 = 4, addr2 = 15), line 768 in "stackvma.c"
> mincore_is_near_this(addr = 10, vma = 0x0000000111001fb8), line 793 in 
> "stackvma.c"
> unnamed block in sigsegv.sigsegv_handler(sig = 11, sip = 0x0000000111002310, 
> ucp = 0x0000000111002060), line 973 in "sigsegv.c"
> unnamed block in sigsegv.sigsegv_handler(sig = 11, sip = 0x0000000111002310, 
> ucp = 0x0000000111002060), line 973 in "sigsegv.c"
> sigsegv.sigsegv_handler(sig = 11, sip = 0x0000000111002310, ucp = 
> 0x0000000111002060), line 973 in "sigsegv.c"
> main(), line 183 in "test-sigsegv-catch-stackoverflow2.c"
> 
> code snippet
> location:/home/buildusr/rpmbuild/BUILD/m4-1.4.19/64bit/lib/stackvma.c
> seems like its stuck here in for loop
> 
>   754   for (;;)
>     755     {
>     756       uintptr_t addr_stepsize;
>     757       uintptr_t i;
>     758       uintptr_t addr;
>     759
>     760       stepsize = stepsize / 2;
>     761       if (stepsize == 0)
>     762         break;
>     763       addr_stepsize = stepsize * pagesize;
>     764       for (i = stepsize, addr = addr1 + addr_stepsize;
>     765            i < count;
>     766            i += 2 * stepsize, addr += 2 * addr_stepsize)
>     767         /* Here addr = addr1 + i * pagesize.  */
>     768         if (is_mapped (addr))
>     769           return 0;
>     770     }
> 
> configure details
> ./configure     --prefix=%{_prefix} \
>                 --mandir=%{_mandir} \
>                 --infodir=%{_infodir} \
>                 --enable-largefile

At this point, I don't have access to an AIX machine.  Since you have
attached a debugger, what values do stepsize, addr1, and pagesize
have?  stepsize looks like it is supposed to decrease each iteration
of the loop, and that the loop will break if it decreases to 0.  Is
that actually happening?

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]