2017-09-25 12 views
0

JVM/SSHのクラッシュにつながる、コードは次のようです)。私はJVM上でのHadoopとそれを使用する場合でも、それは私にこのようなエラーレポートを与えた:インターセプトLinuxのpthread_createの機能は、私がubuntu14.04上のpthread_createを傍受しようとした

Starting namenodes on [ubuntu] 
ubuntu: starting namenode, logging to /home/yangyong/work/hadooptrace/hadoop-2.6.5/logs/hadoop-yangyong-namenode-ubuntu.out 
ubuntu: starting datanode, logging to /home/yangyong/work/hadooptrace/hadoop-2.6.5/logs/hadoop-yangyong-datanode-ubuntu.out 
ubuntu: /home/yangyong/work/hadooptrace/hadoop-2.6.5/sbin/hadoop-daemon.sh: line 131: 7545 Aborted     (core dumped) nohup nice -n 
$HADOOP_NICENESS $hdfsScript --config $HADOOP_CONF_DIR $command "[email protected]" > "$log" 2>&1 < /dev/null 
Starting secondary namenodes [0.0.0.0 
# 
# A fatal error has been detected by the Java Runtime Environment: 
# 
# SIGSEGV (0xb) at pc=0x0000000000000000, pid=7585, tid=140445258151680 
# 
# JRE version: OpenJDK Runtime Environment (7.0_121) (build 1.7.0_121-b00) 
# Java VM: OpenJDK 64-Bit Server VM (24.121-b00 mixed mode linux-amd64 compressed oops) 
# Derivative: IcedTea 2.6.8 
# Distribution: Ubuntu 14.04 LTS, package 7u121-2.6.8-1ubuntu0.14.04.1 
# Problematic frame: 
# C 0x0000000000000000 
# 
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again 
# 
# An error report file with more information is saved as: 
# /home/yangyong/work/hadooptrace/hadoop-2.6.5/hs_err_pid7585.log 
# 
# If you would like to submit a bug report, please include 
# instructions on how to reproduce the bug and visit: 
# http://icedtea.classpath.org/bugzilla 
#] 
A: ssh: Could not resolve hostname a: Name or service not known 
#: ssh: Could not resolve hostname #: Name or service not known 
fatal: ssh: Could not resolve hostname fatal: Name or service not known 
been: ssh: Could not resolve hostname been: Name or service not known 
#: ssh: Could not resolve hostname #: Name or service not known 
#: ssh: Could not resolve hostname #: Name or service not known 
#: ssh: Could not resolve hostname #: Name or service not known 
^COpenJDK: ssh: Could not resolve hostname openjdk: Name or service not known 
detected: ssh: Could not resolve hostname detected: Name or service not known 
version:: ssh: Could not resolve hostname version:: Name or service not known 
JRE: ssh: Could not resolve hostname jre: Name or service not known 

は私のコードに何か問題はありますか?それとも、JVMやSSHの保護メカニズムのようなものなのでしょうか? ありがとうございます。

+0

もう1つの同様のエラーの例があります。[link](https://sourceware.org/ml/glibc-linux/2001-q1/msg00048.html) – Chalex

答えて

0

このコードは無効arg値を持っている子スレッドが発生します。

struct thread_param temp; 
    temp.args=arg; 
    temp.start_routine=start_routine; 

    int result=old_create(thread,attr,intermedia,(void *)&temp); 
//  int result=old_create(thread,attr,start_routine,arg); 
    return result; // <-- temp and its contents are now invalid 

temp値を無効にする、戻ってきたことがありますpthread_create()に親の呼び出しなど、新しいスレッドで、それ以上存在することが保証されていませんを含む。

+0

ありがとう!この問題を解決します! – Chalex

0

あなたのコードにはいくつかの問題があります。あなたが見ている問題を引き起こしているものがあるかどうかわかりませんが、間違いなくそれらを修正する必要があります。

まず、コアダンプを有効にして(通常はulimit -c unlimitedを使用して)、コアをGDBにロードします。バックトレースが指しているものを参照してください。

Do not dlopen pthreads。代わりに、dlsym(RTLD_NEXT, "pthread_create")を使用することができます。

しかし、最も一般的な原因は、元の引数をグローバル変数に格納することです。これは、誰か(例えば、Javaランタイム)が同時に多くのスレッドを開いている場合、何をするのかをミックスすることを意味します。

+0

ありがとうございました。最初の点については、gdbのデバッグにはあまり慣れていませんが、後でそれをオンにしましたが、まだ問題を把握することはできません。 2番目の点は、dlsym(RTLD_NEXT、 "pthread_create")だけを使用すると警告が表示され、jvmはクラッシュします。第3のポイントは、どの変数がグローバルであるかはわかりません。とにかくあなたの迅速な対応に感謝します。 – Chalex

関連する問題