iTXTech / mirai-native

强大的 mirai 原生插件加载器
GNU Affero General Public License v3.0
371 stars 141 forks source link

加载由Native C# SDK编写的插件时停止工作 #98

Closed buger404 closed 3 years ago

buger404 commented 3 years ago

加载由Native C# SDK编写的插件时停止工作

复现步骤

期望的行为 能够正常载入此类插件

截图和日志 2020-10-01 14:40:10 I/main: Starting mirai-console... 2020-10-01 14:40:10 I/main: Backend: version 1.0-RC-dev-28, built on 2020-09-21 12:37:02. 2020-10-01 14:40:10 I/main: Frontend Terminal: version 1.0-RC-dev-28, provided by Mamoe Technologies 2020-10-01 14:40:10 V/main: Loading configurations... 2020-10-01 14:40:11 V/main: Loading JVM plugins... 2020-10-01 14:40:11 I/plugin: Successfully loaded plugin MiraiNative 2020-10-01 14:40:11 V/main: 0 external PluginLoader(s) found. 2020-10-01 14:40:11 V/main: 1 plugin(s) loaded. 2020-10-01 14:40:11 V/main: Loading PermissionService... 2020-10-01 14:40:11 V/main: Reloaded PermissionService settings. 2020-10-01 14:40:11 V/main: Loading built-in commands... 2020-10-01 14:40:11 V/main: Prepared built-in commands: help, login, permission, stop 2020-10-01 14:40:11 V/main: Enabling plugins... 2020-10-01 14:40:12 I/MiraiNative: 正在加载 Mirai Native Bridge C:\MiraiConsole\Intallk.\data\MiraiNative\CQP.dll 2020-10-01 14:40:12 I/MiraiNative: 正在加载外部库 C:\MiraiConsole\Intallk.\data\MiraiNative\libraries\libiconv.dll 2020-10-01 14:40:12 I/MiraiNative: 正在加载外部库 C:\MiraiConsole\Intallk.\data\MiraiNative\libraries\sqlite3.dll 2020-10-01 14:40:12 I/main: 1 plugin(s) enabled. 2020-10-01 14:40:12 I/main: mirai-console started successfully. 2020-10-01 14:40:12 I/MiraiNative: 插件 app.dll 已被加载,返回值为 0 。

A fatal error has been detected by the Java Runtime Environment:

Internal Error (0xe0434352), pid=4168, tid=0x000013e8

JRE version: Java(TM) SE Runtime Environment (8.0_202-b08) (build 1.8.0_202-b08) Java VM: Java HotSpot(TM) Client VM (25.202-b08 mixed mode windows-x86 ) Problematic frame: C [KERNELBASE.dll+0xdc1e2]

Core dump written. Default location: C:\MiraiConsole\Intallk\hs_err_pid4168.mdmp

An error report file with more information is saved as: C:\MiraiConsole\Intallk\hs_err_pid4168.log

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.

由于.mdmp和停止工作后产生的日志文件过大/过长,如需要再一并上传。

运行环境

操作系统:Windows Server 2016 mirai core 1.3.1 mirai console 1.0-RC-dev-29 mirai native 1.9.3 Java jre8.0 x86

更多信息 异常插件被加载后,插件目录结构有变化:

│  app.dll(CQHTTP插件)
│  app.json
│  io.github.buger404.intallk.dll(异常插件)
│  io.github.buger404.intallk.json
│
└─io.github.buger404.intallk
        commonservicelocator.dll
        io.github.buger404.intallk.code.dll
        io.github.buger404.intallk.code.pdb
        native.csharp.sdk.dll
        native.csharp.sdk.pdb
        unity.abstractions.dll
        unity.configuration.dll
        unity.container.dll
        unity.interception.configuration.dll
        unity.interception.dll
        unity.registrationbyconvention.dll
        unity.servicelocation.dll

原先的目录结构:

│  app.dll
│  app.json
│  io.github.buger404.intallk.dll
│  io.github.buger404.intallk.json
buger404 commented 3 years ago

补充:已将目录结构变化后产生的io.github.buger404.intallk.code.dll放入plugins载入作为插件测试。 测试结果:控制台提示已加载,但似乎插件没能正常工作。(所有功能都未能执行,无反应)

buger404 commented 3 years ago

已自行解决: