Hello,
./configure
--with-cc-opt="-O0" --prefix=${iprefix} --with-luajit
# uname -a
Linux analytics 3.12.22+ #691
PREEMPT Wed Jun 18 18:29:58 BST 2014 armv6l GNU/Linux
/etc/os-release:
...
VERSION_ID="7"
VERSION="7 (wheezy)"
ID=raspbian
ID_LIKE=debian
ANSI_COLOR="1;31"
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
In the application I am building a timer like this:
nginx.conf:
http {
...
lua_shared_dict timer_locks
1m;
init_worker_by_lua_file
"../app/timer.lua";
...
}
timer.lua:
local check_users_delay = 60 --
in seconds
-- redis connection function is
here --
local function
check_users(premature)
if not premature then
-- set timer immediatelly
to run at exactly the defined interval
local ok, err =
ngx.timer.at(check_users_delay, check_users)
if not ok then
ngx.log(ngx.ERR,
'Failed to create "check_users" timer: '..err)
return
end
local dict =
ngx.shared.timer_locks
local lock, err =
dict:add("lock_users", ngx.worker.pid(), check_users_delay)
if lock then
-- check for expired
users --
-- this code uses
Redis --
else
if err == "exists"
then
return
else
ngx.log(ngx.ERR,
err)
end
end
end
end
local ok, err =
ngx.timer.at(check_users_delay, check_users)
if not ok then
ngx.log(ngx.ERR, 'Failed to
create "check_users" timer: '..err)
return
end
When the application is started, we get in the nginx error log this:
2015/02/02 14:57:05 [notice]
6456#0: using the "epoll" event method
2015/02/02 14:57:05 [notice]
6456#0: openresty/1.7.7.1
2015/02/02 14:57:05 [notice]
6456#0: built by gcc 4.6.3 (Debian 4.6.3-14+rpi1)
2015/02/02 14:57:05 [notice]
6456#0: OS: Linux 3.12.22+
2015/02/02 14:57:05 [notice]
6456#0: getrlimit(RLIMIT_NOFILE): 1024:4096
2015/02/02 14:57:05 [notice]
6457#0: start worker processes
2015/02/02 14:57:05 [notice]
6457#0: start worker process 6458
...
2015/02/02
14:58:06 [notice] 6457#0: signal 17 (SIGCHLD) received
2015/02/02
14:58:06 [alert] 6457#0: worker process 6458 exited on signal 7
...
The syslog contains this:
[194098.387842] Alignment trap:
not handling instruction ed930b01 at [<000af6a0>]
[194098.387872] Unhandled fault:
alignment exception (0x011) at 0xb5fb703e
[194125.024729] Alignment trap:
not handling instruction ed930b01 at [<000af6a0>]
[194125.024762] Unhandled fault:
alignment exception (0x011) at 0xb692103e
[194159.418768] Alignment trap:
not handling instruction ed930b01 at [<000af6a0>]
[194159.418799] Unhandled fault:
alignment exception (0x011) at 0xb5fb703e
[194186.129026] Alignment trap:
not handling instruction ed930b01 at [<000af6a0>]
[194186.129058] Unhandled fault:
alignment exception (0x011) at 0xb692103e
[194220.449771] Alignment trap:
not handling instruction ed930b01 at [<000af6a0>]
[194220.449803] Unhandled fault:
alignment exception (0x011) at 0xb5fb703e
[194247.210993] Alignment trap:
not handling instruction ed930b01 at [<000af6a0>]
[194247.211023] Unhandled fault:
alignment exception (0x011) at 0xb692103e
[194281.490700] Alignment trap:
not handling instruction ed930b01 at [<000af6a0>]
[194281.490732] Unhandled fault:
alignment exception (0x011) at 0xb5fb703e
[194308.316655] Alignment trap:
not handling instruction ed930b01 at [<000af6a0>]
[194308.316683] Unhandled fault:
alignment exception (0x011) at 0xb692103e
[194342.524616] Alignment trap:
not handling instruction ed930b01 at [<000af6a0>]
[194342.524646] Unhandled fault:
alignment exception (0x011) at 0xb5fb703e
[194369.418437] Alignment trap:
not handling instruction ed930b01 at [<000af6a0>]
[194369.418466] Unhandled fault:
alignment exception (0x011) at 0xb692103e
[194403.552363] Alignment trap:
not handling instruction ed930b01 at [<000af6a0>]
[194403.552394] Unhandled fault:
alignment exception (0x011) at 0xb5fb703e
[194430.519373] Alignment trap:
not handling instruction ed930b01 at [<000af6a0>]
[194430.519405] Unhandled fault:
alignment exception (0x011) at 0xb692103e
[194464.593247] Alignment trap:
not handling instruction ed930b01 at [<000af6a0>]
[194464.593279] Unhandled fault:
alignment exception (0x011) at 0xb5fb703e
[194491.623686] Alignment trap:
not handling instruction ed930b01 at [<000af6a0>]
[194491.623716] Unhandled fault:
alignment exception (0x011) at 0xb692103e
[194525.634283] Alignment trap:
not handling instruction ed930b01 at [<000af6a0>]
[194525.634316] Unhandled fault:
alignment exception (0x011) at 0xb5fb703e
We believe we hit some kind of a bug related to the architecture
OpenResty has been compiled for (Raspberry PI, using an ARM processor).
We found one single blog entry which is in chinese and, when translated
with Google translate, seems to suggest we should use the optimization
level 0 for nginx when it is compiled:
http://blog.changyy.org/2013/07/nginx-worker-process-exited-on-signal-7.html
I should mention that the application works ok on x86 platforms (FreeBSD
and Ubuntu).
How can we solve this? How can we change the option -O2 to -O0? Could
this solve our problem?
Thank you