Skip to content
Advertisement

Tag: c++

Which thread handles the signal?

I have 2 threads(thread1 and thread2). And I have signal disposition for SIGINT. Whenever SIGINT occurs thread 2 should handle the signal. For that I wrote below program I compiled and and run the program. for every 1 second “thread1 active” is printing and for every 3 seconds “thread2 active” is printing. Now I generated SIGINT. But its printing “thread1

OS X UDP send error: 55 No buffer space available

While I was implementing RUDP in python3.3 on OSX10.9.1 I noticed that the following code actually does not do what it does on linux: (it doesn’t matter which language, same behavior for C, Java and C#/Mono) This code just keep writing a lot udp packets to 8.8.8.8, those packets get dropped after 4 hops so they should not reach the

What does “high involuntary context” switches mean?

I have re-written a part of code in C. When testing it with logging the resource usage using getrusage(2) C API. Before changing the code: After changing: I see a lot of involuntary context switches being done in the code I have re-written. My question is not about how to reduce context switches. But.. What happens when “involuntary context switches”

I do not understand how execlp() works in Linux

I have spent the last 2 days trying to understand the execlp() system call, but yet here I am. Let me get straight to the issue. The man page of execlp declares the system call as int execlp(const char *file, const char *arg, …); with the description: The const char arg and subsequent ellipses in the execl(), execlp(), and execle()

Good way to debug stack value corruption

What is a good way to debug stack value corruption. In a program of mine sometimes the address of the this pointer gets changed after a method returns that does a shutdown on a file descriptor. I debugged the program for hours but I can not find the problem. What is a good method to find out what changes the

Program output changes when piped

I have a simple C program to time process startup (I’d rather not post the full code as it’s an active school assignment). My main function looks like this: sample_time() is a function that times how long it takes to fork a new process and returns the result in seconds as a double. The part of sample_time() that forks: As

objdump -t /usr/bin/sort command shows no symbols

If I try objdump -t /usr/bin/sort command it says no symbols. But it seems to work on my programs. What is the reason for this? Answer The symbols of /usr/bin/sort has been removed, e.g. with the strip program – for most executables the symbol table is not needed (or only needed for debugging). Here is a bit more info.

Advertisement