Tracing down a problem with sudo receiving a stack corruption on one machine,
I've found out that a minimal program gets a stack corruption when compiled with
gcc-3.4.3, but not when being compiled with HP's bundled "cc". See details here:
http://www.sudo.ws/bugs/show_bug.cgi?id=170#c26

The minimal program is this:
main()
{
    initgroups("root", 3);
}

Possible required further conditions are: /etc/group must have "+:" in the last
line, /etc/nsswitch.conf should have "compat" for selector "groups", and the
machine should be NIS master server. (When removing the "+:" from /etc/group,
the gcc-compiled binary also doesn't get a memory fault).
I'd like to file a bug report for the HP C library once I know it's not a gcc
bug. Upon request I can attach or include disassemblies of both, HP-CC code, and
 GCC code.

-- 
           Summary: program using "initgroups()" fails with stack corruption
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Ulrich dot Windl at rz dot uni-regensburg dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: hppa2.0w-hp-hpux11.11


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21719

Reply via email to