Setui(0) memory fault

Hi i have this code that used to wrok fine in unix mp-ras.
After the migration to linux suse i recompiled the script and now when it is executed i get a Memory fault (coredump) message.

Does anybody knows why' what should I change?
tks

SCRIPT

#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>

int main(int argc, char * argv[])
{
   setuid( 0 );
   /*chmod( argv[1], S_IRWXU || S_IRWXG || S_IROTH );*/
   chmod( argv[1], 00775 );
}

What if you compile it, using the debug parameter of your compiler and execute it step-by-step? That should give you a hint as to where the segfault originates from. Or maybe you passing an argument that cannot be processed?