Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 708299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:22:32+00:00 2026-05-14T04:22:32+00:00

Can I distinguish signal, between delivered directly to a process and delivered via debugger.

  • 0

Can I distinguish signal, between delivered directly to a process and delivered via debugger.

Case 1:

 $ ./process1
 process1 (not ptraced)
 //set up handler
 alarm(5);
 ....
 //signal is handled and I can parse handler parameters

Case 2:

 $ debugger1 ./process1
 process1 (is ptraced by debugger1)
 //set up handler
 alarm(5);
 ...
 //signal is catched by debugger1. It resumes process1 with PTRACE_CONT,
 // signal_number is 4th parameter of PTRACE_CONT.
 //signal is redelivered to process1
 //and then is handled.

So, how can I detect in signal handler, was it redelivered by debugger or send by system?

OS is Linux, kernel is 2.6.30. Programs are written in plain C. In real program SIGALRM is used, but it is generated not by alarm(), but with setitimer().

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:22:32+00:00Added an answer on May 14, 2026 at 4:22 am

    man ptrace: ( http://linux.die.net/man/2/ptrace )

    PTRACE_GETSIGINFO (since Linux
    2.3.99-pre6) Retrieve information about the signal that caused the stop.
    Copies a siginfo_t structure (see
    sigaction(2)) from the child to
    location data in the parent. (addr is
    ignored.)

    PTRACE_SETSIGINFO (since Linux
    2.3.99-pre6) Set signal information. Copies a siginfo_t structure from
    location data in the parent to the
    child. This will only affect signals
    that would normally be delivered to
    the child and were caught by the
    tracer. It may be difficult to tell
    these normal signals from synthetic
    signals generated by ptrace()
    itself
    . (addr is ignored.)

    PTRACE_CONT Restarts the stopped
    child process. If data is non-zero and
    not SIGSTOP, it is interpreted as a
    signal to be delivered to the child;
    otherwise, no signal is delivered.
    Thus, for example, the parent can
    control whether a signal sent to the
    child is delivered or not. (addr is
    ignored.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can not distinguish the difference between aggregating and holding. What does it mean
How can I distinguish between published OSGI services implementing same interface by their properties?
Let's say I have a button.. how can I distinguish between single click and
I'm trying to find a CSS selector that can help me distinguish between the
I wonder if someone can distinguish precisely between these? For my understanding, Core Graphics
using jquery, how can you distinguish between refreshing vs. navigating away from the current
I need a javascript regex that can distinguish between PHP tags in HTML tags
How can i distinguish between field errors and bubbled (form) errors? AFAIK the only
There seems to be a bug in the Java varargs implementation. Java can't distinguish
Can I change the field public virtual ClassOne ClassOne { get; set; } to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.