-
Notifications
You must be signed in to change notification settings - Fork 726
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
zlog_reload can cause a crash by freeing memory used by zlog_spec_write_time. #7
Comments
Yes, you are right. I fix it and launch zlog 1.2.2.... |
The last fix is not correct, simplely kick the cache will cause sometimes not fetch time. so I fix it again.... I think this fix will work, isn't it ?
|
I improve it on 1.2.5, |
Closed
hy0kl
pushed a commit
to hy0kl/zlog
that referenced
this issue
Jun 10, 2015
…spec_write_time. see: HardySimpson#7
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The last_time_format stored per thread in a_thread->event->last_time_fmt points to memory allocated in a zlog_spec_t. When zlog_reload deletes and recreates the the spec array it frees this memory but the thread storage still holds a pointer to it. The quick fix is to disable caching the last time format in spec.c:
static int zlog_spec_write_time(zlog_spec_t * a_spec, zlog_thread_t * a_thread, zlog_buf_t * a_buf)
{
/* do fetch time every event once */
zlog_spec_fetch_time;
The text was updated successfully, but these errors were encountered: