williamwen1986 / flutter_orm_demo

demo of flutter_orm_plugin
29 stars 2 forks source link

batchSaveOrms插入Android报错 #3

Open 92ppl opened 5 years ago

92ppl commented 5 years ago
D/business(28365): [06-18/16:25:42.827:I:JNIModel.cpp(197)] Long ConvertToNative, 338449914483253248
F/art     (28365): art/runtime/indirect_reference_table.cc:115] JNI ERROR (app bug): local reference table overflow (max=512)
F/art     (28365): art/runtime/indirect_reference_table.cc:115] local reference table dump:
F/art     (28365): art/runtime/indirect_reference_table.cc:115]   Last 10 entries (of 512):
F/art     (28365): art/runtime/indirect_reference_table.cc:115]       511: 0x130f67e0 java.lang.String "dId"
F/art     (28365): art/runtime/indirect_reference_table.cc:115]       510: 0x130f6860 java.util.HashMap$HashMapEntry
F/art     (28365): art/runtime/indirect_reference_table.cc:115]       509: 0x6f9cc7d0 java.lang.Class<java.util.HashMap$EntryIterator>
F/art     (28365): art/runtime/indirect_reference_table.cc:115]       508: 0x6f9cc7d0 java.lang.Class<java.util.HashMap$EntryIterator>
F/art     (28365): art/runtime/indirect_reference_table.cc:115]       507: 0x6f9cc7d0 java.lang.Class<java.util.HashMap$EntryIterator>
F/art     (28365): art/runtime/indirect_reference_table.cc:115]       506: 0x6f9ac2d8 java.lang.Class<java.lang.Long>
F/art     (28365): art/runtime/indirect_reference_table.cc:115]       505: 0x6f9cc7d0 java.lang.Class<java.util.HashMap$EntryIterator>
F/art     (28365): art/runtime/indirect_reference_table.cc:115]       504: 0x6f9cc7d0 java.lang.Class<java.util.HashMap$EntryIterator>
F/art     (28365): art/runtime/indirect_reference_table.cc:115]       503: 0x6f9cc7d0 java.lang.Class<java.util.HashMap$EntryIterator>
F/art     (28365): art/runtime/indirect_reference_table.cc:115]       502: 0x6f9cc7d0 java.lang.Class<java.util.HashMap$EntryIterator>
F/art     (28365): art/runtime/indirect_reference_table.cc:115]   Summary:
F/art     (28365): art/runtime/indirect_reference_table.cc:115]         1 of io.flutter.embedding.engine.FlutterJNI
F/art     (28365): art/runtime/indirect_reference_table.cc:115]       495 of java.lang.Class (7 unique instances)
F/art     (28365): art/runtime/indirect_reference_table.cc:115]         1 of java.lang.String[] (3 elements)
F/art     (28365): art/runtime/indirect_reference_table.cc:115]         6 of java.lang.String (6 unique instances)
F/art     (28365): art/runtime/indirect_reference_table.cc:115]         1 of java.util.ArrayList
F/art     (28365): art/runtime/indirect_reference_table.cc:115]         2 of java.util.HashMap$EntryIterator (2 unique instances)
F/art     (28365): art/runtime/indirect_reference_table.cc:115]         2 of java.util.HashMap$EntrySet (2 unique instances)
F/art     (28365): art/runtime/indirect_reference_table.cc:115]         2 of java.util.HashMap$HashMapEntry (2 unique instances)
F/art     (28365): art/runtime/indirect_reference_table.cc:115]         1 of java.util.HashMap
F/art     (28365): art/runtime/indirect_reference_table.cc:115]         1 of byte[] (333602 elements)
F/art     (28365): art/runtime/indirect_reference_table.cc:115] 
F/art     (28365): art/runtime/barrier.cc:90] Check failed: count_ == 0 (count_=-1, 0=0) Attempted to destroy barrier with non zero count
F/art     (28365): art/runtime/runtime.cc:366] Runtime aborting --- recursively, so no thread-specific detail!
F/art     (28365): art/runtime/runtime.cc:366] 
F/libc    (28365): Fatal signal 6 (SIGABRT), code -6 in tid 28365 (h_redux_example)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'google/hammerhead/hammerhead:6.0.1/MMB29S/3437181:user/release-keys'
Revision: '11'
ABI: 'arm'
pid: 28365, tid: 28365, name: h_redux_example  >>> com.crystal.fish_redux_example <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: 'art/runtime/indirect_reference_table.cc:115] JNI ERROR (app bug): local reference table overflow (max=512)'
    r0 00000000  r1 00006ecd  r2 00000006  r3 b6f37b7c
    r4 b6f37b84  r5 b6f37b34  r6 00000000  r7 0000010c
    r8 b4bbf800  r9 b4bbde44  sl 92a3c45b  fp b4ba3438
    ip 00000006  sp bea4b4c0  lr b6c90b61  pc b6c92f50  cpsr 40070010
backtrace:
    #00 pc 00041f50  /system/lib/libc.so (tgkill+12)
    #01 pc 0003fb5d  /system/lib/libc.so (pthread_kill+32)
    #02 pc 0001c30f  /system/lib/libc.so (raise+10)
    #03 pc 000194c1  /system/lib/libc.so (__libc_android_abort+34)
    #04 pc 000174ac  /system/lib/libc.so (abort+4)
    #05 pc 00333959  /system/lib/libart.so (art::Runtime::Abort()+228)
    #06 pc 000f45fb  /system/lib/libart.so (art::LogMessage::~LogMessage()+2226)
    #07 pc 000f08d1  /system/lib/libart.so (art::Barrier::~Barrier()+216)
    #08 pc 0035b45b  /system/lib/libart.so (art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+162)
    #09 pc 00333a1d  /system/lib/libart.so (art::Runtime::Abort()+424)
    #10 pc 000f45fb  /system/lib/libart.so (art::LogMessage::~LogMessage()+2226)
    #11 pc 001de435  /system/lib/libart.so (art::IndirectReferenceTable::Add(unsigned int, art::mirror::Object*)+248)
    #12 pc 0028c0b9  /system/lib/libart.so (art::JNI::CallObjectMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+368)
    #13 pc 00110dc1  /system/lib/libart.so (art::CheckJNI::CallMethodV(char const*, _JNIEnv*, _jobject*, _jclass*, _jmethodID*, std::__va_list, art::Primitive::Type, art::InvokeType)+1124)
    #14 pc 001124ab  /system/lib/libart.so (art::CheckJNI::CallObjectMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+34)
    #15 pc 0007d877  /data/app/com.crystal.fish_redux_example-1/lib/arm/libluaFramework.so
    #16 pc 0007dab1  /data/app/com.crystal.fish_redux_example-1/lib/arm/libluaFramework.so
    #17 pc 0007db6f  /data/app/com.crystal.fish_redux_example-1/lib/arm/libluaFramework.so
    #18 pc 0007dac7  /data/app/com.crystal.fish_redux_example-1/lib/arm/libluaFramework.so
    #19 pc 0007df07  /data/app/com.crystal.fish_redux_example-1/lib/arm/libluaFramework.so
    #20 pc 0007c643  /data/app/com.crystal.fish_redux_example-1/lib/arm/libluaFramework.so (Java_com_common_luakit_LuaHelper_callLuaFunction__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_Object_2Ljava_lang_Object_2+126)
    #21 pc 0006d2bf  /data/app/com.crystal.fish_redux_example-1/oat/arm/base.odex (offset 0x6d000) (java.lang.Object com.common.luakit.LuaHelper.callLuaFunction(java.lang.String, java.lang.String, java.lang.Object, java.lang.Object)+170)
    #22 pc 000bdb85  /data/app/com.crystal.fish_redux_example-1/oat/arm/base.odex (offset 0x6d000) (void com.luakit.flutterluakitplugin.FlutterLuakitPlugin.onMethodCall(io.flutter.plugin.common.MethodCall, io.flutter.plugin.common.MethodChannel$Result)+552)
    #23 pc 000ce849  /data/app/com.crystal.fish_redux_example-1/oat/arm/base.odex (offset 0x6d000) (void io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(java.nio.ByteBuffer, io.flutter.plugin.common.BinaryMessenger$BinaryReply)+212)
    #24 pc 000c66e9  /data/app/com.crystal.fish_redux_example-1/oat/arm/base.odex (offset 0x6d000) (void io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(java.lang.String, byte[], int)+292)
    #25 pc 000799bf  /data/app/com.crystal.fish_redux_example-1/oat/arm/base.odex (offset 0x6d000) (void io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(java.lang.String, byte[], int)+106)
    #26 pc 000e6331  /system/lib/libart.so (art_quick_invoke_stub_internal+64)
    #27 pc 0040288d  /system/lib/libart.so (art_quick_invoke_stub+188)
    #28 pc 007fdcc4  [stack]
Tombstone written to: /data/tombstones/tombstone_00
Lost connection to device.
williamwen1986 commented 5 years ago

please update the latest version and try again

williamwen1986 commented 5 years ago

试试新版本,我没报这个错

tookbra commented 5 years ago

试试新版本,我没报这个错

同样复现这个错误,批量插入数据量为2700条

williamwen1986 commented 5 years ago

试试新版本,我没报这个错

同样复现这个错误,批量插入数据量为2700条

麻烦贴一下出现错误的代码?

williamwen1986 commented 5 years ago

把demo里面的 SelectDemo.dart里面改成下面代码,没出现问题? for(int i = 0 ; i < 10000 ; i++) { List words = new List(); words.addAll(generateWordPairs().take(1)); WordPair np = words[0]; String name = np.asString; int score = Random().nextInt(100); String className = "class${score%3}"; Map m = {"name":name, "class":className, "score":score}; orms.add(m); } FlutterOrmPlugin.batchSaveOrms("Student", orms);

tookbra commented 5 years ago

把demo里面的 SelectDemo.dart里面改成下面代码,没出现问题? for(int i = 0 ; i < 10000 ; i++) { List words = new List(); words.addAll(generateWordPairs().take(1)); WordPair np = words[0]; String name = np.asString; int score = Random().nextInt(100); String className = "class${score%3}"; Map m = {"name":name, "class":className, "score":score}; orms.add(m); } FlutterOrmPlugin.batchSaveOrms("Student", orms);

按照上面的代码会出现这个问题,大概批量插入500条的时候 image

williamwen1986 commented 5 years ago

把demo里面的 SelectDemo.dart里面改成下面代码,没出现问题? for(int i = 0 ; i < 10000 ; i++) { List words = new List(); words.addAll(generateWordPairs().take(1)); WordPair np = words[0]; String name = np.asString; int score = Random().nextInt(100); String className = "class${score%3}"; Map m = {"name":name, "class":className, "score":score}; orms.add(m); } FlutterOrmPlugin.batchSaveOrms("Student", orms);

按照上面的代码会出现这个问题,大概批量插入500条的时候 image

flutter版本是多少,然后测试的手机型号、版本是什么呢?我这边测试了几台手机重现不了

lixingmao commented 5 years ago

遇到类似问题,顶一下,最新 Master 分支代码; 设备信息: 客户的一个 Android 定制硬件设备,系统定制极少,可理解为标准的 SAOP 7.0 系统; 直接运行 demo,select 页面初始化,构建批量数据时崩溃; 经尝试批量操作数据低于 470 时正常, 反之则崩溃,日志与楼主一样; Flutter 版本信息: [✓] Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.15.1 19B88, locale zh-Hans-CN) • Flutter version 1.9.1+hotfix.6 at /Users/li/Documents/flutter • Framework revision 68587a0916 (8 weeks ago), 2019-09-13 19:46:58 -0700 • Engine revision b863200c37 • Dart version 2.5.0