Cryptopp致命的信号11 [英] Cryptopp fatal signal 11

查看:521
本文介绍了Cryptopp致命的信号11的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是LOG1 aplication输出:

Here is log1 aplication output:

   :    ... 25 more
W/System.err( 1500): java.lang.ClassNotFoundException: android.graphics.drawable.VectorDrawable
W/System.err( 1500):    at java.lang.Class.classForName(Native Method)
W/System.err( 1500):    at java.lang.Class.forName(Class.java:217)
W/System.err( 1500):    at java.lang.Class.forName(Class.java:172)
W/System.err( 1500):    at org.qtproject.qt5.android.ExtractStyle.getClass(ExtractStyle.java:388)
W/System.err( 1500):    at org.qtproject.qt5.android.ExtractStyle.<init>(ExtractStyle.java:94)
W/System.err( 1500):    at org.qtproject.qt5.android.QtActivityDelegate.loadApplication(QtActivityDelegate.java:430)
W/System.err( 1500):    at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err( 1500):    at java.lang.reflect.Method.invoke(Method.java:511)
W/System.err( 1500):    at org.qtproject.qt5.android.bindings.QtActivity.loadApplication(QtActivity.java:245)
W/System.err( 1500):    at org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:655)
W/System.err( 1500):    at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:895)
W/System.err( 1500):    at android.app.Activity.performCreate(Activity.java:5275)
W/System.err( 1500):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1082)
W/System.err( 1500):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2049)
W/System.err( 1500):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2110)
W/System.err( 1500):    at android.app.ActivityThread.access$600(ActivityThread.java:138)
W/System.err( 1500):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205)
W/System.err( 1500):    at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err( 1500):    at android.os.Looper.loop(Looper.java:137)
W/System.err( 1500):    at android.app.ActivityThread.main(ActivityThread.java:4950)
W/System.err( 1500):    at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err( 1500):    at java.lang.reflect.Method.invoke(Method.java:511)
W/System.err( 1500):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:798)
W/System.err( 1500):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:565)
W/System.err( 1500):    at dalvik.system.NativeStart.main(Native Method)
W/System.err( 1500): Caused by: java.lang.NoClassDefFoundError: android/graphics/drawable/VectorDrawable
W/System.err( 1500):    ... 25 more
W/System.err( 1500): Caused by: java.lang.ClassNotFoundException: android.graphics.drawable.VectorDrawable
W/System.err( 1500):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
W/System.err( 1500):    at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
W/System.err( 1500):    at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
W/System.err( 1500):    ... 25 more
W/System.err( 1500): java.lang.NoSuchFieldException: View_paddingStart
W/System.err( 1500):    at java.lang.Class.getDeclaredField(Class.java:631)
W/System.err( 1500):    at org.qtproject.qt5.android.ExtractStyle.getField(ExtractStyle.java:427)
W/System.err( 1500):    at org.qtproject.qt5.android.ExtractStyle.<init>(ExtractStyle.java:173)
W/System.err( 1500):    at org.qtproject.qt5.android.QtActivityDelegate.loadApplication(QtActivityDelegate.java:430)
W/System.err( 1500):    at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err( 1500):    at java.lang.reflect.Method.invoke(Method.java:511)
W/System.err( 1500):    at org.qtproject.qt5.android.bindings.QtActivity.loadApplication(QtActivity.java:245)
W/System.err( 1500):    at org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:655)
W/System.err( 1500):    at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:895)
W/System.err( 1500):    at android.app.Activity.performCreate(Activity.java:5275)
W/System.err( 1500):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1082)
W/System.err( 1500):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2049)
W/System.err( 1500):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2110)
W/System.err( 1500):    at android.app.ActivityThread.access$600(ActivityThread.java:138)
W/System.err( 1500):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205)
W/System.err( 1500):    at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err( 1500):    at android.os.Looper.loop(Looper.java:137)
W/System.err( 1500):    at android.app.ActivityThread.main(ActivityThread.java:4950)
W/System.err( 1500):    at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err( 1500):    at java.lang.reflect.Method.invoke(Method.java:511)
W/System.err( 1500):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:798)
W/System.err( 1500):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:565)
W/System.err( 1500):    at dalvik.system.NativeStart.main(Native Method)
W/System.err( 1500): java.lang.NoSuchFieldException: View_paddingEnd
W/System.err( 1500):    at java.lang.Class.getDeclaredField(Class.java:631)
W/System.err( 1500):    at org.qtproject.qt5.android.ExtractStyle.getField(ExtractStyle.java:427)
W/System.err( 1500):    at org.qtproject.qt5.android.ExtractStyle.<init>(ExtractStyle.java:174)
W/System.err( 1500):    at org.qtproject.qt5.android.QtActivityDelegate.loadApplication(QtActivityDelegate.java:430)
W/System.err( 1500):    at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err( 1500):    at java.lang.reflect.Method.invoke(Method.java:511)
W/System.err( 1500):    at org.qtproject.qt5.android.bindings.QtActivity.loadApplication(QtActivity.java:245)
W/System.err( 1500):    at org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:655)
W/System.err( 1500):    at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:895)
W/System.err( 1500):    at android.app.Activity.performCreate(Activity.java:5275)
W/System.err( 1500):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1082)
W/System.err( 1500):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2049)
W/System.err( 1500):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2110)
W/System.err( 1500):    at android.app.ActivityThread.access$600(ActivityThread.java:138)
W/System.err( 1500):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205)
W/System.err( 1500):    at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err( 1500):    at android.os.Looper.loop(Looper.java:137)
W/System.err( 1500):    at android.app.ActivityThread.main(ActivityThread.java:4950)
W/System.err( 1500):    at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err( 1500):    at java.lang.reflect.Method.invoke(Method.java:511)
W/System.err( 1500):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:798)
W/System.err( 1500):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:565)
W/System.err( 1500):    at dalvik.system.NativeStart.main(Native Method)
D/dalvikvm( 1500): GC_CONCURRENT freed 494K, 14% free 5744K/6663K, paused 81ms+191ms, total 320ms
D/dalvikvm( 1500): WAIT_FOR_CONCURRENT_GC blocked 18ms
W/ResourceType( 1500): Skipping entry 0x10804c7 in package table 0 because it is not complex!
D/dalvikvm( 1500): GC_CONCURRENT freed 462K, 14% free 5843K/6727K, paused 34ms+3ms, total 75ms
D/dalvikvm( 1500): WAIT_FOR_CONCURRENT_GC blocked 18ms
D/dalvikvm( 1500): GC_FOR_ALLOC freed 541K, 15% free 5829K/6791K, paused 18ms, total 18ms
D/dalvikvm( 1500): GC_CONCURRENT freed 409K, 13% free 5932K/6791K, paused 55ms+3ms, total 95ms
D/dalvikvm( 1500): WAIT_FOR_CONCURRENT_GC blocked 40ms
D/dalvikvm( 1500): GC_CONCURRENT freed 501K, 14% free 5990K/6919K, paused 67ms+2ms, total 100ms
D/dalvikvm( 1500): WAIT_FOR_CONCURRENT_GC blocked 36ms
D/dalvikvm( 1500): GC_CONCURRENT freed 544K, 15% free 5999K/6983K, paused 2ms+3ms, total 63ms
D/dalvikvm( 1500): WAIT_FOR_CONCURRENT_GC blocked 44ms
D/dalvikvm( 1500): GC_FOR_ALLOC freed 477K, 14% free 6032K/6983K, paused 17ms, total 18ms
D/dalvikvm( 1500): GC_CONCURRENT freed 479K, 14% free 6065K/6983K, paused 63ms+2ms, total 106ms
D/dalvikvm( 1500): WAIT_FOR_CONCURRENT_GC blocked 43ms
D/dalvikvm( 1500): GC_FOR_ALLOC freed 489K, 14% free 6072K/7047K, paused 19ms, total 20ms
D/dalvikvm( 1500): GC_CONCURRENT freed 438K, 13% free 6137K/7047K, paused 31ms+3ms, total 72ms
D/dalvikvm( 1500): WAIT_FOR_CONCURRENT_GC blocked 43ms
D/dalvikvm( 1500): GC_FOR_ALLOC freed 299K, 14% free 6143K/7111K, paused 19ms, total 19ms
D/dalvikvm( 1500): GC_FOR_ALLOC freed 30K, 14% free 6156K/7111K, paused 19ms, total 19ms
D/dalvikvm( 1500): GC_FOR_ALLOC freed 38K, 14% free 6149K/7111K, paused 19ms, total 19ms
D/dalvikvm( 1500): GC_FOR_ALLOC freed 499K, 14% free 6158K/7111K, paused 20ms, total 21ms
D/dalvikvm( 1500): GC_CONCURRENT freed 531K, 14% free 6138K/7111K, paused 17ms+3ms, total 80ms
D/dalvikvm( 1500): WAIT_FOR_CONCURRENT_GC blocked 63ms
I/Adreno200-EGL( 1500): <qeglDrvAPI_eglInitialize:299>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_JB_REL_2.0.3_RB3.04.01.01.42.006_msm7627a_JB_REL_2.0.3_Merge_release_AU (Merge)
I/Adreno200-EGL( 1500): Build Date: 04/01/13 Mon
I/Adreno200-EGL( 1500): Local Branch:
I/Adreno200-EGL( 1500): Remote Branch: m/jb_rel_2.0.3
I/Adreno200-EGL( 1500): Local Patches: NONE
I/Adreno200-EGL( 1500): Reconstruct Branch: NOTHING
I/Choreographer( 1500): Skipped 31 frames!  The application may be doing too much work on its main thread.
D/libtestAndroid4.so( 1500): (null):0 ((null)): -----------------------------P-8------------------------------------
D/libtestAndroid4.so( 1500): (null):0 ((null)): -----------------------------P-9------------------------------------
W/IInputConnectionWrapper( 1500): getCursorCapsMode on inactive InputConnection
D/libtestAndroid4.so( 1500): (null):0 ((null)): -----------------------------P-2------------------------------------
F/libc    ( 1500): Fatal signal 11 (SIGSEGV) at 0x007a7a76 (code=1), thread 1567 (le.testAndroid4)
I/DEBUG   (  147): pid: 1500, tid: 1567, name: le.testAndroid4  >>> org.qtproject.example.testAndroid4 <<<


"org.qtproject.example.testAndroid4" died.

LOG1编译输出:

log1 compile output:

Android package built successfully in 29.282 ms.
  -- It can now be run from the selected device/emulator.
  -- File: C:/Users/niki/Documents/build-testAndroid4-Android_for_armeabi_v7a_GCC_4_9_Qt_5_5_1-Release/android-build//bin/QtApp-debug.apk
3064 KB/s (15889430 bytes in 5.064s)
11:15:26: The process "C:/Qt/5.5/android_armv7/bin/androiddeployqt.exe" exited normally.
11:15:26: Pulling files necessary for debugging.
11:15:26: Package deploy: Running command "C:/Users/niki/AppData/Local/Android/android-sdk/platform-tools/adb.exe -s LGOTMS328ac0aa pull /system/bin/sh: readlink: not found C:/Users/niki/Documents/build-testAndroid4-Android_for_armeabi_v7a_GCC_4_9_Qt_5_5_1-Release/app_process".
11:15:26: Packaging error: Command "C:/Users/niki/AppData/Local/Android/android-sdk/platform-tools/adb.exe -s LGOTMS328ac0aa pull /system/bin/sh: readlink: not found C:/Users/niki/Documents/build-testAndroid4-Android_for_armeabi_v7a_GCC_4_9_Qt_5_5_1-Release/app_process" failed.Exit code: 1
11:15:26: Package deploy: Running command "C:/Users/niki/AppData/Local/Android/android-sdk/platform-tools/adb.exe -s LGOTMS328ac0aa pull /system/lib/libc.so C:/Users/niki/Documents/build-testAndroid4-Android_for_armeabi_v7a_GCC_4_9_Qt_5_5_1-Release/libc.so".
11:15:26: Elapsed time: 00:53.

LOG2应用程序的输出:

log2 application output:

 ...
    I/Adreno200-EGL( 3188): Build Date: 04/01/13 Mon
    I/Adreno200-EGL( 3188): Local Branch:
    I/Adreno200-EGL( 3188): Remote Branch: m/jb_rel_2.0.3
    I/Adreno200-EGL( 3188): Local Patches: NONE
    I/Adreno200-EGL( 3188): Reconstruct Branch: NOTHING
    D/libtestAndroid4.so( 3188): (null):0 ((null)): -----------------------------P-8------------------------------------
    D/libtestAndroid4.so( 3188): (null):0 ((null)): -----------------------------P-9------------------------------------
    D/libtestAndroid4.so( 3188): (null):0 ((null)): -----------------------------P-2------------------------------------
    D/libtestAndroid4.so( 3188): (null):0 ((null)): -----------------------------P-3------------------------------------
    D/libtestAndroid4.so( 3188): (null):0 ((null)): -----------------------------P-4------------------------------------
    D/libtestAndroid4.so( 3188): (null):0 ((null)): -----------------------------P-5------------------------------------
    D/libtestAndroid4.so( 3188): (null):0 ((null)): -----------------------------P-10------------------------------------
    D/libtestAndroid4.so( 3188): (null):0 ((null)): -----------------------------P-1------------------------------------
    D/libtestAndroid4.so( 3188): (null):0 ((null)): -----------------------------P-11------------------------------------
    D/libtestAndroid4.so( 3188): (null):0 ((null)): -----------------------------P-12------------------------------------
    D/libtestAndroid4.so( 3188): (null):0 ((null)): -----------------------------P-2------------------------------------
    D/libtestAndroid4.so( 3188): (null):0 ((null)): -----------------------------P-3------------------------------------
    D/libtestAndroid4.so( 3188): (null):0 ((null)): -----------------------------P-4------------------------------------
    D/libtestAndroid4.so( 3188): (null):0 ((null)): -----------------------------P-5------------------------------------
    D/libtestAndroid4.so( 3188): (null):0 ((null)): -----------------------------P-13------------------------------------
    D/libtestAndroid4.so( 3188): (null):0 ((null)): -----------------------------P-14------------------------------------
    F/libc    ( 3188): Fatal signal 11 (SIGSEGV) at 0xdeadcab1 (code=1), thread 3269 (le.testAndroid4)
    I/DEBUG   (  147): pid: 3188, tid: 3269, name: le.testAndroid4  >>> org.qtproject.example.testAndroid4 <<<
    I/ActivityManager(  457): Process org.qtproject.example.testAndroid4 (pid 3188) has died.


    "org.qtproject.example.testAndroid4" died.

现在源$ C ​​$ C:

Now the source code:

logindialog.h

#ifndef LOGINDIALOG_H
#define LOGINDIALOG_H

#include <QDialog>
#include <QDebug>
namespace Ui {
class loginDialog;
}

class loginDialog : public QDialog
{
    Q_OBJECT

public:
    explicit loginDialog(QWidget *parent = 0);
    ~loginDialog();
    bool isDecrypted();
    std::string getPassword();

private slots:
    void on_passwordButton_clicked();

private:
    Ui::loginDialog *ui;
    bool decrypted;
    std::string password;
};

#endif // LOGINDIALOG_H

mainwindow.h

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

#include <fstream> 
//#include <sha.h>
//#include <pwdbased.h>
//#include <osrng.h>
//#include <sstream>
//#include <iomanip>
//#include <cryptlib.h>
//using CryptoPP::Exception;

//#include <hex.h>
//using CryptoPP::HexEncoder;
//using CryptoPP::HexDecoder;

//#include <filters.h>
//using CryptoPP::StringSink;
#include "logindialog.h"
#include <QMessageBox>
#include <QDebug>
namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:    
    void on_pushButton_2_clicked();
    void on_pushButton_clicked();
private:
    Ui::MainWindow *ui;
    bool getEnterPassword(std::string &);
};

#endif // MAINWINDOW_H

logindialog.cpp

#include "logindialog.h"
#include "ui_logindialog.h"

loginDialog::loginDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::loginDialog)
{
    ui->setupUi(this);
}

loginDialog::~loginDialog()
{
    delete ui;
}

void loginDialog::on_passwordButton_clicked()
{
     qDebug() << "-----------------------------P-2------------------------------------";
    this->password = ui->lineEdit->text().toStdString();
      qDebug() << "-----------------------------P-3------------------------------------";
    this->decrypted = true; //TODO decrypt the file and if there is exception set as false
       qDebug() << "-----------------------------P-4------------------------------------";
    this->accept();
        qDebug() << "-----------------------------P-5------------------------------------";
}

bool loginDialog::isDecrypted()
{
    return this->decrypted;
}

std::string loginDialog::getPassword()
{
    return this->password;
}

mainwindow.cpp

#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_pushButton_clicked()
{
    byte ivec[16];
    byte salt[32];

    CryptoPP::OS_GenerateRandomBlock(false, salt, sizeof(salt));
    CryptoPP::OS_GenerateRandomBlock(false, ivec, sizeof(ivec));

    std::string v;

    CryptoPP::HexEncoder hex(new CryptoPP::StringSink(v));
    hex.Put(salt, sizeof(salt));
    hex.MessageEnd();

    QMessageBox::about(this,tr("Test1"),tr(v.c_str()));
    QMessageBox::about(this,tr("Test1"),tr("XXX"));
}

void MainWindow::on_pushButton_2_clicked()
{   
    std::string password;
    if(getEnterPassword(password)==false)
    {
        QMessageBox::about(this,tr("Failed"),tr("Password does not match!"));
    }
    else
    {
        QMessageBox::about(this,tr("Failed"),tr("Password match!"));
    }
}

bool MainWindow::getEnterPassword(std::string &password)
{
loginDialog passwordWindow;
qDebug() << "-----------------------------P-8------------------------------------";
passwordWindow.setModal(true);
qDebug() << "-----------------------------P-9------------------------------------";
passwordWindow.exec();
qDebug() << "-----------------------------P-10------------------------------------";

qDebug() << "-----------------------------P-1------------------------------------";
loginDialog passwordWindowRe;
qDebug() << "-----------------------------P-11------------------------------------";
passwordWindowRe.setModal(true);
qDebug() << "-----------------------------P-12------------------------------------";
passwordWindowRe.exec();
qDebug() << "-----------------------------P-13------------------------------------";

//qDebug() << passwordWindow.getPassword().c_str();
//qDebug() << passwordWindowRe.getPassword().c_str();

qDebug() << "-----------------------------P-14------------------------------------";
if(passwordWindow.getPassword() == passwordWindowRe.getPassword())
{
    qDebug() << "-----------------------------P-15------------------------------------";
    password = passwordWindow.getPassword();
    qDebug() << "-----------------------------P-16------------------------------------";
    return true;
    qDebug() << "-----------------------------P-17------------------------------------";
}
else
{
   qDebug() << "-----------------------------P-18------------------------------------";
   return false;
}
}

和最重要的:
testAndroid4.pro

#-------------------------------------------------
#
# Project created by QtCreator 2015-12-02T17:56:00
#
#-------------------------------------------------

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = testAndroid4
TEMPLATE = app


SOURCES += main.cpp\
        mainwindow.cpp \
    logindialog.cpp

HEADERS  += mainwindow.h \
    logindialog.h

FORMS    += mainwindow.ui \
    logindialog.ui

CONFIG += mobility
MOBILITY = 


INCLUDEPATH += C:\Temp\openssl\OpenSSL-for-Android-Prebuilt\openssl-1.0.2\include\

LIBS += -LC:\Temp\openssl\OpenSSL-for-Android-Prebuilt\openssl-1.0.2\armeabi-v7a\lib -lssl
LIBS += -LC:\Temp\openssl\OpenSSL-for-Android-Prebuilt\openssl-1.0.2\armeabi-v7a\lib -lcrypto


ANDROID_EXTRA_LIBS += C:\Users\niki\Downloads\android-ndk-r10e\sources\cxx-stl\stlport\libs\armeabi-v7a\libstlport_shared.so
ANDROID_EXTRA_LIBS += C:\Temp\cryptopp\cryptopp-5.6.2-android-14\cryptopp-android-14\lib1\libcryptopp.so

INCLUDEPATH += C:\Temp\cryptopp\cryptopp-5.6.2-android-14\cryptopp-android-14\include\cryptopp\

LIBS += -LC:\Users\niki\Downloads\android-ndk-r10e\sources\cxx-stl\stlport\libs\armeabi-v7a -lstlport_shared
LIBS += -LC:\Temp\cryptopp\cryptopp-5.6.2-android-14\cryptopp-android-14\lib1 -lcryptopp



DISTFILES += \
    ../../../../Temp/cryptopp/cryptopp-5.6.2-android-14/cryptopp-android-14/lib1/libcryptopp.so

当我启动该程序和preSS pushButton2出现一个LoginDialog。当我输入的东西把它和preSS LoginDialog里的按钮,程序dieing。如果我在.pro文件中cryptopp行评程序工作正常。如果我离开空lineEdit,推动一个LoginDialog的passwordButton,再次问我密码,我给的空白,但再死 - 看到出现的第二个记录(注意P1,P2,P3 ......在这两个日志)。我把OpenSSL的从从的链接,criptopp = https://github.com/noloader/cryptopp-5.6.2-android-14相对=nofollow>这个。我认为这个问题是cryptopp地方。我怎样才能增加QT的Andr​​oid栈和堆的大小?我不认为这是问题,并阅读一些有关堆栈跟踪debuging,但不知道该怎么做。没关系,这可能是在这种情况下的问题?

When I start the program and press pushButton2 it appears logindialog. When I enter something into it and press logindialog's button the program is dieing. If I comment in .pro file the cryptopp lines the program works properly. If I leave empty the lineEdit and push passwordButton of logindialog, it again ask me about password and I give blank, but again die - see the second log appears(notice the P1,P2,P3... in both logs). I took openssl from this link and criptopp from this. I think the problem is somewhere with cryptopp. How can I increase stack and heap size for qt android? I don't think this is the issue and have read something about "stack trace debuging" but don't know how to do it. Never mind, what could be the issue in this case?

版之后:

我已经测试过它在我的Andr​​oid 4.1.2设备LG擎天柱L1 E410。不,如果我测试它AVD与Android 23/14/18/16事 - >它失败。如果cryptopp被注释掉一切都OK。 LOG2编译输出是一样的第一个与唯一的时间差。

I have tested it on my android 4.1.2 device LG optimus L1 e410. No matter if I test it on AVD with android 23/14/18/16 -> it is failing. If cryptopp is commented all goes OK. log2 compile output is same as first one with difference in time only.

在第2版:

应用程序日志cryptopp使用的按钮:

Application log for cryptopp usage for pushButton:

I/Adreno200-EGL( 6066): Reconstruct Branch: NOTHING
W/IInputConnectionWrapper( 6066): showStatusIcon on inactive InputConnection
F/libc    ( 6066): Fatal signal 11 (SIGSEGV) at 0x54ff002e (code=1), thread 6156 (le.testAndroid4)
I/DEBUG   (  147): pid: 6066, tid: 6156, name: le.testAndroid4  >>> org.qtproject.example.testAndroid4 <<<
I/ActivityManager(  457): Process org.qtproject.example.testAndroid4 (pid 6066) has died.


"org.qtproject.example.testAndroid4" died.

请参阅按钮在mainwindow.cpp和评论在mainwindow.h thigs(他们是不是真的有注释)。

See pushButton in mainwindow.cpp and commented thigs in mainwindow.h(they are not commented really).

推荐答案

您手动加载 libstlport_shared.so ,我想这是因为它是由需要 libcryptopp.so

You are manually loading libstlport_shared.so, I suppose it's because it is needed by libcryptopp.so.

在默认情况下的Qt,使用STL库( libgnustl_shared.so 在我的情况,你可以在你的Andr​​oid的版本检查这个编译后\\库\\ armeabi,V7A文件夹)在编译和部署。如果你的密码库使用一个不同的(显然 libstlport_shared.so ),从.pro文件手动加载它像你一样( ANDROID_EXTRA_LIBS + = LIB + = )将使 libcryptopp.so 加载,但你最有可能得到一个赛格故障时,你会从你的code传递一个STL对象(的std ::字符串例如)到加密的功能。

By default Qt, uses a STL library (libgnustl_shared.so in my case, you can check this in your android-build\libs\armeabi-v7a folder after compilation) upon compilation and deployment. If your crypto library uses a different one (apparently libstlport_shared.so), loading it manually from the .pro file as you did (ANDROID_EXTRA_LIBS += , LIB +=) will make the libcryptopp.so loadable, but you'll most likely get a seg fault whenever you'll pass a STL object (std::string for instance) from your code to a crypto function.

两个环境(您code和加密的)都没有使用相同的STL实现,所以他们不能安全地发送任何STL对象彼此没有严重的潜在分割故障(如从创建人会考虑对象,其当它实际上是与另一个创建自己的实现:对象将最有可能有不同的属性....这就像强迫两种完全不同类型之间的CAST)

Two environments (your code and crypto one) are not using the same STL implementation, so they cannot safely send any STL object to each other without a serious potential segmentation fault (as one will consider objects as created from its own implementation when it was actually created with the other one: objects will most likely have different attributes....it's like forcing a cast between two completely different types).

您可以验证这一点这样的:

You can verify this like that:

void MainWindow::on_pushButton_clicked()
{
    byte ivec[16];
    byte salt[32];

    qDebug() << "Calling OS_GenerateRandomBlock";
    CryptoPP::OS_GenerateRandomBlock(false, salt, sizeof(salt));
    qDebug() << "Calling OS_GenerateRandomBlock";
    CryptoPP::OS_GenerateRandomBlock(false, ivec, sizeof(ivec));

    std::string v;

    qDebug() << "Passing std::string to CryptoPP::StringSink";    
    CryptoPP::StringSink* sink = new CryptoPP::StringSink(v);

    qDebug() << "Creating HexEncoder";    
    CryptoPP::HexEncoder hex( sink );

    hex.Put(salt, sizeof(salt));
    hex.MessageEnd();

    QMessageBox::about(this,tr("Test1"),tr(v.c_str()));
    QMessageBox::about(this,tr("Test1"),tr("XXX"));
}

请确认,但我pretty肯定你会看到路过的std ::字符串CryptoPP :: StringSink,而不是创建己烯codeR。

Please confirm, but I'm pretty sure you'll see "Passing std::string to CryptoPP::StringSink" but not "Creating HexEncoder".

您应该重新编译 libcryptopp.so 有它使用同样的STL implmentation作为你的主程序(和跨你的手指,该LIB将与STL实现工作)。

You should recompile libcryptopp.so to have it use the same STL implmentation as your main program (and cross your finger that the lib will work with that STL implementation).

这篇关于Cryptopp致命的信号11的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆