How to send SIGNAL to the thread?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to send SIGNAL to the thread?
# 1  
Old 02-19-2009
How to send SIGNAL to the thread?

Hello,
I have to send SIGSEGV to the thread.
What is the simplest and efficient way to do that?
# 2  
Old 02-20-2009
anyone on this?
# 3  
Old 02-20-2009
Why do you want to send a SIGSEGV? That it usually sent by a program to indicate that it encountered a segment violation, aka segfault. If you want to tell the thread to end, use one of USR1, USR2, TERM, or HUP. How to do that: see man kill.
Also, please do not bump up threads (see The UNIX and Linux Forums - Forum Rules)
# 4  
Old 02-20-2009
Quote:
Originally Posted by Rahulpict
Hello,
I have to send SIGSEGV to the thread.
What is the simplest and efficient way to do that?
Did you mean a process or a thread?
# 5  
Old 02-20-2009
If you want to end a thread you can call pthread_cancel, but if a thread is canceled in the middle of the code, resources are not deallocated and could be leaked.

Regards
# 6  
Old 02-20-2009
Hello All,
I want to reproduce a Crash scenario where SIGSEGV was encountered to a thread. I have setup all necessary envr and now I just need to know how I can send "SIGSEGV" to the "thread"
# 7  
Old 02-22-2009
Quote:
Originally Posted by Rahulpict
Hello All,
I want to reproduce a Crash scenario where SIGSEGV was encountered to a thread. I have setup all necessary envr and now I just need to know how I can send "SIGSEGV" to the "thread"
You can simulate a SIGSEGV with this code in your thread:

Code:
  char *s = "String";
  *s = 'S';

Regards
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Send ctrl-C signal using bash script.

declare -a array=( "LLC-load-misses" "LLC-loads" "LLC-store-misses" "LLC-stores" "branch-load-misses" "branch-loads" "dTLB-load-misses" "dTLB-loads" "dTLB-store-misses" "dTLB-stores" "iTLB-load-misses" "iTLB-loads" "branch-instructions" "branch-misses" "bus-cycles" "cache-misses" "cache-references"... (2 Replies)
Discussion started by: BHASKAR JUPUDI
2 Replies

2. Shell Programming and Scripting

Vi : Is it possible to send ctrl + d signal from a file made with vi and executing it.

Hi Experts, Is it possible to send ctrl + d signal from a inside a file made with vi, using Ctrl V , Esc and 004 , escape sequence. Since : 004 should exit the script if executed. Is this something possible. I am trying with vi , I put this code ^ , and trying to execute it but... (4 Replies)
Discussion started by: rveri
4 Replies

3. Programming

how can i make that a process child send a signal?

I'm trying to do a program that makes activate an signal (SINGALARM) when the next child of a son appears but this not works. I have to caught the next child o the other (pid), to send a singnal which inform a menssage. It's anything worng in the code? thanks. the code: #include... (2 Replies)
Discussion started by: marmaster
2 Replies

4. UNIX for Dummies Questions & Answers

Send email with attachment and body : mailx , waiting for input , signal Control D

Hi, I am trying to send email with attacment and body using "mailx" (cat body.txt; uuencode attach.txt) | mailx -s "Attachment" abc@xyz.com When i type this command, the shell is still waiting for me to enter something in standard input and press control D before it sends a mail and... (2 Replies)
Discussion started by: aliaszero
2 Replies

5. Shell Programming and Scripting

Tricky little problem, send signal to other machine without user

Hi everyone! I want to be able to send a signal to another machine on the same network, and have it trigger a script on that machine. Here's the reason why I can't just ssh: I don't have a username on that machine, but there is a user that is always logged on that I can do stuff on. So, I want... (5 Replies)
Discussion started by: declannalced
5 Replies

6. Shell Programming and Scripting

thread::signal

Hi,all! Now ,I write perl for windows platform,and will use signal for asynchronous operations ,but I find it could bring some bugs if it is used incorrectly ,pls help!!! :D (1 Reply)
Discussion started by: hhh101
1 Replies
Login or Register to Ask a Question

Featured Tech Videos