GithubHelp home page GithubHelp logo

naruto's People

Contributors

logikoisto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

naruto's Issues

程序输出%s出现崩溃问题

测试代码如下:
int main() {
hardcode::naruto::LogConfig log_config;
hardcode::naruto::Logger::setGlobalConfig(log_config);
hardcode::naruto::Logger::getLogger()->addAppender(
"asyncfile", hardcode::naruto::LogAppenderInterface::Ptr(new hardcode::naruto::AsyncFileAppender("./lg/")));
const int32_t count = 10;
std::string tmp("testssss");
auto start = std::chrono::system_clock::now();
for (int32_t index = 0; index < count; ++index) {
hardcode::naruto::Logger::getLogger()->fatal("%d hello world, %s\n", index, tmp.c_str()); //ERROR!!!
}
auto end = std::chrono::system_clock::now();
auto duration =
std::chrono::duration_caststd::chrono::microseconds(end - start);
std::cout << count << "次运行耗时" << duration.count() << "us" << std::endl;
return 0;
}
我这边测试在 hardcode::naruto::Logger::getLogger()->fatal("%d hello world, %s\n", index, tmp.c_str()); 地方出现崩溃问题。堆栈如下:
Thread 1 "testMain" received signal SIGSEGV, Segmentation fault.
__strlen_sse2 () at ../sysdeps/x86_64/multiarch/../strlen.S:120
120 ../sysdeps/x86_64/multiarch/../strlen.S: No such file or directory.
(gdb) bt
#0 __strlen_sse2 () at ../sysdeps/x86_64/multiarch/../strlen.S:120
#1 0x00007ffffe88d4a3 in _IO_vfprintf_internal (s=s@entry=0x7ffffffedd40, format=format@entry=0x800f587 "%d hello world, %s\n",
ap=ap@entry=0x7ffffffee020) at vfprintf.c:1643
#2 0x00007ffffe8b88b0 in _IO_vsnprintf (string=0x842c470 "0 hello world, ", maxlen=,
format=0x800f587 "%d hello world, %s\n", args=0x7ffffffee020) at vsnprintf.c:114
#3 0x00000000080092aa in hardcode::naruto::Logger::writeLog (this=0x842ae70, log_level=hardcode::naruto::LogLevel::FATAL,
file_name=0x800f8b0 "../log.cpp", function_name=0x800f900 <hardcode::naruto::Logger::fatal(char const*, ...)::FUNCTION> "fatal",
line_num=83, fmt=0x800f587 "%d hello world, %s\n", ap=0x7ffffffee020) at ../log.cpp:117
#4 0x0000000008008f46 in hardcode::naruto::Logger::fatal (this=0x842ae70, format=0x800f587 "%d hello world, %s\n") at ../log.cpp:83
#5 0x0000000008003e49 in main () at ./naruto_test.cpp:17
(gdb)
这个问题个人能力不足无法定位和解决。有大佬可以帮忙看一下嘛?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.