Why does this mlockall()+setuid(getuid())+setlocale() program crash?

2006-03-03 Thread Shlomi Fish
Hi all! 1. Save the script that is attached to this message. 2. **As root**, run it in an empty directory. 3. As an under-privileged user, enter this directory and type ./prog. Result: the program segfaults before printing the Msg2. My question is - why? I should note that running the same

Re: Why does this mlockall()+setuid(getuid())+setlocale() program crash?

2006-03-03 Thread guy keren
On Fri, 3 Mar 2006, Shlomi Fish wrote: Hi all! 1. Save the script that is attached to this message. 2. **As root**, run it in an empty directory. 3. As an under-privileged user, enter this directory and type ./prog. Result: the program segfaults before printing the Msg2. My question is

Re: Why does this mlockall()+setuid(getuid())+setlocale() program crash?

2006-03-03 Thread Baruch Even
Shlomi Fish wrote: Hi all! 1. Save the script that is attached to this message. 2. **As root**, run it in an empty directory. 3. As an under-privileged user, enter this directory and type ./prog. Result: the program segfaults before printing the Msg2. My question is - why? I should

Re: Why does this mlockall()+setuid(getuid())+setlocale() program crash?

2006-03-03 Thread Shlomi Fish
On Saturday 04 March 2006 19:40, guy keren wrote: On Fri, 3 Mar 2006, Shlomi Fish wrote: Hi all! 1. Save the script that is attached to this message. 2. **As root**, run it in an empty directory. 3. As an under-privileged user, enter this directory and type ./prog. Result: the

Re: Why does this mlockall()+setuid(getuid())+setlocale() program crash?

2006-03-03 Thread Shlomi Fish
On Friday 03 March 2006 20:36, Baruch Even wrote: Shlomi Fish wrote: Hi all! 1. Save the script that is attached to this message. 2. **As root**, run it in an empty directory. 3. As an under-privileged user, enter this directory and type ./prog. Result: the program segfaults

Re: Why does this mlockall()+setuid(getuid())+setlocale() program crash?

2006-03-03 Thread Baruch Even
Shlomi Fish wrote: On Friday 03 March 2006 20:36, Baruch Even wrote: The thing to try would be strace and/or gdb to debug the program and see where it crashes or enable coredumps and gdb the resulting coredump. The problem is that when running under strace or gdb the program does not

Re: Why does this mlockall()+setuid(getuid())+setlocale() program crash?

2006-03-03 Thread Shachar Shemesh
Baruch Even wrote: That's why I also added the coredump option, increase the coredump limit to unlimited and you'll get a coredump which is a memory dump of the process that gdb can use to look at the state of the program during the crash. Baruch It's a root suid program that is run as

Re: Why does this mlockall()+setuid(getuid())+setlocale() program crash?

2006-03-03 Thread Tzafrir Cohen
On Fri, Mar 03, 2006 at 07:00:23PM +0200, Shlomi Fish wrote: Hi all! 1. Save the script that is attached to this message. 2. **As root**, run it in an empty directory. 3. As an under-privileged user, enter this directory and type ./prog. Result: the program segfaults before printing