Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

call InitGoogleLogging get a segment fault #607

@cathaysia

Description

@cathaysia

Env:
windows10
msys2 - mingw64

The codes are:

include(FetchContent)
FetchContent_Declare(
    glog
    GIT_REPOSITORY git@github.com:google/glog.git
    GIT_TAG v0.4.0
    SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/download_deps/glog
)
FetchContent_MakeAvailable(glog)

add_executable(${PROJECT_NAME} main.cpp)
include_directories(glog::glog)
target_link_libraries(${PROJECT_NAME} glog::glog)
#include <glog/logging.h>

int main(int argc, char** argv) {
    auto app = Gtk::Application::create(argc, argv, "com.zlt.texteditor");
    google::InitGoogleLogging(argv[0]);  //
    TextEditor w;
    return app->run(w);
}

As you see, I'm trying gtk promaring on windows. If I comment ①, it works well, other than get a segment fault. (run it in bash.exe of msys2, not cmd.exe)

when I debug it , it paused at

// stacktrace_x86_64-inl.h
static bool ready_to_run = false;
class StackTraceInit {
 public:
   StackTraceInit() {
     // Extra call to force initialization
     _Unwind_Backtrace(nop_backtrace, NULL); // stop here
     ready_to_run = true;
   }
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions