log4c-devel Mailing List for Logging Framework for C (Page 2)
Brought to you by:
valtri
You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(5) |
Jun
(2) |
Jul
(14) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(11) |
Jun
(7) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(10) |
Dec
(71) |
| 2006 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(1) |
May
(37) |
Jun
(12) |
Jul
(4) |
Aug
(2) |
Sep
(24) |
Oct
(18) |
Nov
(58) |
Dec
(27) |
| 2007 |
Jan
(8) |
Feb
(15) |
Mar
(7) |
Apr
(65) |
May
(71) |
Jun
(117) |
Jul
(161) |
Aug
(73) |
Sep
(55) |
Oct
(16) |
Nov
(29) |
Dec
(8) |
| 2008 |
Jan
(8) |
Feb
(1) |
Mar
(1) |
Apr
(34) |
May
(44) |
Jun
(15) |
Jul
(64) |
Aug
(81) |
Sep
(80) |
Oct
(25) |
Nov
(24) |
Dec
(85) |
| 2009 |
Jan
(54) |
Feb
(20) |
Mar
(40) |
Apr
(50) |
May
(125) |
Jun
(118) |
Jul
(69) |
Aug
(17) |
Sep
(30) |
Oct
(29) |
Nov
(4) |
Dec
(16) |
| 2010 |
Jan
(2) |
Feb
(4) |
Mar
(37) |
Apr
(54) |
May
(72) |
Jun
(67) |
Jul
(35) |
Aug
(51) |
Sep
(21) |
Oct
(1) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
(2) |
Dec
(1) |
| 2012 |
Jan
(1) |
Feb
(2) |
Mar
(8) |
Apr
(2) |
May
(2) |
Jun
(1) |
Jul
(6) |
Aug
(4) |
Sep
(3) |
Oct
(3) |
Nov
(4) |
Dec
(1) |
| 2013 |
Jan
|
Feb
(1) |
Mar
(6) |
Apr
(6) |
May
(3) |
Jun
(3) |
Jul
|
Aug
(3) |
Sep
(2) |
Oct
(5) |
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(2) |
Sep
(1) |
Oct
(1) |
Nov
(1) |
Dec
|
| 2015 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
(5) |
Oct
|
Nov
|
Dec
(2) |
| 2016 |
Jan
(4) |
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2018 |
Jan
|
Feb
|
Mar
(19) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2021 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
|
From: <gon...@hy...> - 2018-03-12 11:58:53
|
你好:我公司专业代开各类行业税票,点数优惠 如有需要欢迎来电咨询:电话:13544277619 (微信同号) 可加,QQ:2930279293 联系人:陈先生。 |
|
From: <js3...@ht...> - 2018-03-05 19:21:43
|
您好:我公司有各地行业增值税《普通/专用》税・票; 贵公司如有需要欢迎来电与我联系:钱经理 13713543334 QQ:1482602661 (在此祝您:新年快乐、身体健康、事业顺心) |
|
From: Subranshu P. <spa...@gm...> - 2017-12-13 13:52:35
|
I have observed a scenario where application goes to a deadlock state. Suspect the reason to be log4c. Let me explain the scenario: 1. Process P1 starts - performs log4c_init(),log4c_category_get() and log4c_category_log_locinfo() for logging. 2. P1 creates threads - T1, T2 and T3. 3. Now process P1 forks() to create P2 and at the same time T1 is logging using log4c_category_log_locinfo() 4. P2 invokes log4c_init(), log4c_category_get() and then invokes log4c_category_log_locinfo(). This results in deadlock. P2 never returns from log4c_category_log_locinfo(). My Investigation: When T1 invokes VE_LOG and P1 invokes fork() at the same time, the following happens 1. T1 invokes VE_LOG() and acquires mutex lock (from within log4c). 2. P1 forks at the same time and P2 is created. 3. P2 performs log4c_init() and log4c_category_log_locinfo(). Here pthread_mutex_init() is not invoked. P2 gets the old value of the mutex. When P2 invokes log4c_category_log_locinfo(), it waits in pthread_mutex_lock() 4. There is no one to wake up P2 and deadlock occurs. The issue occurs because after fork(), the lock value is not initialized and we use pthread_mutex_lock(). I am using a rolling policy here. Let me know if log4c is safe in this kind of scenario. |
|
From: <rue...@ru...> - 2017-03-01 12:41:07
|
Dear Customer, Your item has arrived at February 27, but our courier was not able to deliver the parcel. Please check the attachment for details! Yours faithfully, Harold Ward, UPS Delivery Clerk. |
|
From: Arno <st...@gm...> - 2016-10-21 07:11:37
|
I found the lib in a hidden directory: ./log4c-1.2.4/src/log4c/.libs/liblog4c.a So is is possible to compile a simple programm just including this lib and the log4c headers and having a log4crc file in the folder that controls it? That would be how I think it can be used by beginners. |
|
From: Arno <st...@gm...> - 2016-10-20 12:30:55
|
Can this be compiled as library that is just included? And if so, how can this be done? The examples and its compiliation look to me very difficult. I just understand simple makefiles. Thanks you |
|
From: Andre K. <And...@we...> - 2016-05-27 09:20:55
|
Hello Log4c developer, After my last mail I also have another question. I want to deliver custom information to my own layout function. So that the layout function knows, from which function it was called in order to indent different levels for logging purposes. To do that I use the priority to deliver this information. I set the priority let's say to 401 instead of 400 because between every priority there is a distance of 100. The log4c_priority_to_string function can handle this because there is an integer division by 100. But the log4c_category_is_priority_enabled function (category.h L: 170) just checks greater or equal. If you also would divide here both sides by 100 then this function would also handle my problem. Then I would be possible to deliver codes from 0 to 99 in the priorities. If there is another way to deliver my data/information from outside to the inside of the layout function I would be glad if you let me know about that. I know that there are void pointer for user data. But as I understand, these data don't have to manipulated from the outside because I can't know which layout function will use these data. So it would be invalid then... Another point is, that it would be nice if the layouts would also provide 3 functions like the appender. So that you can allocate memory at beginning and free this memory if you're finished. But this is a different kettle of fish. Thanks in advance! Best regards Andre Kampling Werum Software & Systems AG Wulf-Werum-Straße 3 21337 Lüneburg USt-ID-Nr: DE 293 571 381 Sitz der Gesellschaft: Lüneburg RG: Lüneburg HRB 204846 Vorsitzender des Aufsichtsrats: Dr. Hans Windauer Vorstand: Christian Sommer (Vorsitzender), Thomas Menge, Carsten Stein |
|
From: Andre K. <And...@we...> - 2016-05-25 09:26:30
|
Hello Log4c developer,
I want to submit a fix for the situation described underneath.
This only applies if I understand it the right way.
I want to use log4c for the following purpose.
I've created three categories with the following properties:
Category --> This goes to stderr with a fatal priority.
|
Category.CatError --> File with prefix Error with an error priority.
|
Category.CatError.CatDebug --> File with prefix Debug with an debug priority.
I'm getting the handle of "Category.CatError.CatDebug". What I expected, is that
I get a file Debug.0 with debug information and higher,
also I think I should get a file Error.0 with error information and higher.
Last but not least I expected fatal information on stderr.
But the actual behavior is like that for all three categories the debug level is
active, so that debug information and higher are printed on all three categories.
If my understanding is right and this shouldn't be the purpose then the following code fixes that.
In category.c line 266 is:
log4c_appender_append(cat->cat_appender, &evt);
but should be:
if (log4c_category_is_priority_enabled(cat, a_priority))
log4c_appender_append(cat->cat_appender, &evt);
This is actual not enough, if you order the priorities vise-versa like I do above, then it's also necessary
to remove the if statement in category.h at line 375:
if (log4c_category_is_priority_enabled(a_category, a_priority)) {
This if statement appears a lot of times, so it's necessary to remove all these occurrences.
Best regards
Andre Kampling
Werum Software & Systems AG
Wulf-Werum-Straße 3
21337 Lüneburg
Mail: and...@we...<mailto:and...@we...>
Web: http://www.werum.de<http://www.werum.de/>
USt-ID-Nr: DE 293 571 381
Sitz der Gesellschaft: Lüneburg
RG: Lüneburg HRB 204846
Vorsitzender des Aufsichtsrats: Dr. Hans Windauer
Vorstand: Christian Sommer (Vorsitzender), Thomas Menge, Carsten Stein
|
|
From: František D. <va...@ci...> - 2016-01-30 22:25:09
|
Hello,
fixed, thanks!
Frantisek
Michael McConville píše v So 30. 01. 2016 v 15:33 -0500:
> mmap returns MAP_FAILED, not NULL, when it fails. The below patch
> should
> work.
>
> Thanks for your time,
> Michael
>
>
> diff --git a/src/log4c/appender_type_mmap.c
> b/src/log4c/appender_type_mmap.c
> index 6e907f3..6890ce0 100644
> --- a/src/log4c/appender_type_mmap.c
> +++ b/src/log4c/appender_type_mmap.c
> @@ -89,7 +89,7 @@ static int mmap_open(log4c_appender_t* this)
>
> minfo->addr = mmap(NULL, minfo->length, PROT_READ|PROT_WRITE,
> MAP_SHARED, minfo->fd, 0);
> - if (minfo->addr == NULL) {
> + if (minfo->addr == MAP_FAILED) {
> perror("mmap");
> mmap_info_delete(minfo);
> return -1;
>
> -------------------------------------------------------------------
> -----------
> Site24x7 APM Insight: Get Deep Visibility into Application
> Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
> _______________________________________________
> Log4c-devel mailing list
> Log...@li...
> https://lists.sourceforge.net/lists/listinfo/log4c-devel
|
|
From: František D. <va...@ci...> - 2016-01-30 22:25:09
|
Hello, fixed the syntax error, thanks! How I understand, it still doesn't compile though, because of the va_copy() macro? Frantisek Klaus-Günter Höft píše v Čt 21. 01. 2016 v 15:54 +0100: > Hi, > > I wanted to compile the sources of log4c-1.2.4 with "Microsoft > Visual > Studio 10.0" and got an error in line 42 of > "layout_type_dated_local_r.c": > . > . > . > (42) SYSTEMTIME stime, stime; > . > . > . > > I corrected the statement: > . > . > . > (42) SYSTEMTIME ltime, stime; > . > . > and I could compile the sources. > It also seems that "Microsoft Visual Studio 10.0" does not know the > "va_copy" macro. I created a "config.h" file in the build directory > (see > README) which contains the necessary directives and statements. > > Best regards > Klaus-Günter Höft > |
|
From: Michael M. <mm...@my...> - 2016-01-30 20:33:18
|
mmap returns MAP_FAILED, not NULL, when it fails. The below patch should
work.
Thanks for your time,
Michael
diff --git a/src/log4c/appender_type_mmap.c b/src/log4c/appender_type_mmap.c
index 6e907f3..6890ce0 100644
--- a/src/log4c/appender_type_mmap.c
+++ b/src/log4c/appender_type_mmap.c
@@ -89,7 +89,7 @@ static int mmap_open(log4c_appender_t* this)
minfo->addr = mmap(NULL, minfo->length, PROT_READ|PROT_WRITE,
MAP_SHARED, minfo->fd, 0);
- if (minfo->addr == NULL) {
+ if (minfo->addr == MAP_FAILED) {
perror("mmap");
mmap_info_delete(minfo);
return -1;
|
|
From: Klaus-Günter H. <kla...@we...> - 2016-01-21 15:13:32
|
Hi,
I wanted to compile the sources of log4c-1.2.4 with "Microsoft Visual
Studio 10.0" and got an error in line 42 of "layout_type_dated_local_r.c":
.
.
.
(42) SYSTEMTIME stime, stime;
.
.
.
I corrected the statement:
.
.
.
(42) SYSTEMTIME ltime, stime;
.
.
and I could compile the sources.
It also seems that "Microsoft Visual Studio 10.0" does not know the
"va_copy" macro. I created a "config.h" file in the build directory (see
README) which contains the necessary directives and statements.
Best regards
Klaus-Günter Höft
--
Klaus-Günter Höft
System Architect
Werum Software & Systems AG
Wulf-Werum-Straße 3
21337 Lüneburg
Tel: +49 4131 8307-570
Fax: +49 4131 8307-200
Mail:kla...@we...
Web:http://www.werum.de
USt-ID-Nr. DE 293 571 381
Sitz der Gesellschaft: Lüneburg
RG Lüneburg HRB 204846
Vorsitzender des Aufsichtsrats: Dr. Hans Windauer
Vorstand: Christian Sommer (Vorsitzender), Thomas Menge, Carsten Stein
|
|
From: František D. <va...@ci...> - 2015-12-09 17:15:51
|
Hi,
this has been fixed in log4c 1.2.2 already (the current version is
1.2.4).
I think there should be no such error anymore - this type of errors can
be detected by the compiler ("-Wformat -Wformat-security" in CFLAGS),
and most Linux distributions use these compilation flags.
Cheers,
Frantisek
On Wed, 2015-12-09 at 16:01 +0100, Klaus-Günter Höft wrote:
> Hi,
>
> I wanted to log the format chosen to use by 'fprintf()'.
> The format alternatives are "-N '%s'" or "-T '%s'".
>
> The program crashes with a core dump.
> After some debugging I found the cause:
> In the file "appender_type_rollingfile.c" the following statement
> is used the put the rendered message into the log file:
>
> rc = fprintf(rfup->rfu_current_fp,
> a_event->evt_rendered_msg);
>
> This does not work because the rendered message contains the chosen
> format (e.g.: "-N '%s'")
> and the function 'fprintf()' looks for an argument matching the
> conversion specification "%s".
>
> The following statement would work:
>
> rc = fprintf(rfup->rfu_current_fp, "%s",
> a_event->evt_rendered_msg);
> or:
> rc = fputs(a_event->evt_rendered_msg, rfup->rfu_current_fp);
>
>
> This situation may also apply to other appenders.
>
> Best regards
> Klaus-Günter Höft
> --
> Klaus-Günter Höft
> System Architect
>
> Werum Software & Systems AG
> Wulf-Werum-Straße 3
> 21337 Lüneburg
>
> Tel: +49 4131 8307-570
> Fax: +49 4131 8307-200
> Mail: kla...@we...
> Web: http://www.werum.de
>
> USt-ID-Nr. DE 293 571 381
> Sitz der Gesellschaft: Lüneburg
> RG Lüneburg HRB 204846
> Vorsitzender des Aufsichtsrats: Dr. Hans Windauer
> Vorstand: Christian Sommer (Vorsitzender), Thomas Menge, Carsten Stein
> ------------------------------------------------------------------------------
> _______________________________________________
> Log4c-devel mailing list
> Log...@li...
> https://lists.sourceforge.net/lists/listinfo/log4c-devel
|
|
From: Klaus-Günter H. <kla...@we...> - 2015-12-09 15:19:56
|
Hi,
I wanted to log the format chosen to use by 'fprintf()'.
The format alternatives are "-N '%s'" or "-T '%s'".
The program crashes with a core dump.
After some debugging I found the cause:
In the file "appender_type_rollingfile.c" the following statement
is used the put the rendered message into the log file:
rc = fprintf(rfup->rfu_current_fp, a_event->evt_rendered_msg);
This does not work because the rendered message contains the chosen
format (e.g.: "-N '%s'")
and the function 'fprintf()' looks for an argument matching the
conversion specification "%s".
The following statement would work:
rc = fprintf(rfup->rfu_current_fp, "%s", a_event->evt_rendered_msg);
or:
rc = fputs(a_event->evt_rendered_msg, rfup->rfu_current_fp);
This situation may also apply to other appenders.
Best regards
Klaus-Günter Höft
--
Klaus-Günter Höft
System Architect
Werum Software & Systems AG
Wulf-Werum-Straße 3
21337 Lüneburg
Tel: +49 4131 8307-570
Fax: +49 4131 8307-200
Mail: kla...@we...
Web: http://www.werum.de
USt-ID-Nr. DE 293 571 381
Sitz der Gesellschaft: Lüneburg
RG Lüneburg HRB 204846
Vorsitzender des Aufsichtsrats: Dr. Hans Windauer
Vorstand: Christian Sommer (Vorsitzender), Thomas Menge, Carsten Stein
|
|
From: log4c-develujxcagwvy <wi...@ne...> - 2015-09-19 14:08:00
|
log4c-devel,
索取详细大纲请您及时联系我们!
名称『采购流程优化及供应商评估与管理』备 注
9月22-23上海 10月10-11日深圳 10月31-11月1日广州
内容第一讲:供应商采购管理的挑战有哪些?
第二讲:如何优化采购运作流程?
第三讲:如何做好供应商的分类管理?
第四讲:如何做好供应市场的调查?
第五讲:如何选对我们的采购对象?
第六讲:如何评估新供应商?
第七讲:如何防范合同的纠纷?
第八讲:如何做好供应商的日常管理?
第九讲:如何评估现行供应商?课程大纲
欢迎致电索取详细课程大纲!
刘先生
座机:010-5166·8125
手机:133·1526·0118
Q·Q:1090728160
联系方式
1867c4k94n |
|
From: 贝琦语 <ho...@qz...> - 2015-09-02 16:37:30
|
贝琦语,〖#生#产#计#划#及#物#料#控#制#〗#469183 ##【#时#间#】# #2#0#1#5#年#9#月#1#7#-#1#8#上#海# #9#月#1#9#-#2#0#深#圳# # # # ##【#对#象#】# #高#层#管#理#者#、#采#购#、#品#管#、#物#流#、#财#务#等#部#门#及#其#他#相#关#部#门#的#职#业#经#理# ##【#费#用#】# #3#8#0#0#元#/#2#天#/#1#人# ##【#邮#箱#】# #1#3#2#1#2#5#9#1#2#4#@#q#q#.#c#o#m# # ##【#手#机#】# #1#3#6#·#9#1#4#·#7#2#8#·#1#6# ##课#程#大#纲#:# #第#一#室#:#銷#售#計#划#/#生#産#計#划#/#物#料#計#划#协#调#接#口#管#理## # #第#二#室#銷#售#計#划#/#生#产#计#划#控#制#流#程# # #第#三#室#一#级#主#生#产#计#划#/#二#级#生#产#计#划#进#度#控#制# # # # # # # #第#四#室# #物#流#计#划#跟#进#与#存#量#管#制# # # #尾#声#:#当#头#棒#喝#—#捅#破#窗#纸#06510849 # |
|
From: LeeEsther <li...@ho...> - 2015-09-02 02:07:40
|
Hi, Many thanks for your reply. My codes used a lot of macro so it becomes very complicated. And this log have many outputs. I used gcc -E to compile it. and below is output:
static char fmt__[1024];
log4c_category_log( __cat_alert, priority__, fmt__, ("TUNNEL"), (tunnel)->info.signature, (tunnel)->info.timestamp, (tunnel)->info.sequence, kTunnelProtocolNames[(tunnel)->info.protocol], // a string ( (unsigned char *) &( (tunnel)->info.src.ip) )[3], ( (unsigned char *) &( (tunnel)->info.src.ip) )[2], ( (unsigned char *) &( (tunnel)->info.src.ip) )[1], ( (unsigned char *) &( (tunnel)->info.src.ip) )[0], (tunnel)->info.src.port, // an ip ( (unsigned char *) &( (tunnel)->info.dst.ip) )[3], ( (unsigned char *) &( (tunnel)->info.dst.ip) )[2], ( (unsigned char *) &( (tunnel)->info.dst.ip) )[1], ( (unsigned char *) &( (tunnel)->info.dst.ip) )[0], (tunnel)->info.dst.port, // an ip ( (unsigned char *) &( (tunnel)->info.original_dst.ip) )[3], ( (unsigned char *) &( (tunnel)->info.original_dst.ip) )[2], ( (unsigned char *) &( (tunnel)->info.original_dst.ip) )[1], ( (unsigned char *) &( (tunnel)->info.original_dst.ip) )[0], (tunnel)->info.original_dst.port, // an ip tunnel->bytes_up, tunnel->bytes_down, // 2 long int get_local_time_short( &tunnel->time_connect ), get_local_time_short( &tunnel->time_disconnect ), // this func return a string timeval_duration_s( &tunnel->time_connect, &tunnel->time_disconnect ), // a double kNodeTypeNames[tunnel->target_type], // a string ( (unsigned char *) &(tunnel->target_ip) )[3], ( (unsigned char *) &(tunnel->target_ip) )[2], ( (unsigned char *) &(tunnel->target_ip) )[1], ( (unsigned char *) &(tunnel->target_ip) )[0], tunnel->target_port, // an ip tunnel->sync_rtt, first_down_rtt, last_down_rtt, // 3 int payload_protocol, payload_keyword, // 2 string kEndpointTypeNames[tunnel->error_role], // a string ( (tunnel->error_events & 0x10) ? "EOF:" : ""), ( (tunnel->error_events & 0x20) ? "ERROR:" : ""), (strerror( tunnel->error_code ) ), // 3 string tunnel->error_code ); // 1 int
and the format string(fmt__) is: "20150901 12:16:46.498083 src/tunnel.c:128 ] INFO: %s %08x%04x%08x %s %d.%d.%d.%d:%d %d.%d.%d.%d:%d %d.%d.%d.%d:%d %ld %ld %s %s %.2f %s %d.%d.%d.%d:%u %d %d %d %s %s %s %s%s%s %d\n"
It's output would like this:
20150902 09:56:23.433117 src/tunnel.c:128 ] INFO: TUNNEL 78ed303c5e6500002321 TCP 120.237.48.60:2001 14.17.52.180:80 14.17.52.180:80 996 1436 09:56:23.368374 09:56:23.433114 0.06 NEXTPROXY 120.24.240.90:8101 0 64 64 UDP 14.17.52.180:80 proxy EOF:Success 0
As you can see, I check every argument, and all of them is correct, but it goes dump...
And I also used '-Wall -Wformat-security' to compile my program, and it seems goint right.
The version of log4c is download in http://prdownloads.sourceforge.net/log4c/log4c-1.2.4.tar.gz
li...@ho...
From: František DvořákDate: 2015-09-01 20:18To: LiTengchaoCC: log...@li...: Re: [Log4c-devel] A coredump in log4c_category_vlog.Hello,
this could be a problem of using string message in the place, where
format string is expected in the API. For example:
Proper usage:
log4c_category_log(log4c_category_get(catName), a_priority, "%s", msg);
Problematic usage leading to crashes:
log4c_category_log(log4c_category_get(catName), a_priority, msg);
Because "msg" could contain "%" characters.
1) What looks the code at src/tunnel.c:128? (The log4c_category_log()
call?)
2) Could you try to compile your project using '-Wall -Wformat-security'
build flags and check the warnings? You will need the latest log4c
version 1.2.4 to have the format parameters check working.
Cheers,
František
On út, 2015-09-01 at 10:35 +0000, LiTengchao wrote:
> Hello,
> I am new here, but I had met a coredump and I could not find any
> error in my program. (and this situation is not occur usually). I
> search google find a similar problem(which say that string was lager
> than 1024 ) but was fixed in 1.4.2, I use 1.4.4.
> Could any one give me any support?
>
>
> below is the core file:
>
>
> Program terminated with signal 11, Segmentation fault.
> #0 0x00000030f0078c80 in strlen () from /lib64/libc.so.6
> (gdb) bt
> #0 0x00000030f0078c80 in strlen () from /lib64/libc.so.6
> #1 0x00000030f0046cf7 in vfprintf () from /lib64/libc.so.6
> #2 0x00000030f006898a in vsnprintf () from /lib64/libc.so.6
> #3 0x000000000055ce1b in sd_vsprintf ()
> #4 0x0000000000558682 in __log4c_category_vlog ()
> #5 0x00000000004c2fc4 in log4c_category_vlog (a_category=0x11eda90, a_priority=600,
> a_format=0x8e5320 "20150901 12:16:46.498083 src/tunnel.c:128 ] INFO: %s %08x%04x%08x %s %d.%d.%d.%d:%d %d.%d.%d.%d:%d %d.%d.%d.%d:%d %ld %ld %s %s %.2f %s %d.%d.%d.%d:%u %d %d %d %s %s %s %s%s%s %d\n", a_args=0x7fff22a47f40)
> at /usr/local/include/log4c/category.h:358
> #6 0x00000000004c2f6a in log4c_category_log (a_category=0x11eda90, a_priority=600,
> a_format=0x8e5320 "20150901 12:16:46.498083 src/tunnel.c:128 ] INFO: %s %08x%04x%08x %s %d.%d.%d.%d:%d %d.%d.%d.%d:%d %d.%d.%d.%d:%d %ld %ld %s %s %.2f %s %d.%d.%d.%d:%u %d %d %d %s %s %s %s%s%s %d\n") at /usr/local/include/log4c/category.h:378
> ...
> other was omitted...
>
>
> Many Thanks.
>
>
> ______________________________________________________________________
> li...@ho...
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Log4c-devel mailing list
> Log...@li...
> https://lists.sourceforge.net/lists/listinfo/log4c-devel
|
|
From: František D. <va...@ci...> - 2015-09-01 12:36:10
|
Hello, this could be a problem of using string message in the place, where format string is expected in the API. For example: Proper usage: log4c_category_log(log4c_category_get(catName), a_priority, "%s", msg); Problematic usage leading to crashes: log4c_category_log(log4c_category_get(catName), a_priority, msg); Because "msg" could contain "%" characters. 1) What looks the code at src/tunnel.c:128? (The log4c_category_log() call?) 2) Could you try to compile your project using '-Wall -Wformat-security' build flags and check the warnings? You will need the latest log4c version 1.2.4 to have the format parameters check working. Cheers, František On út, 2015-09-01 at 10:35 +0000, LiTengchao wrote: > Hello, > I am new here, but I had met a coredump and I could not find any > error in my program. (and this situation is not occur usually). I > search google find a similar problem(which say that string was lager > than 1024 ) but was fixed in 1.4.2, I use 1.4.4. > Could any one give me any support? > > > below is the core file: > > > Program terminated with signal 11, Segmentation fault. > #0 0x00000030f0078c80 in strlen () from /lib64/libc.so.6 > (gdb) bt > #0 0x00000030f0078c80 in strlen () from /lib64/libc.so.6 > #1 0x00000030f0046cf7 in vfprintf () from /lib64/libc.so.6 > #2 0x00000030f006898a in vsnprintf () from /lib64/libc.so.6 > #3 0x000000000055ce1b in sd_vsprintf () > #4 0x0000000000558682 in __log4c_category_vlog () > #5 0x00000000004c2fc4 in log4c_category_vlog (a_category=0x11eda90, a_priority=600, > a_format=0x8e5320 "20150901 12:16:46.498083 src/tunnel.c:128 ] INFO: %s %08x%04x%08x %s %d.%d.%d.%d:%d %d.%d.%d.%d:%d %d.%d.%d.%d:%d %ld %ld %s %s %.2f %s %d.%d.%d.%d:%u %d %d %d %s %s %s %s%s%s %d\n", a_args=0x7fff22a47f40) > at /usr/local/include/log4c/category.h:358 > #6 0x00000000004c2f6a in log4c_category_log (a_category=0x11eda90, a_priority=600, > a_format=0x8e5320 "20150901 12:16:46.498083 src/tunnel.c:128 ] INFO: %s %08x%04x%08x %s %d.%d.%d.%d:%d %d.%d.%d.%d:%d %d.%d.%d.%d:%d %ld %ld %s %s %.2f %s %d.%d.%d.%d:%u %d %d %d %s %s %s %s%s%s %d\n") at /usr/local/include/log4c/category.h:378 > ... > other was omitted... > > > Many Thanks. > > > ______________________________________________________________________ > li...@ho... > > > ------------------------------------------------------------------------------ > _______________________________________________ > Log4c-devel mailing list > Log...@li... > https://lists.sourceforge.net/lists/listinfo/log4c-devel |
|
From: LiTengchao <li...@ho...> - 2015-09-01 10:35:18
|
Hello, I am new here, but I had met a coredump and I could not find any error in my program. (and this situation is not occur usually). I search google find a similar problem(which say that string was lager than 1024 ) but was fixed in 1.4.2, I use 1.4.4.Could any one give me any support?
below is the core file:
Program terminated with signal 11, Segmentation fault.
#0 0x00000030f0078c80 in strlen () from /lib64/libc.so.6
(gdb) bt
#0 0x00000030f0078c80 in strlen () from /lib64/libc.so.6
#1 0x00000030f0046cf7 in vfprintf () from /lib64/libc.so.6
#2 0x00000030f006898a in vsnprintf () from /lib64/libc.so.6
#3 0x000000000055ce1b in sd_vsprintf ()
#4 0x0000000000558682 in __log4c_category_vlog ()
#5 0x00000000004c2fc4 in log4c_category_vlog (a_category=0x11eda90, a_priority=600,
a_format=0x8e5320 "20150901 12:16:46.498083 src/tunnel.c:128 ] INFO: %s %08x%04x%08x %s %d.%d.%d.%d:%d %d.%d.%d.%d:%d %d.%d.%d.%d:%d %ld %ld %s %s %.2f %s %d.%d.%d.%d:%u %d %d %d %s %s %s %s%s%s %d\n", a_args=0x7fff22a47f40)
at /usr/local/include/log4c/category.h:358
#6 0x00000000004c2f6a in log4c_category_log (a_category=0x11eda90, a_priority=600,
a_format=0x8e5320 "20150901 12:16:46.498083 src/tunnel.c:128 ] INFO: %s %08x%04x%08x %s %d.%d.%d.%d:%d %d.%d.%d.%d:%d %d.%d.%d.%d:%d %ld %ld %s %s %.2f %s %d.%d.%d.%d:%u %d %d %d %s %s %s %s%s%s %d\n") at /usr/local/include/log4c/category.h:378...other was omitted...
Many Thanks.
li...@ho...
|
|
From: Nan W. <wa...@cn...> - 2015-05-28 06:52:52
|
hi all,
I used log4c for logging module of my application, a memory leak
was detected by valgrind when I reloaded log4c, the detail information
is showed as followed:
240 bytes in 5 blocks are definitely lost in loss record 76 of 105
==4635== at 0x53D5BEB: calloc (jemalloc.c:1175)
==4635== by 0x51C6788: sd_calloc (malloc.c:109)
==4635== by 0x51C5905: sizewin_init (rollingpolicy_type_sizewin.c:339)
==4635== by 0x51C4F05: log4c_rollingpolicy_init (rollingpolicy.c:156)
==4635== by 0x51C2C53: log4c_rc_load (rc.c:214)
==4635== by 0x51C32F1: log4c_init (init.c:140)
==4635== by 0x41C367: zebra_log_init (zebra_log.c:40)
==4635== by 0x40F58F: zebra_run (zebra_main.c:170)
==4635== by 0x40FCF2: main (zebra_main.c:407)
==4635== by 0x360121D993: __libc_start_main (in /lib64/libc-2.5.so)
Where zebra is my application~
Dose anyone encount the same problem? Thanks a lot in advance.
--
王楠 技术研发中心
---------------------------------
==专业·责任·服务==
中国互联网络信息中心 CNNIC
网 址: www.cnnic.cn
中国互联网络信息中心.中国
地 址: 北京市海淀区中关村南4街4号
北京349信箱6分箱(100080)
---------------------------------
Nan WANG
Research&Development Center
= =Profession • Responsibility • Service= =
China Internet Network Information Center (CNNIC)
Website: www.cnnic.cn
中国互联网络信息中心.中国
Add: 4th Zhongguancun Nansijie, Haidian District, Beijing 100190, China
POB: Beijing 349, Branch 6
|
|
From: Karl-Philipp R. <ri...@ri...> - 2015-01-29 01:05:22
|
Perfect! Thank you so much. It'd be great to put the C code and some of
your explanations on the website because for people who are just getting
started with C, like me, it's really difficult to get the API from the
source. In case you do:
* #include <log4c.h>
* `log4c_catagory_get` -> `log4c_category_get`
* `log4c_category_log(mycat, LOG4C_PRIORITY_INFO,"message is %s",line)`
-> `log4c_category_log(mycat, LOG4C_PRIORITY_INFO,"message is
%s",line);`
Best regards,
Kalle
Am 29.01.2015 um 01:15 schrieb Skip Carter:
> Hello Karl,
>
> This list is so quiet I forgot that I was even subscribed!
>
>
> On Wed, 2015-01-28 at 21:55 +0000, Karl-Philipp Richter wrote:
>> Hi,
>> After I tried hard to get stared with log4c by reading around
>> http://log4c.sourceforge.net I still have no idea how to do so. Is there
>> any way you could provide me with a simple logging statement and change
>> of the log level.
>>
>
> Perhaps this is a way to explain it, in comparison to using syslog() in
> your applications.
>
>
> To initialize logging:
>
> Syslog: openlog(programname, LOG_PID, LOG_LOCAL0);
>
>
> Log4c: log4c_category_t* mycat;
> log4c_init();
> mycat = log4c_catagory_get("com.example.test");
>
>
> The third line here causes the program to search for a catagory called
> com.example.test in the log4crc file. The location of the rc file does
> not seem to be very well documented. It could be /etc/logh4crc or
> ~/.log4crc and a couple of other places.
>
> Here is an example:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <!DOCTYPE log4c SYSTEM "">
>
> <log4c>
>
> <config>
> <bufsize>0</bufsize>
> <debug level="0"/>
> <nocleanup>0</nocleanup>
> <reread>1</reread>
> </config>
>
> <!-- maxsize is bytes -->
> <rollingpolicy name="sizerollingpolicy" type="sizewin"
> maxsize="104857600" maxnum="36" />
>
> <category name="com.example.test" priority="info"
> appender="myrollingfileappender" />
>
> <appender name="myrollingfileappender" type="rollingfile"
> logdir="/var/log/" prefix="test.log" layout="dated"
> rollingpolicy="sizerollingpolicy" />
>
> <!-- root category ========================================= -->
> <category name="root" priority="notice"/>
>
> <!-- default appenders ===================================== -->
> <appender name="stdout" type="stream" layout="basic"/>
> <appender name="stderr" type="stream" layout="dated"/>
> <appender name="syslog" type="syslog" layout="basic"/>
>
> <!-- default layouts ======================================= -->
> <layout name="basic" type="basic"/>
> <layout name="dated" type="dated"/>
> </log4c>
>
> This is where the log management policy is specified. The original java
> log4j has extensive capabilities that can be defined here. It seems
> that log4c is more primitive on what is available (unless you want to
> become a log4c developer and write more)
>
>
> writing a log message:
> syslog: syslog(LOG_INFO,"message is %s: ", line);
> log4c: log4c_category_log(mycat, LOG4C_PRIORITY_INFO,"message is %
> s",line)
>
> shutting the logging down:
>
> syslog: closelog();
> log4c: log4c_fini();
>
>
> Is that a useful way to show it ?
>
> Skip
>
|
|
From: Karl-Philipp R. <ri...@ri...> - 2015-01-28 21:55:27
|
Hi, After I tried hard to get stared with log4c by reading around http://log4c.sourceforge.net I still have no idea how to do so. Is there any way you could provide me with a simple logging statement and change of the log level. I know that is not for a developers list, but I didn't find a users list. Thanks in advance. Best regards, Kalle Richter |
|
From: Jeffrey L. <jef...@gm...> - 2014-10-03 12:21:52
|
Hi,
I've run into the issue where I need to have one category output to
multiple appenders. I've noted on the main Log4C page "Future versions
will handle multiple appenders per category." Is this in development or
should I not hold my breath and try to find a workaround. Has anyone worked
through this problem?
Thanks!
|
|
From: František D. <va...@ci...> - 2013-10-03 22:29:22
|
Hello log4c users and developers, version 1.2.4 has been released. In this release there are new layouts logging messages with local time. There is also various maintenance work and improved security in public API headers. Windows MinGW port has been thoroughly tested and updated. Summary of the changes: * new date_local and date_local_r appenders * MinGW updates and important bugfixes: * timeval vs FILETIME structures mismatch * cleanups * support for MinGW >= 4.8 * add -no-undefied linker flag to create shared dll * reentrant layouts on all platforms now * replacement functions for buggy snprintf()/vsnprintf() * tests working out-of-the-box * proper output of long long int * generate also .def file * providing binaries for the release * tests working out-of-the-box on FreeBSD * fixed several warnings * public API functions with format strings are marked by GNU C format attribute * updated documentation -- František Dvořák <va...@ci...> |
|
From: František D. <va...@ci...> - 2013-09-27 14:08:13
|
Hello, log4c needs a little update for it, but the "classic" windows platforms (mingw32, mingw64) basically work. For example build on Fedora 19: yum install mingw64-gcc autoconf automake libtool mingw64-pthreads mingw64-expat # remove sleep() implementation from the examples ./configure --host=x86_64-w64-mingw32 # remove rpl_malloc, rpl_realloc make I don't know much about Windows platforms, have WinCE7 some specific needs? Most important thing is, we would need support of WinCE7 in MinGW. Plus there are some external dependencies (pthreads and expat), but that parts of log4c can be disabled. Cheers, Frantisek Reshmi Kailas píše v pá 27. 09. 2013 v 16:25 +0530: > Hi all, > > > > Is it possible to build LOG4C on WinCE7 platform? Whether the LOG4C > APIs are supported in WinCE7 ? Please reply. > > > > Thanks in advance. > > > > Regards, > > Reshmi > |