HardySimpson / zlog

A reliable, high-performance, thread safe, flexsible, clear-model, pure C logging library.
Apache License 2.0
2.25k stars 721 forks source link

0x000000000040c1eb in zlog_event_del (a_event=0x2d3630445233322d) #231

Open Gitxiaozhu-oss opened 1 year ago

Gitxiaozhu-oss commented 1 year ago

define zlog_fetch_thread(a_thread, fail_goto) do { \

int rd = 0;  \
a_thread = pthread_getspecific(zlog_thread_key);  \
if (!a_thread) {  \
    a_thread = zlog_thread_new(zlog_env_init_version,  \
            zlog_env_conf->buf_size_min, zlog_env_conf->buf_size_max, \
            zlog_env_conf->time_cache_count); \
    if (!a_thread) {  \
        zc_error("zlog_thread_new fail");  \
        goto fail_goto;  \
    }  \

\ rd = pthread_setspecific(zlog_thread_key, a_thread); \ if (rd) { \ zlog_thread_del(a_thread); \ zc_error("pthread_setspecific fail, rd[%d]", rd); \ goto fail_goto; \ } \ } \ \ if (a_thread->init_version != zlog_env_init_version) { \ / as mdc is still here, so can not easily del and new / \ rd = zlog_thread_rebuild_msg_buf(a_thread, \ zlog_env_conf->buf_size_min, \ zlog_env_conf->buf_size_max); \ if (rd) { \ zc_error("zlog_thread_resize_msg_buf fail, rd[%d]", rd); \ goto fail_goto; \ } \ \ rd = zlog_thread_rebuild_event(a_thread, zlog_env_conf->time_cache_count); \ if (rd) { \ zc_error("zlog_thread_resize_msg_buf fail, rd[%d]", rd); \ goto fail_goto; \ } \ a_thread->init_version = zlog_env_init_version; \ } \ } while (0)

当进程环境发送变化是调用int zlog_thread_rebuild_event(zlog_thread_t * a_thread, int time_cache_count)函数,当执行zlog_event_del(a_thread->event);程序会发生奔溃,

jhwsx commented 10 months ago

1705544675326 我这边也遇到了这个问题了。

zhouyunbin commented 10 months ago

您好,已收到您的来信