process

Detecting debugger on Mac OS X

我的未来我决定 提交于 2021-02-06 13:41:16
问题 I am trying to detect whether my process is being run in a debugger or not and, while in Windows there are many solutions and in Linux I use: ptrace(PTRACE_ME,0,0,0) and check its return value, I did not manage to perform the same basic check on Mac OS X. I tried to use the ptrace(PT_TRACE_ME,0,0,0) call but it always returns 0 even when run under gdb. If I change the request to PT_DENY_ATTACH it correctly stops the debugging but that is not what I want to achieve. Any ideas? 回答1: You can

Is a process running on a remote machine?

瘦欲@ 提交于 2021-02-06 11:33:08
问题 I have three remote PC's to which I remotely connect. I am trying to write a simple Windows application that would display in a single window whether a particular process is running on either of the machines, e.g. Server1: Chrome not running Server2: Chrome IS running Server3: Chrome IS running I used WMI and C#. So far I've got this much: ConnectionOptions connectoptions = new ConnectionOptions(); connectoptions.Username = @"domain\username"; connectoptions.Password = "password"; //IP

Bash: Why does parent script not terminate on SIGINT when child script traps SIGINT?

心已入冬 提交于 2021-02-06 02:27:45
问题 script1.sh: #!/bin/bash ./script2.sh echo after-script script2.sh: #!/bin/bash function handler { exit 130 } trap handler SIGINT while true; do true; done When I start script1.sh from a terminal, and then use Ctrl + C to send SIGINT to its process group, the signal is trapped by script2.sh and when script2.sh terminates, script1.sh prints "after-script". However, I would have expected script1.sh to immediately terminate after the line that invokes script2.sh. Why is this not the case in this

Bash: Why does parent script not terminate on SIGINT when child script traps SIGINT?

折月煮酒 提交于 2021-02-06 02:26:32
问题 script1.sh: #!/bin/bash ./script2.sh echo after-script script2.sh: #!/bin/bash function handler { exit 130 } trap handler SIGINT while true; do true; done When I start script1.sh from a terminal, and then use Ctrl + C to send SIGINT to its process group, the signal is trapped by script2.sh and when script2.sh terminates, script1.sh prints "after-script". However, I would have expected script1.sh to immediately terminate after the line that invokes script2.sh. Why is this not the case in this

Kill all processes with a certain name

六月ゝ 毕业季﹏ 提交于 2021-02-04 20:49:58
问题 I have an HTA that runs a backup routine. For the backup I'm using the SyncToy command line executable, which in some instances does not properly cease. Beacuse of this, I'm trying to kill any process with the name SyncToyCmd.exe . I make use of the window_onBeforeUnload event and call the KillSyncToy() sub from there. The function is correctly detecting instances of the SyncToyCmd.exe , however when trying to kill the process I'm receiving an error - Error: The system cannot find the file

When we run an executable, do all the sections get loaded into memory at once?

此生再无相见时 提交于 2021-02-04 20:48:53
问题 So an executable contains of different sections and headers. At the ELF Header we can see some metadata about them like the size of different headers, Starting point etc. Are the different parts of an executable get loaded into memory all at once? If yes, how / when it is defined and where we can see the information about that because the ELF Header doesn't seem to have any parameter in that matter. Thanks in advance. 回答1: With ELF binaries, sections are not what decides how the binary is

How does the system choose the right Page Table?

大憨熊 提交于 2021-02-04 10:30:08
问题 Let's focus on uniprocessor computer systems. When a process gets created, as far as I know, the page table gets set up which maps the virtual addresses to the physical memory address space. Each process gets its own page table, stored in the kernel address space. But how does the MMU choose the right page table for the process since there is not only one process running and there will be many context switches happening? Any help is appreciated! Best, Simon 回答1: Processors have a privileged

Why Kivy doesn't allow multiprocessing precess to terminate in Python?

烈酒焚心 提交于 2021-01-29 13:29:12
问题 I'm creating my first app, and I've found this problem with Kivy: When I use multiprocessing in a Kivy app, the processes I created are immune to ".terminate()". Same code, but outside an app, works fine. What am I doing wrong? Here I attach some code: from kivy.app import App from kivy.lang import Builder from kivy.uix.screenmanager import Screen import multiprocessing import time from plyer import tts kv = Builder.load_file("testup.kv") class TestScreen(Screen): def speech(self): for i in

Kernel's hyper-parameters; initialization and setting bounds

有些话、适合烂在心里 提交于 2021-01-29 12:31:15
问题 I think many other people like me might be interested in how they can use GPFlow for their special problems. The key is how GPFlow is customizable, and a good example would be very helpful. In my case, I read and tried lots of comments in raised issues without any real success. Setting kernel model parameters is not straightforward (creating with default values, and then do it via the delete object method). Transform method is vague. It would be really helpful if you could add an example

Anylogic - dynamic specification of resources to seize

末鹿安然 提交于 2021-01-29 12:09:05
问题 Rather than statically defining the resources (or resource pools) to be seized within the definition of a seize block, I would like the agent entering the seize block to be able to specify the resources that it requires. For example, I may have say 100 resource pools each one representing a different type of resource (like tools in a tool room). Each agent in my model needs a different combination and quantity of the resources (in my example this would be tools). When my agent enters the