Questions tagged [fork]
The fork tag has no summary.
192 questions
8 votes
1 answer
1k views
How to stop kate forking itself
After a recent update, kate seems to fork a copy of itself, presumably with some parameter which prevents an endless recursion, and then exits. Presumably this was intended to help users who run kate ...
0 votes
1 answer
96 views
flock not working between forks on the same fd
I am working on a process that forks several times. To debug it, I am using a debug file for which I open a fd and which stays the same for all child forks. Then I have a function print_debug, that ...
8 votes
2 answers
674 views
fork() Causes DMA Buffer in Physical Memory to Retain Stale Data on Subsequent Writes
I'm working on a C++ application on Ubuntu 20.04 that uses PCIe DMA to transfer data from a user-space buffer to hardware. The buffer is mapped to a fixed 1K physical memory region via a custom ...
0 votes
1 answer
82 views
Are reads of /proc/pid/environ atomic in Linux 6.x (e.g: 6.1.99)?
When a process execs, looking at kernel code for environ_read(), it seems that if the mm_struct doesn't yet exist / is null or the env_end member of that mm_struct is null, environ_read() will return ...
0 votes
0 answers
97 views
Understanding AFL behaviour for fork and execv; Why `/proc/<pid>/maps` does not show the loaded binary
TL;DR Why process map in /proc/<pid>/maps does not show where the executed binary is loaded? I am trying to do some post-mortem analysis of the fuzzed program once it finishes. Basically what I ...
0 votes
1 answer
78 views
What Causes PHP Forks to Consolidate on a Single CPU Core in FreeBSD 13.3?
I'm using a PHP 8.x script to process a series of images, performing various conversions and resizing tasks. To make the most of the server's multiple cores, I employ the pcntl_fork() function to ...
-3 votes
1 answer
168 views
why don't we create processes from scratch and make it a "fork", in linux? [duplicate]
why in Linux do we not create a process from scratch, as "init" is created, but create a "fork" of it by the method of branching?
0 votes
0 answers
178 views
fork() is very slow
I have a Linux server running Ubuntu 18.04 on a VM. Executing any task like ls -l or w frequently takes several seconds to finish. strace -c ls -l says ls only takes a few milliseconds, but running ...
4 votes
0 answers
78 views
Perl's `kill` is using `$! == Errno::EINTR` unexpectedly
I wrote a network daemon that forks off children to handle TCP connections. On SIGINT the main process triggers a kill for each child in order to clean up and to collect some final statistics. In ...
0 votes
0 answers
55 views
Forking from a systemd service [duplicate]
I have a python program that runs as a systemd user service. From that program, I launch external commands via subprocess.Popen(cmd, close_fds=True, start_new_session=True). My intention is for these ...
0 votes
1 answer
234 views
What's the difference between "-dm" and "-Dm" in GNU Screen?
The GNU Screen manual says: `-d -m' Start `screen' in _detached mode. This creates a new session but doesn't attach to it. This is useful for system startup scripts. ...
2 votes
2 answers
4k views
What is the "correct" way to run a systemd service which spawns long running detached processes?
I have a systemd service which spawns an ffmpeg process any time it detects a new event. These processes are meant to survive and run to completion even if the service is restarted (hence them being ...
1 vote
1 answer
202 views
Child and sibling processes from running tmux in zsh
I am using Ubuntu 22.04.1 on WSL 2 (though the fact that it is Unix is only relevant for this question) How come when we run tmux from a zsh session, the process tree (which I have abridged somewhat) ...
1 vote
1 answer
246 views
What is the easiest way to run a VM that executes a simple C program
I'm trying to run a simple one file C program in a Virtual Machine. In fact it is the fork bomb c program: #include <stdio.h> #include <sys/types.h> int main() { while(1) { ...
0 votes
1 answer
180 views
I'm curious about the difference between running a daemon with a systemctl command and running it directly [duplicate]
I had a question while dealing with the issue related to snmp in my project. If you enter the following command to execute snmpd with various options, snmpd will be executed without any problem. $ ...