c - Program terminating on receiving - signal SIG34, Real-time event 34 -



c - Program terminating on receiving - signal SIG34, Real-time event 34 -

in application main function calls funciton - f2 spawns several threads , application works fine. trying add together new function f1 before f2 spawn new thread. new thread prints on screen , goes sleep in while loop. getting print 1 time , after time application terminates. on debugging same gdb got next message:

(gdb) programme received signal sig34, real-time event 34.quit (gdb) bt #0 0x0fa97cc8 in __nanosleep_nocancel () /export/home/disk4/omsn/401.03022010/montavista/pro/devkit/ppc/82xx/target/lib/tls/libc.so.6 #1 0x0fa97a50 in __sleep (seconds=0) @ sleep.c:137 #2 0x10007098 in f2 (arg=0x204) @ main.c:152 #3 0x0fd2197c in start_thread (arg=0x204) @ pthread_create.c:256 #4 0x0fac853c in clone () @ ../sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.s:100 warning: previous frame inner frame (corrupt stack?)

code snippet:

main(){ f1(); /*new function added spawn new task*/ f2(); /*existing function spawns several tasks*/ }

can 1 tell me "signal sig34, real-time event 34" , causing same.

here details of f1 does:

int f1(){ pthread_t thread_id; pthread_attr_t attr; size_t stack_size; int ret=0; pthread_attr_init(&attr); /*initialize stack size*/ pthread_attr_getstacksize (&attr, &stack_size); printf("default stack size = %d\n", stack_size); stack_size = 2000; pthread_attr_setstacksize (&attr, stack_size); /*initialize detach state*/ pthread_attr_setdetachstate(&attr,pthread_create_detached); printf("going spawn thread\n"); ret = pthread_create(&thread_id, &attr, task_func, null); if (ret){ printf("error; homecoming code pthread_create() %d\n", ret); homecoming ret; }else{ printf("thread spawned, thread id - %d\n", thread_id); } pthread_attr_destroy(&attr); homecoming ret; } void* task_func(void* arg){ printf ("inside %s going long sleep\n",__function__); sleep(100); while(1){ printf ("inside %s\n",__function__); sleep(5); } }

linux supports real-time signals defined in posix.1b real-time extensions (and included in posix.1-2001). range of supported real-time signals defined macros sigrtmin , sigrtmax. getting software interrupt signal 34.and it's sigtemi+0. type below command in terminal

$ kill -l

you list of signals. farther info regarding signal on link. http://www.freedesktop.org/software/systemd/man/systemd.html hope info help find reason behind getting signal34.because have not updated whole code here, it's little bit hard why getting signal34.

c linux multithreading pthreads signals

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -