Skip to content
Advertisement

Tag: c++

Mitigating memory leaks by forking

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

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

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

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.)

Advertisement