diff --git a/paddle/fluid/platform/init.cc b/paddle/fluid/platform/init.cc index 04687b0b389a673d0569af69cd294d2609f8f4e4..ec7998161b5c612d1f9a9cdb6adc9e5468d76a5d 100644 --- a/paddle/fluid/platform/init.cc +++ b/paddle/fluid/platform/init.cc @@ -47,6 +47,7 @@ namespace framework { std::once_flag gflags_init_flag; std::once_flag p2p_init_flag; +std::once_flag glog_warning_once_flag; void InitGflags(std::vector argv) { std::call_once(gflags_init_flag, [&]() { @@ -202,6 +203,15 @@ void InitDevices(bool init_p2p, const std::vector devices) { void SignalHandle(const char *data, int size) { auto file_path = string::Sprintf("/tmp/paddle.%d.dump_info", ::getpid()); try { + // The signal is coming line by line but we print general guide just once + std::call_once(glog_warning_once_flag, [&]() { + LOG(WARNING) << "Initialize GLOG failed, PaddlePaddle may not be able to " + "print GLOG\n"; + LOG(WARNING) << "You could check whether you killed GLOG initialize " + "process or PaddlePaddle process accidentally\n"; + LOG(WARNING) << "The detail failure signal is:\n\n"; + }); + LOG(WARNING) << std::string(data, size); std::ofstream dump_info; dump_info.open(file_path, std::ios::app);