This is a really ugly question. I have a C++ program which does the following in a loop: Waits for a JMS message Calculates some data Sends a JMS message in response My program (let’s call it “Bob”) has a rather severe memory leak. The memory leak is located in a shared library that someone else wrote, which I must
Tag: c++
Signals in ppoll not handled immediately
I wrote a small ppoll test but I am confused about the signal handling. The man page says: The relationship between poll() and ppoll() is analogous to the relationship between select(2) and pselect(2): like pselect(2), ppoll() allows an application to safely wait until either a file descriptor becomes ready or until a signal is caught. In my case fd changes
How to include or link ncurses/ curses library in Codeblocks 13.12 in Ubuntu 16.04?
Hope you are doing great! I am using codeblocks 13.12 in my Elementary OS (Loki) which is based on ubuntu 16.04. Recently , I tried to use getch(), getche() function in my C-language coding and to do that i installed ncurses library in my system. When i try to build code, I get two error messages- Undefined reference to ‘stdscr’
How do I use a newer perf tool front end with a record from an older perf version
I am running perf record on an older version of the kernel on an ARM board. The kernel version is 3.18.21-rt19 The perf version on the board is similarly perf version 3.18.21. While I can record and use the report feature on this perf, the TUI for report on this version is quite awful/non-existent. Instead of the expandable sections (in
libusb-1.0 hotplug events stop working in parent after fork(), when child calls libusb_exit()
I’ve been developing an application that monitors the USB device tree using libusb_hotplug_register_callback(). When a device that matches some criteria is attached, it will fork() and exec() an application to handle this device. The application has been working fine for some time now, but I’ve come back to try and ‘tidy it up’… libusb will open a number of file
Sendto returning random values
I call sendto in my udp socket client side like this: but there seems to be no nothing received at the server side and in very strange fashion, num_w, when printed out, gives values like: -197379208 -1440076936 2054978424 And perror() displays “success” Client code up till that point: Thanks so much in advance! (Oh and I’m on Kali linux, virtual
If I want to empty a directory, is there any reason I shouldn’t remove it and recreate It?
I’ve looked at these two threads for emptying a directory: Removing a non empty directory programmatically in C or C++ Delete folder and all files/subdirectories However, the functions for emptying a directory given as answers to those threads are very complex, and one answer can encounter a stack overflow. When I think of removing and adding the directory, I’m thinking
Compiling standalone ASIO with Makefile on Linux
I’m trying to compile a small c++ program that captures an image from a camera using libv4l2 and then sends it over UDP to a separate computer using asio. The file structure of the project is: My Makefile for the project is: However, when I try to compile this, my compiler spits on dozens of undefined reference errors for ASIO
(GDB) Breakpoints and Disassemble
I’ve been recently interested in reading books and articles about hacking and I found out that Hacking:The art of exploitation is just a must read title. I am following the basic tutorials on how to work with standard Linux tools and analyze your code (Programming chapter). I am not a beginner in programming but working with Linux terminal is quite
unexpected result(-wS-wx–T) on file permission with open() function in C
I wrote this program to open a file. Everything was OK until I saw this permission(-wS-wx–T) with ls -lh open.c I compiled the program featly, didn’t take any error or warning. I haven’t ever seen kind of permission. What are ‘S’ and ‘T’ meaning in the file permissions section? (NOTE: I took the answer to this question in the comments.)