Re: [mongrel2] Mongrel2 Trap Divide Error / Linux kernel reports no Time Stamp Counter (TSC)
- From:
- Zed A. Shaw
- Date:
- 2011-04-25 @ 23:35
On Mon, Apr 25, 2011 at 04:18:33PM -0700, Erik Osterman wrote:
> Greetings!
>
> Yet, when I start the process, it promptly exits (0).
>
> [INFO] (src/mongrel2.c:167) All loaded up, time to turn into a server.
> Warn: Linux kernel reports no Time Stamp Counter (TSC).
Uh, weird, I haven't seen that before.
> clone(child_stack=0,
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
child_tidptr=0x2aaaac2ba8a0) = 27570
> exit_group(0) = ?
> Warn: Linux kernel reports no Time Stamp Counter (TSC).
Man, that's the strangest error ever. I found a few references to the
error but I have no idea what it's for or where it's from:
http://blog.cr0.org/2009/05/time-stamp-counter-disabling-oddities.html
--
Zed A. Shaw
http://zedshaw.com/
Re: [mongrel2] Mongrel2 Trap Divide Error / Linux kernel reports no Time Stamp Counter (TSC)
- From:
- Erik Osterman
- Date:
- 2011-04-25 @ 23:56
Zed,
I think it may be a ZeroMQ issue. Guess I'll have to open up a thread in
the 0mq forums. I'll let you know if I find out anything.
QA Message Broker (1) [root@50.16.21.135:/opt/mongrel2] # gdb
/tmp/mongrel2-1.5/mongrel2-1.5/bin/mongrel2
GNU gdb Fedora (6.8-37.el5)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu"...
(gdb) set follow-fork-mode child
(gdb) run config.sqlite f400bf85-4538-4f7a-8908-67e313d515c2
Starting program: /tmp/mongrel2-1.5/mongrel2-1.5/bin/mongrel2
config.sqlite f400bf85-4538-4f7a-8908-67e313d515c2
[Thread debugging using libthread_db enabled]
[INFO] (src/dir.c:177) MAX limits.dir_send_buffer=16384, limits.dir_max_path=256
[INFO] (src/config/config.c:163) Loaded dir 1 with base=tests/
index=index.html def_ctype=text/plain
[INFO] (src/host.c:62) MAX limits.url_path=256, limits.host_name=256
[INFO] (src/config/config.c:223) Created directory route 1:/tests/ -> 1:tests/
[INFO] (src/config/config.c:260) Adding host 1:localhost to server at
pattern localhost
[INFO] (src/config/config.c:310) Loaded server
1:f400bf85-4538-4f7a-8908-67e313d515c2 on port 0.0.0.0 with default host
localhost
[INFO] (src/mime.c:49) MAX limits.mime_ext_len=128
[INFO] (src/superpoll.c:255) MAX open file descriptors is 10240 now.
[INFO] (src/unixy.c:140) Process 27644 is not running anymore, so removing
PID file .//run/mongrel2.pid.
[INFO] (src/mongrel2.c:167) All loaded up, time to turn into a server.
[Thread debugging using libthread_db enabled]
[New Thread 0x2aaaac2ba800 (LWP 27646)]
Warn: Linux kernel reports no Time Stamp Counter (TSC).
Program received signal SIGFPE, Arithmetic exception.
[Switching to Thread 0x2aaaac2ba800 (LWP 27646)]
0x00002aaaaacfe575 in ?? () from /usr/lib64/libzmq.so.1
Thanks,
Erik Osterman
On Apr 25, 2011, at 4:35 PM, Zed A. Shaw wrote:
> On Mon, Apr 25, 2011 at 04:18:33PM -0700, Erik Osterman wrote:
>> Greetings!
>>
>> Yet, when I start the process, it promptly exits (0).
>>
>> [INFO] (src/mongrel2.c:167) All loaded up, time to turn into a server.
>> Warn: Linux kernel reports no Time Stamp Counter (TSC).
>
> Uh, weird, I haven't seen that before.
>
>> clone(child_stack=0,
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
child_tidptr=0x2aaaac2ba8a0) = 27570
>> exit_group(0) = ?
>> Warn: Linux kernel reports no Time Stamp Counter (TSC).
>
> Man, that's the strangest error ever. I found a few references to the
> error but I have no idea what it's for or where it's from:
>
> http://blog.cr0.org/2009/05/time-stamp-counter-disabling-oddities.html
>
>
> --
> Zed A. Shaw
> http://zedshaw.com/
Re: Mongrel2 Trap Divide Error / Linux kernel reports no Time Stamp Counter (TSC)
- From:
- Erik Osterman
- Date:
- 2011-04-26 @ 00:22
I was able to work around the problem in libzmq. The issue stems from the
zeromq.spec file that configures with-pgm for x86_64 platforms (I'm
building RPMs). This appears to be incompatible with virtualized
environments.
%ifarch pentium3 pentium4 athlon i386 i486 i586 i686 x86_64
#%configure --with-pgm
%configure
%else
%configure
%endif
My fix was just to comment out "--with-pgm" and run vanilla configure. Now
everything running smoothly.
Looking forward to play with this some more!
Erik Osterman
On Apr 25, 2011, at 4:18 PM, Erik Osterman wrote:
> Greetings!
>
> I am excited to try out mongrel2, but have run into a snag.
>
> I am unable to start mongrel2 (mongrel2-1.5, zeromq-2.1.4) on CentOS
v5.4 2.6.21.7-2.fc8xe (x86_64) on EC2 (m1.large). Everything has been
compiled from source on the machine in question. I am using the
sample.conf provided with the release.
>
> main = Server(
> uuid="f400bf85-4538-4f7a-8908-67e313d515c2",
> access_log="/logs/access.log",
> error_log="/logs/error.log",
> chroot="./",
> default_host="localhost",
> name="test",
> pid_file="/run/mongrel2.pid",
> port=6767,
> hosts = [
> Host(name="localhost", routes={
> '/tests/': Dir(base='tests/', index_file='index.html',
> default_ctype='text/plain')
> })
> ]
> )
>
> servers = [main]
>
> Setup all the directories, per the documentation:
>
> QA Message Broker (1) [root@50.16.21.135:/opt/mongrel2] # ls -al
> total 52
> drwxr-xr-x 6 root root 87 Apr 25 15:50 .
> drwxr-xr-x 6 root root 91 Apr 25 15:27 ..
> -rw-r--r-- 1 root root 46080 Apr 25 15:23 config.sqlite
> drwxr-xr-x 2 root root 22 Apr 25 15:23 logs
> drwxr-xr-x 2 root root 25 Apr 25 15:49 run
> -rw-r--r-- 1 root root 462 Apr 25 15:22 sample.conf
> drwxr-xr-x 2 root root 23 Apr 25 15:36 tests
> drwxr-xr-x 2 root root 6 Apr 25 15:23 tmp
>
> Yet, when I start the process, it promptly exits (0).
>
> QA Message Broker (1) [root@50.16.21.135:/opt/mongrel2] # m2sh start
-db config.sqlite -host localhost
> [INFO] (src/dir.c:177) MAX limits.dir_send_buffer=16384, limits.dir_max_path=256
> [INFO] (src/config/config.c:163) Loaded dir 1 with base=tests/
index=index.html def_ctype=text/plain
> [INFO] (src/host.c:62) MAX limits.url_path=256, limits.host_name=256
> [INFO] (src/config/config.c:223) Created directory route 1:/tests/ -> 1:tests/
> [INFO] (src/config/config.c:260) Adding host 1:localhost to server at
pattern localhost
> [INFO] (src/config/config.c:310) Loaded server
1:f400bf85-4538-4f7a-8908-67e313d515c2 on port 0.0.0.0 with default host
localhost
> [INFO] (src/mime.c:49) MAX limits.mime_ext_len=128
> [INFO] (src/superpoll.c:255) MAX open file descriptors is 10240 now.
> [INFO] (src/unixy.c:140) Process 27553 is not running anymore, so
removing PID file .//run/mongrel2.pid.
> [INFO] (src/mongrel2.c:167) All loaded up, time to turn into a server.
> Warn: Linux kernel reports no Time Stamp Counter (TSC).
>
>
> dmesg reports "trap divide error":
>
> mongrel2[27559] trap divide error rip:2aaaaacfe575 rsp:55555583f050 error:0
>
> And logs/* is not really helpful.
> [INFO] (src/unixy.c:83) Now running as UID:0, GID:0
> [INFO] (src/server.c:164) Starting 0MQ with 1 threads.
>
> Doing an strace, the last few lines of code are:
> setrlimit(RLIMIT_NOFILE, {rlim_cur=10*1024, rlim_max=10*1024}) = 0
> write(2, "[INFO] (src/superpoll.c:255) MAX"..., 69[INFO]
(src/superpoll.c:255) MAX open file descriptors is 10240 now.
> ) = 69
> open(".//run/mongrel2.pid", O_RDONLY) = 3
> fstat(3, {st_mode=S_IFREG|0644, st_size=5, ...}) = 0
> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x2aaaaaac8000
> read(3, "27567", 4096) = 5
> read(3, "", 4096) = 0
> close(3) = 0
> munmap(0x2aaaaaac8000, 4096) = 0
> kill(27567, SIG_0) = -1 ESRCH (No such process)
> write(2, "[INFO] (src/unixy.c:140) Process"..., 105[INFO]
(src/unixy.c:140) Process 27567 is not running anymore, so removing PID
file .//run/mongrel2.pid.
> ) = 105
> unlink(".//run/mongrel2.pid") = 0
> chroot("./") = 0
> chdir("/") = 0
> write(2, "[INFO] (src/mongrel2.c:167) All "..., 71[INFO]
(src/mongrel2.c:167) All loaded up, time to turn into a server.
> ) = 71
> access("/run", F_OK) = 0
> access("/tmp", F_OK) = 0
> clone(child_stack=0,
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
child_tidptr=0x2aaaac2ba8a0) = 27570
> exit_group(0) = ?
> Warn: Linux kernel reports no Time Stamp Counter (TSC).
>
>
> Any tips much appreciated!
>
> Thanks,
>
>
> Erik Osterman
>
>
Re: [mongrel2] Re: Mongrel2 Trap Divide Error / Linux kernel reports no Time Stamp Counter (TSC)
- From:
- Zed A. Shaw
- Date:
- 2011-04-26 @ 00:27
On Mon, Apr 25, 2011 at 05:22:05PM -0700, Erik Osterman wrote:
> I was able to work around the problem in libzmq. The issue stems from
the zeromq.spec file that configures with-pgm for x86_64 platforms (I'm
building RPMs). This appears to be incompatible with virtualized
environments.
>
> My fix was just to comment out "--with-pgm" and run vanilla configure.
Now everything running smoothly.
Awesome, I'll have to document that somewhere.
> Looking forward to play with this some more!
I'm working on a release soon that's got tons of bug fixes. Try 1.5 and
if you get problems then you can grab the trunk from our fossil repo:
http://mongrel2.org/info/trunk
If you don't want to bother with fossil then, you should be able to grab
a Zip from there. First anon login here though:
http://mongrel2.org/login
(That prevents crawlers and spammers. Fancy eh?)
--
Zed A. Shaw
http://zedshaw.com/