linux - Segmentation fault in pthread_create -


I am using pthread_create to use the shared library function. I get a Segmentation error after the following code is executed:

  #include & lt; Stdlib.h & gt; # Include & lt; Stdio.h & gt; # Include & lt; Dlfcn.h & gt; #to & lt include, string.h & gt; #to & lt include, pthread.h & gt; # Include & lt; Unistd.h & gt; Zero (* GetVersion) (four * version); Zero * Draw (Zero * Arg) {Zero * Handle; Four * error; Handle = DLPN ("Lib OpenKellara.", RTDDLEGE); If (handle!) {Fputs (deller (), stderr); Exit (1); } GetVersion = dlsym (handle, "GetVersion"); If ((error = dlerror ())! = NULL {fputs (error, stderr); Exit (1); } Four editions [4]; KailleraGetVersion (version); Put (version); Dlclose (handle); Return tap; } Int main (zero) {pthread_t tid; Pthread_create (& amp; tap, tap, and draw, tap); Sleep (5000); Return 0; }   

Bakstrres command following said:

  in # 0 0xb68e7be0 ?? () In the # 1 0xb7fa 9d56 __nptl_deallocate_tsd () pthread_create.c: the 158 # 2 0xb7fa9f83 start_thread (arg = 0xb7df0b40) on pthread_create.c: 325 # 3 0xb7ede4ce clone () in ../sysdeps/unix/sysv/linux/ I386 / clone S: 12 9   

what I do not understand why do you help me? After each Calling

pthread_create , please remember to tell thread to pthread_join or pthread_detach how to Call normally, please call before exiting from creating threads on pthread_join (this In case, this function is main .)

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -