coder-dongjiayi / MXLogger

MXLogger 是基于mmap内存映射机制的跨平台日志库,支持AES CFB 128位加密,支持iOS Android Flutter。核心代码使用C/C++实现, Flutter端通过ffi调用,性能几乎与原生一致。 底层序列化使用Google开源的flat_buffers实现,高效稳定。
Other
142 stars 18 forks source link

指定目录directory crash #3

Closed philos3 closed 1 year ago

philos3 commented 1 year ago

指定目录directory: /data/user/0/com.example.bbj_flutter.host/cache nameSpace:test.mxlogger

await MXLogger.initialize( nameSpace:"test.mxlogger", directory: "/data/user/0/com.example.bbj_flutter.host/cache",

  ///按日多文件存储
  storagePolicy: "yyyy_MM_dd",
  // cryptKey: "abcuioqbsdguijlk",
  // iv: "bccuioqbsdguijiv",
);

=================log=============== E/mxlogger_error: base_file_sink error:Read-only file system E/mxlogger_error: opefile error:No such file or directory E/mxlogger_error: [mxlogger_error]start_mmap error:Bad file descriptor F/libc (11272): Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 11386 (1.ui), pid 11272 (bj_flutter.host)


Build fingerprint: 'HUAWEI/NAM-AL00/HWNAM:12/HUAWEINAM-AL00/103.0.0.163C00:user/release-keys' Revision: '0' ABI: 'arm64' Timestamp: 2023-01-01 17:24:28.062435630+0800 Process uptime: 0s Cmdline: com.example.bbj_flutter.host pid: 11272, tid: 11386, name: 1.ui >>> com.example.bbj_flutter.host <<< uid: 10412 signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 Cause: null pointer dereference x0 00000000ffffffff x1 0000000000000000 x2 0000000000000050 x3 0000000000000004 x4 000000730f1835e0 x5 ff00000000000000 x6 2e00000000000000 x7 00000000000000ff x8 0000000000000000 x9 6e0d33c9f546fa57 x10 0000000000000040 x11 0000007340000000 x12 0000000000000000 x13 00000000072cf9d0 x14 ff00000000000000 x15 ffffffffffffffff x16 000000743796cf48 x17 00000074378f9d94 x18 00000073073bc000 x19 b40000743b7d8c58 x20 000000730f184c38 x21 000000730f186000 x22 0000000000000000 x23 0000000000000000 x24 0000000000000000 x25 0000000000000000 x26 b400007371c56d10 x27 b40000743b7d8c40 x28 b400007318f544b8 x29 000000730f184bd0 lr 00000072edbb9a5c sp 000000730f184bc0 pc 00000072edbb9a6c pst 0000000020001000 backtrace:

00 pc 000000000002ca6c /data/app/~~RgOUpIC1rLXKn2Qge4oqrQ==/com.example.bbj_flutter.host-5HN3F5PbyJl754RT93dobw==/lib/arm64/libmxlogger.so (mxlogger::sinks::mmap_sink::mmap_sink(std::ndk1::basic_string<char, std::__ndk1::char_traits, std::ndk1::allocator > const&, policy::storage_policy)+200) (BuildId: 5d1f1120dba3f6294019c41d07a2468589281539)

  #01 pc 0000000000027818  /data/app/~~RgOUpIC1rLXKn2Qge4oqrQ==/com.example.bbj_flutter.host-5HN3F5PbyJl754RT93dobw==/lib/arm64/libmxlogger.so (std::__ndk1::__shared_ptr_emplace<mxlogger::sinks::mmap_sink, std::__ndk1::allocator<mxlogger::sinks::mmap_sink> >::__shared_ptr_emplace<char const*&, policy::storage_policy>(std::__ndk1::allocator<mxlogger::sinks::mmap_sink>, char const*&, policy::storage_policy&&)+84) (BuildId: 5d1f1120dba3f6294019c41d07a2468589281539)
  #02 pc 0000000000025b28  /data/app/~~RgOUpIC1rLXKn2Qge4oqrQ==/com.example.bbj_flutter.host-5HN3F5PbyJl754RT93dobw==/lib/arm64/libmxlogger.so (mxlogger::mxlogger::mxlogger(char const*, char const*, char const*, char const*, char const*, char const*)+264) (BuildId: 5d1f1120dba3f6294019c41d07a2468589281539)
  #03 pc 0000000000025564  /data/app/~~RgOUpIC1rLXKn2Qge4oqrQ==/com.example.bbj_flutter.host-5HN3F5PbyJl754RT93dobw==/lib/arm64/libmxlogger.so (mxlogger::mxlogger::initialize_namespace(char const*, char const*, char const*, char const*, char const*, char const*, char const*)+324) (BuildId: 5d1f1120dba3f6294019c41d07a2468589281539)
  #04 pc 0000000000020c10  /data/app/~~RgOUpIC1rLXKn2Qge4oqrQ==/com.example.bbj_flutter.host-5HN3F5PbyJl754RT93dobw==/lib/arm64/libmxlogger.so (flutter_mxlogger_initialize+28) (BuildId: 5d1f1120dba3f6294019c41d07a2468589281539)
  #05 pc 0000000000006794  [anon:dart-codespace]
coder-dongjiayi commented 1 year ago

指定目录directory: /data/user/0/com.example.bbj_flutter.host/cache nameSpace:test.mxlogger

await MXLogger.initialize( nameSpace:"test.mxlogger", directory: "/data/user/0/com.example.bbj_flutter.host/cache",

  ///按日多文件存储
  storagePolicy: "yyyy_MM_dd",
  // cryptKey: "abcuioqbsdguijlk",
  // iv: "bccuioqbsdguijiv",
);

=================log=============== E/mxlogger_error: base_file_sink error:Read-only file system E/mxlogger_error: opefile error:No such file or directory E/mxlogger_error: [mxlogger_error]start_mmap error:Bad file descriptor F/libc (11272): Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 11386 (1.ui), pid 11272 (bj_flutter.host)

Build fingerprint: 'HUAWEI/NAM-AL00/HWNAM:12/HUAWEINAM-AL00/103.0.0.163C00:user/release-keys' Revision: '0' ABI: 'arm64' Timestamp: 2023-01-01 17:24:28.062435630+0800 Process uptime: 0s Cmdline: com.example.bbj_flutter.host pid: 11272, tid: 11386, name: 1.ui >>> com.example.bbj_flutter.host <<< uid: 10412 signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 Cause: null pointer dereference x0 00000000ffffffff x1 0000000000000000 x2 0000000000000050 x3 0000000000000004 x4 000000730f1835e0 x5 ff00000000000000 x6 2e00000000000000 x7 00000000000000ff x8 0000000000000000 x9 6e0d33c9f546fa57 x10 0000000000000040 x11 0000007340000000 x12 0000000000000000 x13 00000000072cf9d0 x14 ff00000000000000 x15 ffffffffffffffff x16 000000743796cf48 x17 00000074378f9d94 x18 00000073073bc000 x19 b40000743b7d8c58 x20 000000730f184c38 x21 000000730f186000 x22 0000000000000000 x23 0000000000000000 x24 0000000000000000 x25 0000000000000000 x26 b400007371c56d10 x27 b40000743b7d8c40 x28 b400007318f544b8 x29 000000730f184bd0 lr 00000072edbb9a5c sp 000000730f184bc0 pc 00000072edbb9a6c pst 0000000020001000 backtrace: #00 pc 000000000002ca6c /data/app/RgOUpIC1rLXKn2Qge4oqrQ==/com.example.bbj_flutter.host-5HN3F5PbyJl754RT93dobw==/lib/arm64/libmxlogger.so (mxlogger::sinks::mmap_sink::mmap_sink(std::ndk1::basic_string<char, std::__ndk1::char_traits, std::ndk1::allocator > const&, policy::storage_policy)+200) (BuildId: 5d1f1120dba3f6294019c41d07a2468589281539) #1 pc 0000000000027818 /data/app/RgOUpIC1rLXKn2Qge4oqrQ==/com.example.bbj_flutter.host-5HN3F5PbyJl754RT93dobw==/lib/arm64/libmxlogger.so (std::ndk1::shared_ptr_emplace<mxlogger::sinks::mmap_sink, std::ndk1::allocatormxlogger::sinks::mmap_sink >::__shared_ptr_emplace<char const*&, policy::storage_policy>(std::ndk1::allocatormxlogger::sinks::mmap_sink, char const&, policy::storage_policy&&)+84) (BuildId: 5d1f1120dba3f6294019c41d07a2468589281539) #2 pc 0000000000025b28 /data/app/~~RgOUpIC1rLXKn2Qge4oqrQ==/com.example.bbj_flutter.host-5HN3F5PbyJl754RT93dobw==/lib/arm64/libmxlogger.so (mxlogger::mxlogger::mxlogger(char const, char const, char const, char const, char const, char const)+264) (BuildId: 5d1f1120dba3f6294019c41d07a2468589281539) #3 pc 0000000000025564 /data/app/~~RgOUpIC1rLXKn2Qge4oqrQ==/com.example.bbj_flutter.host-5HN3F5PbyJl754RT93dobw==/lib/arm64/libmxlogger.so (mxlogger::mxlogger::initialize_namespace(char const, char const, char const, char const, char const, char const, char const)+324) (BuildId: 5d1f1120dba3f6294019c41d07a2468589281539) #04 pc 0000000000020c10 /data/app/~~RgOUpIC1rLXKn2Qge4oqrQ==/com.example.bbj_flutter.host-5HN3F5PbyJl754RT93dobw==/lib/arm64/libmxlogger.so (flutter_mxlogger_initialize+28) (BuildId: 5d1f1120dba3f6294019c41d07a2468589281539) #05 pc 0000000000006794 [anon:dart-codespace]

刚发了一个新版 1.2.0+1 修复了这个bug