Question

When I run the script described here with my user, everything is well:

lorenzo@enzo:~/erlang/pei$ time erl -noshell -smp enabled -S 4 -s fib4 main 10000000

real    0m54.952s
user    1m16.090s
sys 0m0.070s

When I run it as root, it crashed:

lorenzo@enzo:~/erlang/pei$ sudo time erl -noshell -smp enabled -S 4 -s fib4 main 10000000
[sudo] password for lorenzo: 
74.68user 0.04system 0:53.56elapsed 139%CPU (0avgtext+0avgdata 66064maxresident)k
0inputs+0outputs (0major+8306minor)pagefaults 0swaps

The error is reproduceable.

My questions are:

  • Can someone try to explain me what is happending there?

  • Is it a problem with the erlang runtime or with my OS?

  • Can someone reproduce this error?

I am running erlang 5.7.4 on ubuntu natty with kernel

Linux enzo 2.6.38-10-generic #46-Ubuntu SMP Tue Jun 28 15:07:17 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

on a Phenom X4.

Was it helpful?

Solution

Why do you think it crashed? time just shows more info when running as root. Page fault is not an error but just the way virtual memory works.

OTHER TIPS

The difference between the two runs is that in the first run, you're running the shell builtin time, but in the second run, you're running whatever sudo finds in the path, which is /usr/bin/time. These two tools have different output formats.

$ type time
time is a shell keyword
$ time echo


real    0m0.000s
user    0m0.000s
sys     0m0.000s
$ type /usr/bin/time
/usr/bin/time is /usr/bin/time
$ /usr/bin/time echo

0.01user 0.00system 0:00.00elapsed 1000%CPU (0avgtext+0avgdata 2784maxresident)k
0inputs+0outputs (0major+217minor)pagefaults 0swaps
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top