https://bugzilla.novell.com/show_bug.cgi?id=362181 User duan_ruitao@emc.com added comment https://bugzilla.novell.com/show_bug.cgi?id=362181#c1 Summary: thread creating shows multiple processes running Product: openSUSE 10.2 Version: Final Platform: i686 OS/Version: SLES 9 Status: NEW Severity: Critical Priority: P5 - None Component: Development AssignedTo: pth@novell.com ReportedBy: duan_ruitao@emc.com QAContact: qa@suse.de Found By: Customer Hi, I am not sure if this is the correct place to report an issue for help. We have a customer who has our software installed on its 32 bit SLES9 host, but the customer reported "ps -ef" commands shows multiple processes running of the program. We have writen a small test program which does the similar thing of our software, and could reproduce this issue on the customer site. However, this issue cannot be reproduced on our hosts. We are not sure if the problem is caused by Linux OS, libc, pthread, or "ps" command. Our small test program uses pthread to create one thread to run the same command again, then create another listening thread. The code looks like this: int main(int argc, char **argv) { if (argc == 1) handleSuperAgent() create_thread(listenThreadFunc, ...); return 0; } void *listenThreadFunc(void *argv) { for (;;) // loop forever to handle other components { create_thread(getNewConnectionFunc, ...); } } void *getNewConnectionFunc(void *argv) { // just do something } void handleSuperAgent() { char *cmd[] = {"./TestProgram", "-s", NULL}; for (;;) // loop forever until shut down { pid_t pid = fork(); switch (pid) { case 0: execvp("./TestProgram", cmd); .... } } pthread_t create_thread(...) { pthread_mutex_lock(...); pthread_create(...) ... } When we ran this program on our host, "ps -ef" shows these two processes which is expected: ./TestProgram ./TestProgram -s But when the customer ran it on its host, "ps -ef" shows these similar processes: 20507 15632 0 10:19 pts/0 00:00:00 ./TestProgram 20515 20507 0 10:19 pts/0 00:00:00 ./TestProgram -s 20516 20515 0 10:19 pts/0 00:00:00 ./TestProgram -s 20517 20516 0 10:19 pts/0 00:00:00 ./TestProgram -s 20518 20516 0 10:19 pts/0 00:00:00 ./TestProgram -s 20520 20507 0 10:19 pts/0 00:00:00 ./TestProgram -s 20521 20520 0 10:19 pts/0 00:00:00 ./TestProgram -s ... We are pretty sure we have used pthread and fork correctly. We think pthread might have issue, or "ps" command might, but we are not sure. The customer's host has this setup: Linux lgxxxxxx 2.6.5-7.244-bigsmp #1 SMP Mon Dec 12 18:32:25 UTC 2005 i686 i686 i386 GNU/Linux SUSE LINUX Enterprise Server 9 (i586) VERSION = 9 PATCHLEVEL = 3 Intel(R) Xeon(TM) CPU 3.00GHz Does any one has idea about what might be the issue? What we can do to help solve the problem? Thanks -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.