Re: Bug in log.c

Stipe Tolj <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization Wapme Systems AG
Message-ID <[email protected]>
Hi Michael,

Michael Mulcahy wrote:
> 
> Hi All,
> 
> There is a bug in the logging functions debug, info, warning, error and
> panic
> which cause a crash when called from a thread that has a thread id larger
> than 1024, i.e. gwthread_self returns value > 1024
> 
> In the log module there is an array for mapping threads to logfiles:
> 
> #define THREADTABLE_SIZE 1024
> static unsigned int thread_to [ (long) THREADTABLE_SIZE ];
> 
> The log functions use this to identify which log file to write the data to,
> as in following:
> 
> void error(int e, const char *fmt, ...)
> {
>     if ((e = thread_to[gwthread_self()])) {     /**** Relevent line ***/
>         FUNCTION_GUTS_EXCL(GW_ERROR, "");
>     } else {
>         FUNCTION_GUTS(GW_ERROR, "");
>     }
> }
> 
> Unfortunately if gwthread_self returns a value greater than 1024 then
> problems
> occur.
> 
> Comments or suggestions appreciated!

you are right. But how to reproduce this?

Have you ceriously running bearerbox with more than 1024 threads
inside?

Stipe

[email protected]
-------------------------------------------------------------------
Wapme Systems AG

Vogelsanger Weg 80
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [email protected]
Internet: http://www.wapme-systems.de
-------------------------------------------------------------------
wapme.net - wherever you are
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.