The problem
在开始lang时,电文pthread/ethr_event.c:98: 等待__()(以英语发言):没有执行的职能(38)
,在现代动乱中,很可能是预设的Erlang binary与执行FUTEX_WAIT_PRIVATE和FUTEX_WAKE_PRIVATE的ker子互动的结果。 亚马孙煤油管公司规定,EC2不执行这些FUTEX_PRIVATE_宏观产品。
如果拆卸装置的舱面头板进入/usr/include/linux作为其他包裹的要求,则试图从来源建造Erlang可能失败。 (E.g.,Centos要求将Ckernel-headers 包裹作为获得、gcc-c++、glibc-devel和glibc-headers等的先决条件。) 由于包裹所安装的头盔与EC2图像制作文字所安装的纸浆不符,Errlang错误地假设FUTEX_WAIT_PRIVATE和FUTEX_WAKE_PRIVATE。
The fix
To fix it, the fastest is to manually patch erts/include/internal/pthread/ethr_event.h
to use the non-_PRIVATE futex implementation:
#if defined(FUTEX_WAIT_PRIVATE) && defined(FUTEX_WAKE_PRIVATE)
# define ETHR_FUTEX_WAIT__ FUTEX_WAIT_PRIVATE
# define ETHR_FUTEX_WAKE__ FUTEX_WAKE_PRIVATE
#else
# define ETHR_FUTEX_WAIT__ FUTEX_WAIT
# define ETHR_FUTEX_WAKE__ FUTEX_WAKE
#endif
......
//#if defined(FUTEX_WAIT_PRIVATE) && defined(FUTEX_WAKE_PRIVATE)
//# define ETHR_FUTEX_WAIT__ FUTEX_WAIT_PRIVATE
//# define ETHR_FUTEX_WAKE__ FUTEX_WAKE_PRIVATE
//#else
# define ETHR_FUTEX_WAIT__ FUTEX_WAIT
# define ETHR_FUTEX_WAKE__ FUTEX_WAKE
//#endif
Quick test
If you suspect the private futex issue is your problem, but want to verify it before you recompile all of Erlang, the following program can pin it down:
#include <sys/syscall.h>
#include <unistd.h>
#include <sys/time.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
typedef uint32_t u32; /* required on older kernel headers to fix a bug in futex.h Delete this line if it causes problems. */
#include <linux/futex.h>
int main(int argc, char *argv[])
{
#if defined(FUTEX_WAIT) && defined(FUTEX_WAKE)
uint32_t i = 1;
int res = 0;
res = syscall(__NR_futex, (void *) &i, FUTEX_WAKE, 1,
(void*)0,(void*)0, 0);
if (res != 0)
{
printf("FUTEX_WAKE HAD ERR %i: %s
", errno, strerror(errno));
} else {
printf("FUTEX_WAKE SUCCESS
");
}
res = syscall(__NR_futex, (void *) &i, FUTEX_WAIT, 0,
(void*)0,(void*)0, 0);
if (res != 0)
{
printf("FUTEX_WAIT HAD ERR %i: %s
", errno, strerror(errno));
} else {
printf("FUTEX_WAIT SUCCESS
");
}
#else
printf("FUTEX_WAKE and FUTEX_WAIT are not defined.
");
#endif
#if defined(FUTEX_WAIT_PRIVATE) && defined(FUTEX_WAKE_PRIVATE)
uint32_t j = 1;
int res_priv = 0;
res_priv = syscall(__NR_futex, (void *) &j, FUTEX_WAKE_PRIVATE, 1,
(void*)0,(void*)0, 0);
if (res_priv != 0)
{
printf("FUTEX_WAKE_PRIVATE HAD ERR %i: %s
", errno, strerror(errno));
} else {
printf("FUTEX_WAKE_PRIVATE SUCCESS
");
}
res_priv = syscall(__NR_futex, (void *) &j, FUTEX_WAIT_PRIVATE, 0,
(void*)0,(void*)0, 0);
if (res_priv != 0)
{
printf("FUTEX_WAIT_PRIVATE HAD ERR %i: %s
", errno, strerror(errno));
} else {
printf("FUTEX_WAIT_PRIVATE SUCCESS
");
}
#else
printf("FUTEX_WAKE_PRIVATE and FUTEX_WAIT_PRIVATE are not defined.
");
#endif
return 0;
}
Paste it into futextest.c
, 然后,gcc futextest.c
and .a.out
。
如果你执行私人 f子,请见
FUTEX_WAKE SUCCESS
FUTEX_WAIT SUCCESS
FUTEX_WAKE_PRIVATE SUCCESS
FUTEX_WAIT_PRIVATE SUCCESS
如果你有没有职能,就请见
FUTEX_WAKE SUCCESS
FUTEX WAIT SUCCESS
FUTEX_WAKE_PRIVATE HAD ERR 38: Function not implemented
FUTEX_WAIT_PRIVATE HAD ERR 38: Function not implemented
这一固定办法应使埃尔兰能够汇编并产生一种环境,由你在上安装rabbitmq 。