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.

Crash if enable google::EnableLogCleaner(1);  #653

@jixianliu1234

Description

@jixianliu1234

I want to update glog-0.4.0 to glog-0.5.0,and wanna use Automatically Remove Old Logs functions.but my program crashed everytimes if enabled "google::EnableLogCleaner(1);",Is there a problem with my usage?
(The static library is referenced in my program)

code attach:

// init log
const char *init_log(const char *cmd, const int log_level) {
    saas_uint8_t set_log_level = 0;
    FLAGS_logbufsecs = 0;
    google::InitGoogleLogging(cmd);

    if (check_log_level(log_level)) {
        set_log_level = log_level;
    }

//    google::InstallFailureSignalHandler();
      google::EnableLogCleaner(1);   // crash if uncomment.

    google::SetLogDestination(google::INFO, ".");
//    google::SetLogDestination(set_log_level, ".");
//    FLAGS_log_dir = "./logs";
	......

dump msg:

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff6838921 in __GI_abort () at abort.c:79
#2  0x00007ffff722b957 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff7231ae6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff7231b21 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x000055555578ffda in google::LogMessage::~LogMessage() ()
#6  0x00005555557648f2 in SConfig::read_config_from_file (this=0x7ffff4457080, filePath=0x5555564a476c "./SaasAccelerator.conf") at /home/workspace/src/SConfig.cpp:88

SConfig.cpp:88 :

 LOG(INFO) <<  "************start****************";

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions