Asakusa on M3BPを使う際に出たエラーのメモ。
|
|
Asakusa on M3BP用のコンパイルを行うにはいくつか必要なツールがある。
これが無いと、コンパイル時にエラーが発生する。
→開発環境の構築
また、実行にもいくつかのライブラリー(特定バージョン以降)が必要となり、ライブラリーが無かったり古かったりするとエラーが発生する。
→実行環境の構築
コンパイルにおいて、M3bpJobflowProcessorのクラスファイルのバージョンが52.0(Java8)であるというエラー。
$ ./gradlew m3bpCompileBatchApps
〜
:m3bpCompileBatchapps
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/asakusafw/m3bp/compiler/core/M3bpJobflowProcessor : Unsupported major.minor version 52.0
Asakusa on M3BP 0.1.0のコンパイラーはJDK1.8(Java8)で作られている。
したがって、コンパイル環境に入っているJavaがJDK1.7だと、このようなエラーが発生する。
(なお、AsakusaFW 0.8.0(Asakusa on M3BP
0.1.0)では、実行環境のJavaのバージョンはデフォルトでは1.7(Java7)がターゲットになっているので、コンパイルして出来るJavaクラスファイルはJava7用になる)
コンパイル環境にJDK1.8をインストールする必要がある。
→Javaのインストール方法
もしShafu(Eclipseプラグイン)を使ってコンパイルしていて、JDK1.8をインストールしてもこのエラーが出る場合は、ShafuのJDKの識別が変わっていないと考えられる。
ShafuのJava VMを設定すれば、指定したJDKが使われるようになる。
コンパイルにおいて、CMakeが無いというエラー。
$ ./gradlew m3bpCompileBatchApps
〜
:m3bpCompileBatchapps
20:29:11 INFO compiling batch class: com.example.batch.SummarizeBatch
20:29:11 ERROR failed to detect command: cmake
Asakusa on M3BPはネイティブのライブラリーを生成するが、生成にCMakeを使用するので、CMakeが無いとエラーになる。
コンパイル環境にCMake(2.8以降)をインストールする必要がある。
→CMakeのインストール方法
コンパイルにおいて、gccが無いというエラー。
$ ./gradlew m3bpCompileBatchApps 〜 :m3bpCompileBatchapps 21:25:29 INFO compiling batch class: com.example.batch.SummarizeBatch 21:25:30 WARN cmake: CMake Error: your C compiler: "CMAKE_C_COMPILER-NOTFOUND" was not found. Please set CMAKE_C_COMPILER to a valid compiler path or name. 21:25:30 WARN cmake: CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name. 21:25:30 ERROR command returns non-zero exit status: /usr/bin/cmake (status=1)
gcc/g++をインストールする必要がある。
→gccのインストール方法
コンパイルにおいて、「-std=c++11
」や「-flto
」といったオプションが使えないというエラー。
$ ./gradlew m3bpCompileBatchApps 〜 :m3bpCompileBatchapps 21:42:31 INFO compiling batch class: com.example.batch.SummarizeBatch 21:42:33 WARN make: cc1plus: error: unrecognized command line option "-std=c++11" 21:42:33 WARN make: cc1plus: error: unrecognized command line option "-flto" 21:42:33 WARN make: make[2]: *** [CMakeFiles/application.dir/src/application.cpp.o] エラー 1 21:42:33 WARN make: make[1]: *** [CMakeFiles/application.dir/all] エラー 2 21:42:33 WARN make: make: *** [all] エラー 2 21:42:33 ERROR command returns non-zero exit status: /usr/bin/make (status=2)
gccのバージョンが古いと「-std=c++11
」や「-flto
」オプションが使えない。
CentOS6の場合、yumでインストールできるgccは4.4.7で、古い。
gcc 4.8.5以降を使う必要がある。
→gccのインストール方法
gcc 4.8.5をインストールしてもまだ同じエラーが出る場合は、AsakusaFWのコンパイルに使われているgccが古いバージョンを参照したままになっていると考えられる。
コンパイル時にどのバージョンが使われているかは、デバッグレベルのログを出力してみれば確認できる。
コンパイル時に使われるlogbackの設定を変更し、デバッグ情報を出力するようにする。
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<target>System.out</target>
<encoder>
<pattern>%d{HH:mm:ss} %-5level %msg%n</pattern>
</encoder>
</appender>
<root>
<level value="DEBUG" /> ←INFOをDEBUGに変える
<appender-ref ref="STDOUT" />
</root>
</configuration>
↓コンパイルを再実行
$ ./gradlew m3bpCompileBatchApps 〜 :m3bpCompileBatchapps 〜 23:14:52 DEBUG cmake: -- The C compiler identification is GNU 4.4.7 23:14:52 DEBUG cmake: -- The CXX compiler identification is GNU 4.4.7 23:14:52 DEBUG cmake: -- Check for working C compiler: /usr/bin/cc 23:14:52 DEBUG cmake: -- Check for working C compiler: /usr/bin/cc -- works 23:14:52 DEBUG cmake: -- Detecting C compiler ABI info 23:14:52 DEBUG cmake: -- Detecting C compiler ABI info - done 23:14:52 DEBUG cmake: -- Check for working CXX compiler: /usr/bin/c++ 23:14:52 DEBUG cmake: -- Check for working CXX compiler: /usr/bin/c++ -- works 23:14:52 DEBUG cmake: -- Detecting CXX compiler ABI info 23:14:52 DEBUG cmake: -- Detecting CXX compiler ABI info - done 23:14:52 DEBUG cmake: -- Configuring done 23:14:52 DEBUG cmake: -- Generating done 〜
/usr/bin/ccや/usr/bin/c++が古い(バージョン4.4.7)のコンパイラーである。
解決策はいくつか考えられる。
CMakeでは、ツールチェインファイルと呼ばれるファイルにCMake用の設定を記述することが出来る。
$ vi toolchain.cmake SET(CMAKE_C_COMPILER /usr/local/bin/gcc) SET(CMAKE_CXX_COMPILER /usr/local/bin/g++)
$ ./gradlew m3bpCompileBatchapps --compiler-properties m3bp.native.cmake.CMAKE_TOOLCHAIN_FILE=$(pwd)/toolchain.cmake
CMAKE_C_COMPILER・CMAKE_CXX_COMPILERについては、CMakeのWikiを参照。
(/usr/loca/bin/gcc,g++は、gccをソースからビルドし
てインストールされた新しいバージョンのコンパイラー)
--compiler-propertiesについては、Asakusa on M3BPリファレンスのコマンドラインオプションを参照。
(AsakusaFW 0.9.1では--optionsという名前に変わった模様。[2017-06-03])
m3bp.native.cmakeについては、Asakusa on M3BPリファレンスのコンパイラプロパティを参照。
(m3bp.native.cmake.CMAKE_TOOLCHAIN_FILE
は、CMakeの「-D CMAKE_TOOLCHAIN_FILE
」を指定するという意味)
ツールチェインファイルを使わずに、CMakeのオプションでコンパイラーを指定する方法。
$ ./gradlew m3bpCompileBatchapps --compiler-properties "m3bp.native.cmake.CMAKE_C_COMPILER=/usr/local/bin/gcc, m3bp.native.cmake.CMAKE_CXX_COMPILER=/usr/local/bin/g++"
環境変数CC,CXXでコンパイラーを指定する方法。
$ export CC=$(which gcc) $ export CXX=$(which g++) $ ./gradlew m3bpCompileBatchapps
Asakusaアプリケーションのbuild.gradleでコンパイラーを指定する方法。
〜 asakusafw { m3bp { compilerProperties += ['m3bp.native.cmake.CMAKE_C_COMPILER': '/usr/local/bin/gcc'] compilerProperties += ['m3bp.native.cmake.CMAKE_CXX_COMPILER': '/usr/local/bin/g++'] } } 〜
$ ./gradlew m3bpCompileBatchapps
yumでインストールしたgcc/g++が古くて不要な場合、それを削除して最新版だけがインストールされている状態にすればいい。
# yum remove gcc-c++ # yum remove gcc
$ ./gradlew m3bpCompileBatchapps
実行時に、hadoopコマンドが見つからないというエラー。
$ $ASAKUSA_HOME/yaess/bin/yaess-batch.sh m3bp.example.summarizeSales -A date=2011-04-01 〜 which: no hadoop in (/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/hishidama/.local/bin:/home/hishidama/bin) hadoop command is not found
build.gradleで実行環境のHadoopを使う設定にしているのにHadoopが見つからないと、このエラーになる。
実行環境にHadoopをインストールする必要がある。
実行時に、libhwloc.so.5が無いというエラー。
$ $ASAKUSA_HOME/yaess/bin/yaess-batch.sh m3bp.example.summarizeSales -A date=2011-04-01
〜
Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/hishidama/asakusa/m3bp/native/libm3bpjni.so: libhwloc.so.5: 共有オブジェクトファイルを開けません: そのようなファイルやディレクトリはありません
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at com.asakusafw.m3bp.mirror.jni.EngineMirrorImpl.<clinit>(EngineMirrorImpl.java:67)
at com.asakusafw.m3bp.client.GraphExecutor.newEngine(GraphExecutor.java:119)
at com.asakusafw.m3bp.client.GraphExecutor.execute(GraphExecutor.java:104)
at com.asakusafw.m3bp.client.Launcher.exec(Launcher.java:100)
at com.asakusafw.m3bp.client.Launcher.exec(Launcher.java:178)
at com.asakusafw.m3bp.client.Launcher.main(Launcher.java:159)
実行環境にlibhwloc.so.5が必要。
# yum install hwloc
実行時に、glibcのバージョンが古いというエラー。
$ $ASAKUSA_HOME/yaess/bin/yaess-batch.sh m3bp.example.summarizeSales -A date=2011-04-01
〜
Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/hishidama/asakusa/m3bp/native/libm3bpjni.so: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /home/hishidama/asakusa/m3bp/native/libm3bp.so.0.1.0)
glibcのバージョンは以下の様にして確認できる。
(参考:toshihirockさんのCentOS6系にanrdoid-ndk-10eをインストール(ビルドは未検証))
# /lib64/libc.so.6 GNU C Library stable release version 2.12, by Roland McGrath et al. Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Compiled by GNU CC version 4.4.7 20120313 (Red Hat 4.4.7-16). Compiled on a Linux 2.6.32 system on 2016-02-16. Available extensions: The C stubs add-on version 2.1.2. crypt add-on version 2.1 by Michael Glad and others GNU Libidn by Simon Josefsson Native POSIX Threads Library by Ulrich Drepper et al BIND-8.2.3-T5B RT using linux kernel aio libc ABIs: UNIQUE IFUNC For bug reporting instructions, please see: <http://www.gnu.org/software/libc/bugs.html>.
CentOS6だとバージョンが2.12だが、必要なのは2.14。
CentOS7ならこのエラーは出ない。
Asakusa on M3BPはAsakusaFW(Java)とM3BPコア(C++)で動いているが、M3BPコア部分で異常が起きるとexit code 134というエラーが発生することがある。[2016-06-18]
terminate called after throwing an instance of 'JavaException' what(): (no message) /home/hishidama/asakusa/m3bp/bin/execute.sh: line 169: 32873 Aborted "${_EXEC[@]}" "com.asakusafw.m3bp.client.Launcher" --client "$_OPT_APPLICATION" --batch-id "$_OPT_BATCH_ID" --flow-id "$_OPT_FLOW_ID" --execution-id "$_OPT_EXECUTION_ID" --batch-arguments "$_OPT_BATCH_ARGUMENTS," "${_APP_OPTIONS[@]}" "$@" Asakusa on M3BP failed with exit code: 134 Launcher: /usr/bin/hadoop Batch ID: m3bp.ExampleBatch Flow ID: ExampleJob Execution ID: b172a878-949e-462c-b3be-ab7895ae3d40 Batch Arguments: Application: com.asakusafw.m3bp.generated.Application System Options: --hadoop-conf @/home/hishidama/asakusa/core/conf/asakusa-resources.xml --engine-conf @/home/hishidama/asakusa/m3bp/conf/m3bp.properties ASAKUSA_M3BP_OPTS: User Options: Librarypath: /home/hishidama/asakusa/m3bp/native Classpath: /home/hishidama/asakusa/batchapps/m3bp.ExampleBatch/lib/jobflow-ExampleJob.jar /home/hishidama/asakusa/m3bp/conf /home/hishidama/asakusa/m3bp/lib/asakusa-m3bp-assembly-0.1.1-lib.jar /home/hishidama/asakusa/m3bp/lib/logback-classic-1.1.3.jar /home/hishidama/asakusa/m3bp/lib/logback-core-1.1.3.jar /home/hishidama/asakusa/m3bp/lib/slf4j-api-1.7.7.jar /home/hishidama/asakusa/core/lib/asakusa-runtime-all.jar /home/hishidama/asakusa/ext/lib/asakusa-directio-runtime-ext-0.8.1-SNAPSHOT.jar 2016/06/18 11:49:32 INFO [ParallelJobScheduler-2] [m3bp.ExampleBatch|] STEP - m3bp.ExampleBatch|ExampleJob|main@b172a878-949e-462c-b3be-ab7895ae3d40 [100.00%] 2016/06/18 11:49:32 INFO [ParallelJobScheduler-2] [m3bp.ExampleBatch|] END JOB - m3bp0000/m3bp.ExampleBatch|ExampleJob|main@b172a878-949e-462c-b3be-ab7895ae3d40 2016/06/18 11:49:32 ERROR [ParallelJobScheduler-2] [m3bp.ExampleBatch|] [YS-CORE-E04001] Job "m3bp0000" execution was failed: batchId=m3bp.ExampleBatch, flowId=ExampleJob, executionId=b172a878-949e-462c-b3be-ab7895ae3d40, phase=main, jobId=m3bp0000, serviceId=command.*, trackingId=YAESS/m3bp.ExampleBatch/ExampleJob/main/b172a878-949e-462c-b3be-ab7895ae3d40/m3bp0000 com.asakusafw.yaess.basic.ExitCodeException: Unexpected exit code from command job: code=134 (batch=m3bp.ExampleBatch, flow=ExampleJob, phase=main, stage=m3bp0000, exection=b172a878-949e-462c-b3be-ab7895ae3d40) at com.asakusafw.yaess.basic.ProcessCommandScriptHandler.execute0(ProcessCommandScriptHandler.java:187) ~[asakusa-yaess-core-0.8.1-SNAPSHOT.jar:na] at com.asakusafw.yaess.basic.ProcessCommandScriptHandler.execute(ProcessCommandScriptHandler.java:112) ~[asakusa-yaess-core-0.8.1-SNAPSHOT.jar:na] at com.asakusafw.yaess.basic.ProcessCommandScriptHandler.execute(ProcessCommandScriptHandler.java:52) ~[asakusa-yaess-core-0.8.1-SNAPSHOT.jar:na] at com.asakusafw.yaess.core.task.ScriptJob.execute(ScriptJob.java:59) ~[asakusa-yaess-core-0.8.1-SNAPSHOT.jar:na] at com.asakusafw.yaess.core.Job.launch(Job.java:54) ~[asakusa-yaess-core-0.8.1-SNAPSHOT.jar:na] at com.asakusafw.yaess.basic.JobExecutor$Executing$1.call(JobExecutor.java:101) [asakusa-yaess-core-0.8.1-SNAPSHOT.jar:na] at com.asakusafw.yaess.basic.JobExecutor$Executing$1.call(JobExecutor.java:97) [asakusa-yaess-core-0.8.1-SNAPSHOT.jar:na] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_91] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_91] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_91] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91]
ちなみに、これはヒープ領域不足で落ちたもの。→OutOfMemoryError
これはAsakusa on M3BP 0.1.1のログだが、0.1.1だとエラーの情報があまり出ないが0.1.2だともう少し色々エラーメッセージが出るようになっているので、0.1.2以降にした方がいいと思う。
実行時に、OutOfMemoryError。[2016-06-18]
[2016-06-18 12:59:17.386213] [0x00007f6592099700] [error] An exception is thrown: (no message) [2016-06-18 13:00:35.927293] [0x00007f659a8aa700] [error] An exception is thrown: (no message) [2016-06-18 13:00:35.927452] [0x00007f659a8aa700] [error] The last exception is suppressed [2016-06-18 13:00:50.345877] [0x00007f65990a7700] [error] An exception is thrown: (no message) [2016-06-18 13:00:50.345993] [0x00007f65990a7700] [error] The last exception is suppressed 16/06/16 13:00:50 ERROR jni.EngineMirrorImpl: exception was occurred in vertex java.lang.OutOfMemoryError: GC overhead limit exceeded
Asakusa on M3BPではAsakusaFW(Java)とM3BPコア(C++)がメモリーを使用する。
Java側でもメモリー(ヒープ領域)がある程度必要になるので、それが足りないとOutOfMemoryErrorになる。
実行環境の環境変数ASAKUSA_M3BP_OPTSでJavaVMのオプションを指定できるので、そこで-Xmxを指定する。
入出力バッファーのアクセス方式がnio(デフォルト)の場合、ひとつの出力が2GBを超えるとエラーになる。[2016-06-18]
14:03:48 ERROR error occurred while processing Direct file output: basePath=result/error, context=OutputAttemptContext(transactionId=c8ba0667-b156-4e33-981e-786744cb643f, attemptId=v5-3, outputId=root)
com.asakusafw.m3bp.mirror.jni.NativeException: input group is too large; please use larger addressing mode instead
at com.asakusafw.m3bp.mirror.jni.InputReaderMirrorImpl.advance0(Native Method) ~[asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.m3bp.mirror.jni.InputReaderMirrorImpl.advance(InputReaderMirrorImpl.java:84) ~[asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.m3bp.mirror.jni.InputReaderMirrorImpl$Input.doAdvance(InputReaderMirrorImpl.java:141) ~[asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.m3bp.mirror.basic.AbstractPageDataInput.advance(AbstractPageDataInput.java:93) ~[asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.m3bp.mirror.basic.AbstractPageDataInput.next(AbstractPageDataInput.java:108) ~[asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.m3bp.bridge.KeyValueReaderBridge.nextGroup(KeyValueReaderBridge.java:61) ~[asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.dag.runtime.directio.DirectFileOutputPrepare$GroupTask.run(DirectFileOutputPrepare.java:242) ~[asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.m3bp.bridge.VertexProcessorBridge$Driver.run(VertexProcessorBridge.java:298) [asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.m3bp.bridge.VertexProcessorBridge.run(VertexProcessorBridge.java:171) [asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.m3bp.mirror.jni.EngineMirrorImpl.doCall(EngineMirrorImpl.java:295) ~[asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.m3bp.mirror.jni.EngineMirrorImpl.doRun(EngineMirrorImpl.java:232) ~[asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
出力ファイルが2GBを超えるときは、出力ファイルの分割を考える。(Direct
I/OのResourcePatternで分割できるようなファイル名を指定する)
あるいは、アクセス方式をunsafeにする。
入出力バッファーのアクセス方式がnio(デフォルト)で、1レコードのサイズ(データモデルをシリアライズしたサイズ)が出力バッファー(の空き容量)より大きいとBufferOverflowExceptionが発生する。[2016-06-18]
14:22:11 ERROR exception was occurred in vertex
java.nio.BufferOverflowException: null
at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:363) ~[na:1.8.0_77]
at com.asakusafw.dag.utils.buffer.nio.NioDataBuffer.write(NioDataBuffer.java:177) ~[asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.dag.runtime.io.ValueOptionSerDe.serialize(ValueOptionSerDe.java:395) ~[asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.m3bp.generated.v5.serde.directio._1.serializeValue(Unknown Source) ~[jobflow-byCategory.jar:na]
at com.asakusafw.m3bp.bridge.KeyValueWriterBridge.putObject(KeyValueWriterBridge.java:55) ~[asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.dag.runtime.skeleton.EdgeOutputHandler$SimpleSink.add(EdgeOutputHandler.java:123) ~[asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.m3bp.generated.v2.operator._1.add(Unknown Source) ~[jobflow-byCategory.jar:na]
at com.asakusafw.m3bp.generated.v2.operator._2.add(Unknown Source) ~[jobflow-byCategory.jar:na]
at com.asakusafw.m3bp.generated.v2.operator._3.process(Unknown Source) ~[jobflow-byCategory.jar:na]
at com.asakusafw.dag.runtime.skeleton.TableJoinResult.add(TableJoinResult.java:55) ~[asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.m3bp.generated.v2.operator._4.add(Unknown Source) ~[jobflow-byCategory.jar:na]
at com.asakusafw.m3bp.generated.v2.adapter.operation._1$Op.process(Unknown Source) ~[jobflow-byCategory.jar:na]
at com.asakusafw.dag.runtime.skeleton.GenericTaskProcessor.run(GenericTaskProcessor.java:64) ~[asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.m3bp.bridge.VertexProcessorBridge$Driver.run(VertexProcessorBridge.java:298) ~[asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.m3bp.bridge.VertexProcessorBridge.run(VertexProcessorBridge.java:171) ~[asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.m3bp.mirror.jni.EngineMirrorImpl.doCall(EngineMirrorImpl.java:295) [asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.m3bp.mirror.jni.EngineMirrorImpl.doRun(EngineMirrorImpl.java:232) [asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
出力バッファーのサイズを調整する必要がある。
入出力バッファーのアクセス方式がunsafeで、1レコードのサイズ(データモデルをシリアライズしたサイズ)が出力バッファー(の空き容量)より大きいとSEGVが発生する。[2016-06-18]
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fdbe5e925b2, pid=13708, tid=140582314133248
#
# JRE version: Java(TM) SE Runtime Environment (8.0_77-b03) (build 1.8.0_77-b03)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.77-b03 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libm3bp.so.0.1.1+0x7f5b2] m3bp::ShuffleLogicalTask::partition_fragment(m3bp::ExecutionContext&, m3bp::Locality const&, m3bp::LockedMemoryReference)+0x5c2
#
# 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/hishidama/hs_err_pid13708.log
14:34:07 ERROR exception was occurred in vertex
java.lang.IllegalStateException: unsafe buffer overflow: buffer-size=4,194,304, exceeded=1,048,685, last-page-size: 5,242,989
at com.asakusafw.m3bp.mirror.unsafe.UnsafePageDataOutput.endPage(UnsafePageDataOutput.java:83) ~[asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.m3bp.bridge.KeyValueWriterBridge.putObject(KeyValueWriterBridge.java:56) ~[asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.dag.runtime.skeleton.EdgeOutputHandler$SimpleSink.add(EdgeOutputHandler.java:123) ~[asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.m3bp.generated.v2.operator._1.add(Unknown Source) ~[jobflow-byCategory.jar:na]
at com.asakusafw.m3bp.generated.v2.operator._2.add(Unknown Source) ~[jobflow-byCategory.jar:na]
at com.asakusafw.m3bp.generated.v2.operator._3.process(Unknown Source) ~[jobflow-byCategory.jar:na]
at com.asakusafw.dag.runtime.skeleton.TableJoinResult.add(TableJoinResult.java:55) ~[asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.m3bp.generated.v2.operator._4.add(Unknown Source) ~[jobflow-byCategory.jar:na]
at com.asakusafw.m3bp.generated.v2.adapter.operation._1$Op.process(Unknown Source) ~[jobflow-byCategory.jar:na]
at com.asakusafw.dag.runtime.skeleton.GenericTaskProcessor.run(GenericTaskProcessor.java:64) ~[asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.m3bp.bridge.VertexProcessorBridge$Driver.run(VertexProcessorBridge.java:298) ~[asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.m3bp.bridge.VertexProcessorBridge.run(VertexProcessorBridge.java:171) ~[asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.m3bp.mirror.jni.EngineMirrorImpl.doCall(EngineMirrorImpl.java:295) [asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
at com.asakusafw.m3bp.mirror.jni.EngineMirrorImpl.doRun(EngineMirrorImpl.java:232) [asakusa-m3bp-assembly-0.1.2-SNAPSHOT-lib.jar:na]
[2016-06-18 14:34:07.357053] [0x00007fdbdde52700] [error] An exception is thrown: (no message)
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
エラーメッセージ中の、buffer-sizeが出力バッファーのサイズ、exceededは空き容量?
last-page-sizeは、バッファーに書き込もうとしたサイズ。
出力バッファーのサイズを調整する必要がある。
バッチの実行が異様に遅いことがあった。Linuxのsarコマンドやdstatコマンドで見たときに1プロセッサー分だけCPUのsysの使用率が異様に高く、上限に張り付いている感じ(CPUのusrがほとんど0)だった。[2016-06-22]
このケースでは、vertexの出力バッファー数がかなり多いアプリケーションだったのに、1つ当たりの出力バッファーのサイズを大きくしすぎたのが原因だった。
(M3BP 0.1.1では)出力バッファーの確保(malloc相当?)は1つのスレッドで行われるので、そこに負荷が集中してしまったらしい。
特定のバッチの為に出力バッファーサイズを変更するのにm3bp.propertiesで指定すると、他のバッチにも影響してしまう。
出力バッファーサイズを指定するのは個々のバッチ毎の方がいいと思う。