All of lore.kernel.org
 help / color / mirror / Atom feed
* [parisc-linux] ntpd fails on mlockall()
@ 2000-10-10  2:57 Bdale Garbee
  2000-10-10 11:08 ` Richard Hirst
  0 siblings, 1 reply; 5+ messages in thread
From: Bdale Garbee @ 2000-10-10  2:57 UTC (permalink / raw)
  To: parisc-linux

I built a package of ntp, and it installed ok, but when ntpd goes to launch,
I get the following in daemon.log:

Oct  9 20:51:27 j5k ntpd[19416]: ntpd 4.0.99g Mon Oct  9 20:44:40 MDT 2000 (1)
Oct  9 20:51:27 j5k ntpd[19416]: mlockall(): Cannot allocate memory

And in dmesg output, I see:

do_page_fault() pid=19416 command='ntpd'

PSW  : 0004000a  GR 1 : 40053cf0  GR 2 : 40052777  GR 3 : 40054c44  
GR 4 : 400544f0  GR 5 : 4005ec4c  GR 6 : 4005ec4c  GR 7 : 00000000  
GR 8 : ffffffff  GR 9 : 00059cf0  GR10 : 2001fd24  GR11 : 0005c140  
GR12 : 0003a800  GR13 : 0003a800  GR14 : 0005c140  GR15 : 0005c140  
GR16 : 0005c140  GR17 : 00000001  GR18 : 0005c140  GR19 : 40197148  
GR20 : 00000000  GR21 : 00000000  GR22 : 00001fe9  GR23 : 00000004  
GR24 : 000001b0  GR25 : 0005d020  GR26 : 4005ec88  GR27 : 00045140  
GR28 : 00000000  GR29 : 0005f1b8  GR30 : 200203c0  GR31 : 40083f13  
SR0  : 00000000  SR1  : 0000200b  SR2  : 00000000  SR3  : 0000200b  
SR4  : 0000200b  SR5  : 0000200b  SR6  : 0000200b  SR7  : 0000200b  

IASQ : 0000200b 0000200b IAOQ : 4005277f 40052783 ORIG_R28 : 00000000
 IIR : 0eb41288 ISR : 0000200b IOR : 00000004

sending SIGSEGV


Anyone know what's going on?

Bdale

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [parisc-linux] ntpd fails on mlockall()
  2000-10-10  2:57 [parisc-linux] ntpd fails on mlockall() Bdale Garbee
@ 2000-10-10 11:08 ` Richard Hirst
  2000-10-10 20:53   ` Richard Hirst
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Hirst @ 2000-10-10 11:08 UTC (permalink / raw)
  To: Bdale Garbee; +Cc: parisc-linux

On Mon, Oct 09, 2000 at 08:57:00PM -0600, Bdale Garbee wrote:
> I built a package of ntp, and it installed ok, but when ntpd goes to launch,
> I get the following in daemon.log:
> 
> Oct  9 20:51:27 j5k ntpd[19416]: ntpd 4.0.99g Mon Oct  9 20:44:40 MDT 2000 (1)
> Oct  9 20:51:27 j5k ntpd[19416]: mlockall(): Cannot allocate memory

A simple prog that just calls mlockall() fails as well.  It is because
we currently allocate a massive stack (256MB?) for every process, and
mlockall() tries to actually claim the memory for that stack.  I tried
allocating just a 1MB stack in fs/exec.c, and my simple mlockall()
prog then worked.

Richard

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [parisc-linux] ntpd fails on mlockall()
  2000-10-10 11:08 ` Richard Hirst
@ 2000-10-10 20:53   ` Richard Hirst
       [not found]     ` <8766n0ynjw.fsf@rover.gag.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Hirst @ 2000-10-10 20:53 UTC (permalink / raw)
  To: Bdale Garbee; +Cc: parisc-linux

On Tue, Oct 10, 2000 at 12:08:41PM +0100, Richard Hirst wrote:
> On Mon, Oct 09, 2000 at 08:57:00PM -0600, Bdale Garbee wrote:
> > I built a package of ntp, and it installed ok, but when ntpd goes to launch,
> > I get the following in daemon.log:
> > 
> > Oct  9 20:51:27 j5k ntpd[19416]: ntpd 4.0.99g Mon Oct  9 20:44:40 MDT 2000 (1)
> > Oct  9 20:51:27 j5k ntpd[19416]: mlockall(): Cannot allocate memory
> 
> A simple prog that just calls mlockall() fails as well.  It is because
> we currently allocate a massive stack (256MB?) for every process, and
> mlockall() tries to actually claim the memory for that stack.  I tried
> allocating just a 1MB stack in fs/exec.c, and my simple mlockall()
> prog then worked.

I've changed the kernel to grow the user stack dynamically, so
hopefully your ntpd will work now.

Richard

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [parisc-linux] ntpd fails on mlockall()
       [not found]     ` <8766n0ynjw.fsf@rover.gag.com>
@ 2000-10-11 12:09       ` Richard Hirst
  2000-10-11 14:47         ` David Huggins-Daines
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Hirst @ 2000-10-11 12:09 UTC (permalink / raw)
  To: Bdale Garbee; +Cc: parisc-linux

On Tue, Oct 10, 2000 at 11:06:11PM -0600, Bdale Garbee wrote:
> rhirst@linuxcare.com (Richard Hirst) writes:
> 
> > I've changed the kernel to grow the user stack dynamically, so
> > hopefully your ntpd will work now.
> 
> Still dies, but without the mlockall() error, so that seems fixed.  The dmesg
> output when it fails is

Thought I'd better investigate in case it was my stack changes...
(configured and built ntp natively, btw).
Turns out this crash is caused by the call to timer_create() in
ntpd/ntp_timer.c.

timer_create() is in librt.a - anyone know whether we expect this to
work or not atm?

Anyway, if you undefine HAVE_TIMER_CREATE and HAVE_TIMER_SETTIME
in config.h and rebuild it, it does better.  I now get:

11 Oct 05:21:13 ntpd[3141]: logging to file /tmp/ntpd.log
11 Oct 05:21:13 ntpd[3141]: ntpd 4.0.99g Wed Oct 11 05:17:40 MDT 2000 (5)
11 Oct 05:21:13 ntpd[3141]: precision = 10000 usec
11 Oct 05:21:13 ntpd[3141]: kern_enable is 1
11 Oct 05:21:13 ntpd[3141]: init_socket_sig: ioctl(I_SETSIG, S_INPUT) failed: Bad address

So, I undefined USE_UDP_SIGPOLL, and now ntpd runs and talks to remote
ntp servers.  Don't know whether it is doing what it should though...

Richard

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [parisc-linux] ntpd fails on mlockall()
  2000-10-11 12:09       ` Richard Hirst
@ 2000-10-11 14:47         ` David Huggins-Daines
  0 siblings, 0 replies; 5+ messages in thread
From: David Huggins-Daines @ 2000-10-11 14:47 UTC (permalink / raw)
  To: Richard Hirst; +Cc: Bdale Garbee, parisc-linux

Richard Hirst <rhirst@linuxcare.com> writes:

> timer_create() is in librt.a - anyone know whether we expect this to
> work or not atm?

librt.so you mean, and it may not actually work, because it pulls in
libpthread.so.  I did enough fixing of linuxthreads such that merely
linking with -lpthread doesn't break your program, but I expect there
might be other problems, and actually using threads almost certainly
will not work.  (we're still missing a few #defines in pt-machine.h,
which I'll put in today, maybe, but there are probably VM issues in
the kernel as well, and I don't know if clone(2) actually works).

-- 
dhd@linuxcare.com, http://www.linuxcare.com/
Linuxcare. Support for the revolution.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-10-11 14:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-10-10  2:57 [parisc-linux] ntpd fails on mlockall() Bdale Garbee
2000-10-10 11:08 ` Richard Hirst
2000-10-10 20:53   ` Richard Hirst
     [not found]     ` <8766n0ynjw.fsf@rover.gag.com>
2000-10-11 12:09       ` Richard Hirst
2000-10-11 14:47         ` David Huggins-Daines

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.