Programming :: Signal Error Shown - Bad Trap?

Jun 16, 2010

#!/bin/sh
trap "echo Haha" SIGUSER1
echo "asit"
count=1
while [ $count -le 10 ]
do
echo "Loop #$count"
sleep 10
count=$[ $count + 1 ]
done
echo "This is the end"

Why this is showing following error?
trap: 3: SIGUSER1: bad trap

View 4 Replies


ADVERTISEMENT

Programming :: Makefile Error Shown Only By Eclipse?

Apr 26, 2010

I created a quick makefile with the following lines:

Code:

$(BINARY):
echo "----- Linking $(BINARY)----"
gcc -m32 -g src/* -Iinclude -I$(HOME)/include -I$(HOME)/include2 -D_LINUX -DSYSV -DPOSIX -L$(HOME)/shared/lib32 -lidlib -lid2lib -o bin/sampleapp
echo "---- done ----"

It builds fine when I build from the command line ( make -f sample.mk).

However, it does not build when building from eclipse (which essentially calling the same makefile). The make output shows exactly the same as what I got from the command line build, except the last line showing

Code:

collect2: cannot find 'ld'
make: *** [sampleapp] Error 1

I am not sure why it tries to call "ld" when building from eclipse.

View 6 Replies View Related

Programming :: Using Trap In Bash Script?

Nov 21, 2010

Code:
#!/bin/sh
onexit()
{
echo "Error At line - $1"
}

[Code].....

What I want to do is to make the onexit function to handle any generic error that comes during script execution. I am not thinking about using 'set -e' since it will cause a quick exit. I did 127, because I wanted my script to handle atleast the command not found error. I am not thinking about handling any interrupt or any other signal at the moment.

View 10 Replies View Related

Programming :: Use Trap All Errors A Script Ocurs Which The Script Does Not Explicitly Handle?

Nov 8, 2010

I have a function in perl which I want to use trap all errors a script ocurs which the script does not explicitly handle. These errors are then logged to various places. So I tried to use a eval block but the problem I have is sometimes if you put a die statement in the evaled script it doesn't get handled. What I have so far is:

[Code]....

View 4 Replies View Related

Programming :: Totem Python Plugin Programming: Any Signal For Video Mouse Click?

Feb 9, 2011

I want that I click with the mouse on the video, it paused.I notice that there is "BaconVideoWidget" which I guess is the video rendering widget but it don't have signal named "clicked":

Code:
vd = totem_object.get_video_widget()
vd.connect("clicked", vd.hide)

[code]....

View 3 Replies View Related

Ubuntu :: Network Icon Is Not Shown Properly While Me Menu Is Being Shown Twice

Sep 26, 2010

I just reinstalled Ubuntu Lucid Lynx and an old problem has come back. For some reason I couldn't fix it even in my previous installation. The problem is the top gnome panel. See the photo below: As you can see, the network icon is not shown properly while the Me menu is being shown twice. I can't even restart or log out or shut down at this situation without pressing the keystroke to turn the power off.

View 9 Replies View Related

Programming :: Signal Emitted With CTL+D In Bash?

Oct 22, 2010

I'm doing the shell history audit logging using syslog to gather the command history. I'm using this well publicized method using trap and logger:

declare -r REAL_LOGNAME=`/usr/bin/who am i | cut -d" " -f1`
function log2syslog {
declare command
command=`fc -ln -0`
logger -p local1.notice -t bash -i ": $REAL_LOGNAME as $LOGNAME :$command"
}
trap log2syslog DEBUG TERM

The problem is that the trap on DEBUG will catch the next to last command executed (by virtue of the "fc" command) which is not the current command executed. TERM will catch that "next to last" command on exit, thus completing the logging of each command executed during that session.

However, CTL+D doesn't seem to emit a SIGTERM signal. What signal is actually being emitted and can it be trapped? I guess another question would be whether there is a way to trap history after command line execution? Moving to Bash 4.1 isn't possible in our "supported" multi-platform environment

View 5 Replies View Related

Programming :: Signal Handling In Pthread?

Mar 12, 2011

I have created a pthread, and installed a signal handler inside that, same way as we do in main( ) function. The thread's signal handler is a separate function. Surprisingly, it is not working, that is the thread's signal handler is not able to catch signals. Here is the code:

Code: #include <unistd.h>
#include <sys/types.h>
#include <stdio.h>
#include <signal.h>
typedef struct data

[Code]...

View 1 Replies View Related

Programming :: [C++] Cannot Catch SIGPIPE Signal?

Mar 27, 2011

I have a Socket library, written in C++, in which the method used to send data never has the opportunity to handle an errno of SIGPIPE. Thus I thought perhaps I should setup a signal handler to receive the signal, but this too is not being called.Is there something that I am missing or doing that is completely wrong? Below is the relevant code. Note that a SIGPIPE signal is generated when the Server is unable to send data to the Client (e.g. the client has terminated).Server code:

Code:
#include <TCPServerSocket.hpp>
#include <string>

[code]...

View 1 Replies View Related

Ubuntu :: Pidgim Crashes No Error Message Shown

Feb 17, 2010

I use jaunty, and everytime i start pidgim it crashes not error message shown, i removed it and installed it again, no sucess. I guess it must be dropping error messages somewhere. Can someone help or provide me where should i be looking for the error messages, i went to system log but could not find it. I tried dmsg | tail , post the crash, did not see anything.

View 3 Replies View Related

Programming :: Possible To Connect A Signal Handler To A Variable?

Nov 1, 2010

Is it possible to connect a signal handler to a variable?So when the variable changes the signal handler is called.I have a vector containing strings which i want to parse when there are one or more available strings in the vector

View 3 Replies View Related

Programming :: Stop User From Invoking Own Signal?

Apr 27, 2011

I have a signal handler in my tool, which is registered and used between some particular interval (i am using timer). Now this signal handler should NOT allow any other handler to be registered or invoked after this handler is once registered. Is there any way to accomplish this?

[code]...

View 6 Replies View Related

Programming :: Use CTRL+D Signal In Bash Script?

Jan 15, 2010

I am writing a bash script where I need standard Input should be saved in a file and should be terminated by passing CTRL+D signal. Any clue how can I do that in bash script.

e.g.
Enter one line at a time
Press CTRL+D to finish

View 1 Replies View Related

Programming :: Unable To Catch The SIGTERM Signal?

Apr 25, 2011

But unable to catch the SIGTERM signal if I do shutdown, as man pages says shutdown genrates the SIGTERM and SIGKILL signals, but we cant handle the SIGKILL signal. My code is working fine if I genrate the SIGTERM signal by Kill command, and also for SIGINT signgal genrated from the CTRL+c key.

Here is my code:

/* Example of using sigaction() to setup a signal handler with 3 arguments
* including siginfo_t.
*/
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>

[Code]...

View 5 Replies View Related

Programming :: Sequencing With Raising A Signal Method?

Mar 4, 2010

I was trying to program using fork(). The objective of this code is to

1. I am activating a process A - SubSuctionMotors.
2. Process A is going to stop with either of this condition
a) Switch is activated - swret=1
b) Time allowed has expired
3. Stop the process A.

[Code]...

1. We purposely force the switch to be inactive to test the child process (timer), whether after 2 seconds the motor stop. It turns out to be successful in first few attempts. After some while, the program hang, nothing is executed anymore and the program is not exit or terminated. What can cause the program to hang?

2. We tried to stop motor by switch activation (if the switch is to be successfully activated, the time it takes will always be shorter than the timer allowed time). However, the program did not seems like noticing the switch has been activated, and it just stop the motor according to timer. Why it behave this way?

View 4 Replies View Related

Programming :: Temporarily Blocking Or Disconnecting A GTK+ Signal?

May 21, 2010

I'm just beginning to program with GTK+, and I'm facing this issue: I want to inhibit a signal emission inside one and only one function. I've down cut my code into the smallest example I can to show you what I want to do:The "Emitter" contains a "GtkSpinBox" and it relays the "value-changed" signal, it's header:

Code:
#ifndef EMITTER_H
#define EMITTER_H

[code]....

View 1 Replies View Related

Red Hat / Fedora :: Get 'killed By Signal 7' Error?

Jan 22, 2010

I am using fedora 9. I have installed cell SDK 3.0. when i run any program on that simulator i get 'killed by signal 7' error.

View 1 Replies View Related

Ubuntu Installation :: When Trying To Run 'python Setup.py Build' Get An Error (Shown At The End)?

May 5, 2010

I would like to install pymedia on my ubuntu 9.10 karmic distribution, but I am having a bit of a hard time doing that.I managed to install all the libraries (lame, libogg, libvorbis etc.) but when trying to run 'python setup.py build' I get an error (Shown at the end).I found on the interwebs that it may have to do with the version of gcc c++ compiler running (currently gcc-4.4) and that it only works with gcc-3.x. Therefore I downloaded gcc-3.4 (from the old jaunty archive), and with this one still no joy.NebelhomP.S. I am not a complete newcomer to linux and python but I am not an expert so it may happen that I ask questions with a very obvious answer.

Code:
nebelhom@nebelhom-desktop:~/pymedia-1.3.7.3$ python setup.py build
Using UNIX configuration...

[code].....

View 1 Replies View Related

Debian Programming :: Serial Port Signal Handler

Jan 14, 2015

Basically I'm intending to write serial RX signal handler.Application receives defined packages of data over serial which contains header and payload. Handler should analyse incoming stream and upon detection of header (header is 6B in length) switches to receive payload of length defined in header, then after receiving full message packs it and sends to application for handling.Problem I'm facing is that at random moments in signal I receive errors that "Resource temporarily unavailable" while reading from ttyOx device and I see that sometimes I miss incoming data.Also is it possible that if while I'm handling signal one more signal arrives and it is started to be handled parallel? If it is, what are the ways to prevent it? So I would be sure that no more signals will fire on same peripheral until I will finish handling what I have on my hands now.

Serial open and init:
Code: Select allint open_port(int port_nr) {
    int fd; /* File descriptor for the port */
    switch (port_nr) {
    case 1:
        fd = open("/dev/ttyO1", O_RDWR | O_NOCTTY | O_NDELAY);
        break;
   
[code]....

View 5 Replies View Related

Programming :: Handle Keyboard Button Pressed Signal?

Jul 4, 2011

I'm learning Signals, and I have a question:

Is possible to make a handle when I press any of the keyboard buttons?

The SIGINT handles the Ctrl-C combination, but I want to handle if any keyboard button was pressed.

View 3 Replies View Related

Programming :: Locking Mutex In A Signal Handler Function?

Feb 15, 2010

locking mutex (phtread_t type) in a signal handler function (installed by function signal()) for Linux. It seems that if the mutex has been previously locked by another thread outside the signal handler function and then the signal handler function tries to lock it, the whole process hangs.

View 5 Replies View Related

Programming :: Designing A Signal Handler With Sigwait In UNIX?

Jan 20, 2010

I'm new to Unix and every signal handler algorithm I've seen is more or less a copy of what I'm trying to do.[URL] designing a signal handler with sigwait in UNIX?

View 1 Replies View Related

Programming :: Why Does A Child Exit When The Parent Receives A Signal

Mar 16, 2011

I have a problem with the last point of some homework I have for an OS class. I need the program to print the pid upon execution, then for 10 seconds react to SIGUSR1, SIGUSR2 and SIGTERM. If either USR1 or USR2 is received, the 10 seconds are reset. Some of the functions I'm told to use are alarm(), pause() and signal(). The nicest way I found was to handle SIGUSR1, SIGUSR2 and SIGALRM in the parent process, with SIGALRM killing the child (with a SIGTERM). In the child a pause() (or for(; pause() would be enough for it to be alive until killed from the SIGALRM handler in the parent.

What I found is that I can't just do a wait() in the parent process, waiting for the child to be killed, since whenever the parent receives a SIGUSR1 or SIGUSR2, the right handler is called but the child exits nicely. I tried blocking/ignoring those signals in the child, since the default behaviour for SIGUSR1 and SIGUSR2 is to terminate the process, but the result is the same. The only way I could do it is using a waitpid() within a do { } while(!WIFSIGNALED(status)) since when the child gets killed with the parent's kill(), it's WIFSIGNALED, whereas when it exits after the parent handles a SIGUSR1/2, it's WIFEXITED.

P.S. What I'm doing to achieve the expected 10s window is calling alarm(10) in the parent process and again within the SIGUSR1/2 handlers. In the SIGALRM handler I kill the child and within the child I simply do a for(; pause()

View 4 Replies View Related

SUSE :: Error - Input Signal Out Of Reach

Mar 25, 2010

when restarting suse 10 , i get an error displaying as Input signal out of reach..even its not going through any of the consoles....but ..when i shutdown the suse system and start suse its going inside without this error...how can i stop the error from occurring while restarting suse...this error occurs only when i restart suse.....when i freshly start suse after shutting down the system...its going well without errors.

View 1 Replies View Related

Programming :: Missing Incoming Gpio Signal Pulses On Imx27

Nov 4, 2010

I am using an imx27 and have a timer set up for 100 ms and a loop to count the pulses while the timer has not expired. I get about 90 % reliable results but every once in a while i get one that is out to lunch. I am reading in a signal that is about 500khz and counting on an transition. I usually get around 85k count. But i will randomly get a 50k count.

View 3 Replies View Related

OpenSUSE Install :: Getting Error For11.4 - Signal 11 Caught?

Mar 10, 2011

I am not able to install OpenSuse 11.4. This is what happen 32bits: I get up to the login (shell); I type root ad later startx. After this, I get an error complain about fglrx and I get caught signal 11. I have already tried the F4 option during the boot but it did not work. I tried every combinations. 64bits: My computer get stuck as soon as I press enter. my laptop is an HP Pavillion HP dv6-3052nr. I do not have any problem with OpenSuse 11.3 and any other Linux distributions.

View 3 Replies View Related

Software :: Trap A Crashing App?

Aug 29, 2010

I would like to learn the right way, or some neat technique, to discover why a compiled-from-source application just unaccountably quits. it it easy enough to discover that the pre-compiled version from Ubuntu does work just fine. My motivation is to explore, and maybe try to modify it a little for myself.

At my level of programming expertise, I have often used the "sh configure, make, make install" route; and sometimes made small changes to the code eg. changing a window size and similar. C and C++ tutorials teach the main rules, but I am no expert at classes, structures or obscure expression tricks.

The application is a QT type called "qantenna", used for electromagnetic simulation of antennas. The source I downloaded from SourceForge. Although a KDE application, the repository version seems to run just fine on my Ubuntu 9.10 Karmic (soon to become Lucid), on its Gnome desktop.

The compiled version behavior is that the main window opens and runs OK, with the GUI view operating with fully alterable views. As soon as a valid antenna file is loaded, the whole application instantly quits.

How does one deal with an application that gives no chance to catch it doing things wrong?

View 14 Replies View Related

General :: Error Child Pid 13810 Exit Signal Segmentation Fault (11)

May 23, 2011

I installed Centos 5, httpd 2.2.3 and php5.3.6 with yum.

We have a website which can upload JPEG file to the server via php. But when we uploaded file, it showed the error

Quote:

child pid 13810 exit signal Segmentation fault (11)

I tried to run gdb on my computer and it showed that

Quote:

0xb6d1a600 in ?? () from /usr/lib/libjpeg.so.62

View 1 Replies View Related

Programming :: Program Hang Stuck There Signal Handling On POSIX Message Queue UNIX C Pr

Jun 14, 2011

In a single main() function,so need signal handling. Use Posix Message Queue IPC mechanism , can ignore the priority and other linked list message,to implement the scenario:

View 1 Replies View Related

OpenSUSE :: Okular Crashes - Error Executable PID 4927 Signal: Segmentation Fault(11)

Aug 31, 2011

I got a problem with Okular crashing. This is the error message i get

Excutable okular PID 4927 Signal: Segmentation fault(11)

The PID is a different number each time i try to open a file. What could be causing this.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved