Bug 580089 - pid2id() failed to get a right id
Summary: pid2id() failed to get a right id
Status: RESOLVED FIXED
Alias: None
Product: TCF
Classification: Tools
Component: Agent (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Eugene Tarassov CLA
QA Contact: Eugene Tarassov CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-06 21:00 EDT by wenyan xin CLA
Modified: 2022-06-08 12:42 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wenyan xin CLA 2022-06-06 21:00:08 EDT
the function pid2id() in file agent/tcf/framework/context.c.

After the fix of Bug 579362, the function uses the pid_t type to compute the ID, but since it is not unsigned, then it will not get a decimal string.

On VxWorks for 64bit the process IDs is:
    typedef long pid_t;

And in my test, the pid is 0xffff800000124f20, it is a signed long, then it got a strange string.



Bug 579362 - the process IDs should be pid_t instead of UINT32 in waitpid.c and waitpid.h files
Comment 1 wenyan xin CLA 2022-06-06 21:02:40 EDT
if I only changed the line 55 in function pid2id(), it seems everything is OK:

from:        pid_t n = pid;
to:          unsigned long n = pid;
Comment 2 Eugene Tarassov CLA 2022-06-08 12:42:24 EDT
Fixed.
Thanks!