strongswan报错:JNI DETECTED ERROR IN APPLICATION::use of deleted weak global reference 0xedc5338b

07-20 17:09:55.356 20295-21145/org.strongswan.android E/art: JNI ERROR (app bug): accessed stale weak global reference 0xedc5338b (index 19682 in a table of size 5526)
07-20 17:09:55.404 20295-21145/org.strongswan.android A/art: art/runtime/java_vm_ext.cc:470] JNI DETECTED ERROR IN APPLICATION: use of deleted weak global reference 0xedc5338b
07-20 17:09:55.404 20295-21145/org.strongswan.android A/art: art/runtime/java_vm_ext.cc:470]     from void org.strongswan.android.logic.CharonVpnService.initiate(java.lang.String)

android代码:

if (initializeCharon(builder, mLogFile, mCurrentProfile.getVpnType().has(VpnTypeFeature.BYOD)))
{
   Log.i(TAG, "charon started");
   SettingsWriter writer = new SettingsWriter();
   writer.setValue("global.language", Locale.getDefault().getLanguage());
   writer.setValue("global.mtu", mCurrentProfile.getMTU());
   writer.setValue("global.nat_keepalive", mCurrentProfile.getNATKeepAlive());
   writer.setValue("connection.type", mCurrentProfile.getVpnType().getIdentifier());
   writer.setValue("connection.server", mCurrentProfile.getGateway());
   writer.setValue("connection.port", mCurrentProfile.getPort());
   writer.setValue("connection.username", mCurrentProfile.getUsername());
   writer.setValue("connection.password", mCurrentProfile.getPassword());
   writer.setValue("connection.local_id", mCurrentProfile.getLocalId());
   writer.setValue("connection.remote_id", mCurrentProfile.getRemoteId());
   writer.setValue("connection.certreq", (mCurrentProfile.getFlags() & VpnProfile.FLAGS_SUPPRESS_CERT_REQS) == 0);
   initiate(writer.serialize());
}
/**
 * Initiate VPN, provided by libandroidbridge.so
 */
public native void initiate(String config);


C代码:

/**
 * Initiate a new connection
 *
 * @param settings       configuration settings (gets owned)
 */
static void initiate(settings_t *settings)
{
   private_charonservice_t *this = (private_charonservice_t*)charonservice;

   lib->settings->set_str(lib->settings,
                  "charon.plugins.tnc-imc.preferred_language",
                  settings->get_str(settings, "global.language", "en"));
   /* this is actually the size of the complete IKE/IP packet, so if the MTU
    * for the TUN devices has to be reduced to pass traffic the IKE packets
    * will be a bit smaller than necessary as there is no IPsec overhead like
    * for the tunneled traffic (but compensating that seems like overkill) */
   lib->settings->set_int(lib->settings,
                  "charon.fragment_size",
                  settings->get_int(settings, "global.mtu",
                                ANDROID_DEFAULT_MTU));
   /* use configured interval, or an increased default to save battery power */
   lib->settings->set_int(lib->settings,
                  "charon.keep_alive",
                  settings->get_int(settings, "global.nat_keepalive",
                                ANDROID_KEEPALIVE_INTERVAL));

   this->creds->clear(this->creds);
   DESTROY_IF(this->service);
   this->service = android_service_create(this->creds, settings);
}

求教strongswan报错:JNI DETECTED ERROR IN APPLICATION::use of deleted weak global reference 0xedc5338b原因



  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值