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

关于日志模块sprintf段错误 #53

Open
JCeYing opened this issue Nov 21, 2024 · 2 comments
Open

关于日志模块sprintf段错误 #53

JCeYing opened this issue Nov 21, 2024 · 2 comments

Comments

@JCeYing
Copy link

JCeYing commented Nov 21, 2024

#0 0x00007ffff4dd0a4a in __GI__IO_str_overflow () from /lib64/libc.so.6
#1 0x00007ffff4dcf031 in __GI__IO_default_xsputn () from /lib64/libc.so.6
#2 0x00007ffff4d9a707 in vfprintf () from /lib64/libc.so.6
#3 0x00007ffff4dc34cb in vsprintf () from /lib64/libc.so.6
#4 0x00007ffff4da5617 in sprintf () from /lib64/libc.so.6
#5 0x00007ffff5d9c35c in doLogEx (bNeedLock=, bNeedSync=, text_len=, text=, caption=,
tv=, pContext=) at logger.c:1039
#6 log_it_ex2 (pContext=pContext@entry=0x7ffff5fd6ca0 <g_log_context>, caption=caption@entry=0x7ffff5dc135b "ERROR",
text=text@entry=0x7fffffffd5e0 "file: tracker_client.c, line: 920, tracker server 192.168.1.231:22122 response data length: 40 is invalid, expect length: 70",
text_len=, bNeedSync=bNeedSync@entry=false, bNeedLock=bNeedLock@entry=true) at logger.c:1086
#7 0x00007ffff5d9d71e in logError (
format=format@entry=0x7ffff5b76338 "file: tracker_client.c, line: %d, tracker server %s:%u response data length: %ld is invalid, expect length: %d") at logger.c:1312
#8 0x00007ffff5b69ecd in tracker_query_storage_store_without_group (pTrackerServer=0x777520, pStorageServer=, group_name=0x752750 <fdfsOper+16> "",
store_path_index=0x7fffffffdfcc) at tracker_client.c:918
#9 0x00000000004390fa in fdfsOperator::getStorageServer (this=0x752740 ) at fdfsOperator.cpp:61
#10 0x00000000004280b2 in main (argc=1, argv=0x7fffffffe258) at main.cpp:192
这是我程序段错误的堆栈信息
我之前用的是commont1.0.41版本
我现在用的是fastdfs最新版本和common最新版本还是会触发这个段错误
只要调用到doLogEx记录错误日志就会触发

@happyfish100
Copy link
Owner

在 main 函数中需要先调用 log_init(); 进行初始化。
可以参阅 client/fdfs_test.c

@JCeYing
Copy link
Author

JCeYing commented Nov 21, 2024

在 main 函数中需要先调用 log_init();进行初始化。 可以参阅 client/fdfs_test.c

好的 感谢

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

2 participants