Coder Social home page Coder Social logo

Comments (4)

tt4g avatar tt4g commented on June 2, 2024

The dump shows that the log message formatting function is printed.
Could it be that the async logger is passing the log message to the logging function before the formatting is complete, and the argument passed to the logging function is an invalid pointer?

{
    std::string arg = "message";
    // Pass `arg` reference.
    async_logger->info("{}", arg);
}
// If async logger accesses `arg` after here, it will crash.

from spdlog.

tt4g avatar tt4g commented on June 2, 2024
warning: Unexpected size of section `.reg-xstate/17010' in core file.
Warning: couldn't activate thread debugging using libthread_db: Cannot find new threads: debugger service failed
Core was generated by `./dl'.
Program terminated with signal SIGSEGV, Segmentation fault.

This message indicates that threads may not be working properly on your machine.
Does std::thread work?

from spdlog.

luo2bei avatar luo2bei commented on June 2, 2024

The dump shows that the log message formatting function is printed. Could it be that the async logger is passing the log message to the logging function before the formatting is complete, and the argument passed to the logging function is an invalid pointer?

{
    std::string arg = "message";
    // Pass `arg` reference.
    async_logger->info("{}", arg);
}
// If async logger accesses `arg` after here, it will crash.

I'm guessing that's unlikely, because when I only called init_thread_pool in the whole program and no other interfaces, the program still crashed. Now I'm going to check my std::thread, and will reply later.

from spdlog.

luo2bei avatar luo2bei commented on June 2, 2024

I think you're right, my virtual machine crashed when performing std::thread->join() or detach(). Even though it still doesn't work ,thank you~

from spdlog.

Related Issues (20)

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.