Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any way logging without a mutex #504

Closed
psionic12 opened this issue Dec 12, 2019 · 0 comments
Closed

Is there any way logging without a mutex #504

psionic12 opened this issue Dec 12, 2019 · 0 comments

Comments

@psionic12
Copy link

I got some special case here:
I got two threads both use glog, but one thread may be interrupted by signal, and there's a chance that I got error like this:

PC: @     0x7f0fdbfa9e97 gsignal
*** SIGABRT (@0x3e800000888) received by PID 2184 (TID 0x7f0fda3c9700) from PID 2184; stack trace: ***
    @     0x7f0fdc90f890 (unknown)
    @     0x7f0fdbfa9e97 gsignal
    @     0x7f0fdbfab801 abort
    @     0x55e900883539 glog_internal_namespace_::Mutex::Lock()
    @     0x55e900883626 glog_internal_namespace_::MutexLock::MutexLock()
    @     0x55e90087eefc google::LogMessage::Flush()
    @     0x55e90087ed6d google::LogMessage::~LogMessage()
    @     0x55e90086ed93 stop_handler()
    @     0x7f0fdc90f890 (unknown)
    @     0x7f0fdc07b187 __write
    @     0x7f0fdbff61bd _IO_file_write
    @     0x7f0fdbff6b2f _IO_file_xsputn
    @     0x7f0fdbfea977 fwrite
    @     0x55e90087c7b9 google::ColoredWriteToStderr()
    @     0x55e90087f282 google::LogMessage::SendToLog()
    @     0x55e90087ef77 google::LogMessage::Flush()
    @     0x55e90087ed6d google::LogMessage::~LogMessage()

I think this is caused by some mutex condition or some thing.

So any way I can logging without a mutex? And the consequences like ill format is acceptable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant