You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2006/06/06 21:09:26 UTC

DO NOT REPLY [Bug 39737] New: - LogFormat "%{tid}P" reports wrong thread id on Windows

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39737>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39737

           Summary: LogFormat "%{tid}P" reports wrong thread id on Windows
           Product: Apache httpd-2
           Version: 2.2.2
          Platform: PC
        OS/Version: Windows Server 2003
            Status: NEW
          Severity: normal
          Priority: P3
         Component: mod_log_config
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: gaodebin@hotmail.com


It seems that the access log with format "%{tid}P" gives the wrong thread id
on Windows.  I record the thread id in my kernel driver using
PsGetCurrentThreadId(),
which reports a different number than the apache log "%{tid}P".  I also
tried a 3rd party monitoring software (Process Explorer v10.11), which
returns the same result as mine.  "%{pid}P" gives the correct process id though.

Could someone look into this?  Thanks.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39737] - LogFormat "%{tid}P" reports wrong thread id on Windows

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39737>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39737





------- Additional Comments From gaodebin@hotmail.com  2006-06-12 19:41 -------
Just checked the source, and it's the thread handle that's being logged on
Windows.  I don't see why the handle, instead of the id, is being logged, as the
log is to be used outside of httpd, where logging the id makes more sense.  BTW,
%{pid}P logs the process id on Windows.

Anyway, if there is indeed a reason to log the thread handle, please update the
documentation. 

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39737] - LogFormat "%{tid}P" reports wrong thread id on Windows

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39737>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39737





------- Additional Comments From gaodebin@hotmail.com  2006-06-13 15:36 -------
Anyone cares to comment on this?

Thread Ids are unique throughout the system, while handles are only unique
within the process.

It's really a pain not getting the thread id from the logs.  All I'm trying to
do is to find the corresponding thread that served the requests.  I can easily
obtain thread ids of all the threads; I can also get a handle to any thread, but
the integer value of that handle I obtain is different from what's been logged
by http, because the handles to the same thread could be different.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39737] - LogFormat "%{tid}P" reports wrong thread id on Windows

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39737>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39737





------- Additional Comments From wrowe@apache.org  2007-12-30 22:26 -------
You are absolutely correct; the thread id and not its handle should be recorded.

I should think calling gettid() (corresponding to the getpid call in
ap_append_pid) where available would have been the "proper" implementation.

Patches welcome (gettid detection for unix is, of course, required).

One ponders why ap_append_tid wasn't implemented ;-)  (Appending, say, nothing
on a non-threaded architecture).

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org