How is `SIGSEGV` an example of “signals related to the current state of the process be delivered before other signals”? [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












-1














APUE says




What happens if more than one signal is ready to be delivered to a process?
POSIX.1 does not specify the order in which the signals are delivered to the process.
The Rationale for POSIX.1 does suggest, however, that signals related to the current
state of the process be delivered before other signals. (SIGSEGV is one such signal.)




How is SIGSEGV an example of "signals related to the current
state of the process be delivered before other signals"?



Thanks.










share|improve this question















closed as unclear what you're asking by Stephen Harris, icarus, Rui F Ribeiro, Volker Siegel, msp9011 Dec 27 '18 at 6:35


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.



















    -1














    APUE says




    What happens if more than one signal is ready to be delivered to a process?
    POSIX.1 does not specify the order in which the signals are delivered to the process.
    The Rationale for POSIX.1 does suggest, however, that signals related to the current
    state of the process be delivered before other signals. (SIGSEGV is one such signal.)




    How is SIGSEGV an example of "signals related to the current
    state of the process be delivered before other signals"?



    Thanks.










    share|improve this question















    closed as unclear what you're asking by Stephen Harris, icarus, Rui F Ribeiro, Volker Siegel, msp9011 Dec 27 '18 at 6:35


    Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

















      -1












      -1








      -1


      1





      APUE says




      What happens if more than one signal is ready to be delivered to a process?
      POSIX.1 does not specify the order in which the signals are delivered to the process.
      The Rationale for POSIX.1 does suggest, however, that signals related to the current
      state of the process be delivered before other signals. (SIGSEGV is one such signal.)




      How is SIGSEGV an example of "signals related to the current
      state of the process be delivered before other signals"?



      Thanks.










      share|improve this question















      APUE says




      What happens if more than one signal is ready to be delivered to a process?
      POSIX.1 does not specify the order in which the signals are delivered to the process.
      The Rationale for POSIX.1 does suggest, however, that signals related to the current
      state of the process be delivered before other signals. (SIGSEGV is one such signal.)




      How is SIGSEGV an example of "signals related to the current
      state of the process be delivered before other signals"?



      Thanks.







      linux signals segmentation-fault






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 25 '18 at 19:16

























      asked Dec 25 '18 at 17:01









      Tim

      26.3k74246455




      26.3k74246455




      closed as unclear what you're asking by Stephen Harris, icarus, Rui F Ribeiro, Volker Siegel, msp9011 Dec 27 '18 at 6:35


      Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






      closed as unclear what you're asking by Stephen Harris, icarus, Rui F Ribeiro, Volker Siegel, msp9011 Dec 27 '18 at 6:35


      Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






















          1 Answer
          1






          active

          oldest

          votes


















          3














          SEGV is usually delivered when the state of a process is corrupt (memory is not mapped where it should be or is mapped with different permissions than expected, the program logic is trying to access memory that it shouldn't be accessing, etc).



          In that case, it helps to dump core and die as soon as possible so that subsequent changes don't mess up everything further and render any post-mortem debugging futile.






          share|improve this answer






















          • Thanks. The question is how SIGSEGV is an example of "What happens if more than one signal is ready to be delivered to a process?"
            – Tim
            Dec 25 '18 at 19:16







          • 1




            @Tim I think you misquoted your own question.
            – undercat
            Dec 25 '18 at 19:34










          • Well you could just try it. Run sh -c 'echo $$; read f' in a terminal, stop it with ^Z, attach to it with strace -p <echoed pid>, and then from another window run kill -HUP <pid>; kill -INT <pid>; kill -SEGV <pid>; kill -CONT <pid> and see which of INT, HUP or SEGV will get it first. Does this make it an example?
            – Uncle Billy
            Dec 25 '18 at 19:50










          • @Tim. In case it isn't clear, SEGV will always be delivered before HUP, INT or WINCH, if all of them are pending. This is an example of ""signals related to the current state of the process (SEGV, BUS, ILL) be delivered before other signals (USR1, WINCH, INT, etc)"
            – Uncle Billy
            Dec 25 '18 at 20:19










          • Thanks. What are the reason and purpose that SEGV will always be delivered before HUP, INT or WINCH?
            – Tim
            Dec 26 '18 at 14:30


















          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          3














          SEGV is usually delivered when the state of a process is corrupt (memory is not mapped where it should be or is mapped with different permissions than expected, the program logic is trying to access memory that it shouldn't be accessing, etc).



          In that case, it helps to dump core and die as soon as possible so that subsequent changes don't mess up everything further and render any post-mortem debugging futile.






          share|improve this answer






















          • Thanks. The question is how SIGSEGV is an example of "What happens if more than one signal is ready to be delivered to a process?"
            – Tim
            Dec 25 '18 at 19:16







          • 1




            @Tim I think you misquoted your own question.
            – undercat
            Dec 25 '18 at 19:34










          • Well you could just try it. Run sh -c 'echo $$; read f' in a terminal, stop it with ^Z, attach to it with strace -p <echoed pid>, and then from another window run kill -HUP <pid>; kill -INT <pid>; kill -SEGV <pid>; kill -CONT <pid> and see which of INT, HUP or SEGV will get it first. Does this make it an example?
            – Uncle Billy
            Dec 25 '18 at 19:50










          • @Tim. In case it isn't clear, SEGV will always be delivered before HUP, INT or WINCH, if all of them are pending. This is an example of ""signals related to the current state of the process (SEGV, BUS, ILL) be delivered before other signals (USR1, WINCH, INT, etc)"
            – Uncle Billy
            Dec 25 '18 at 20:19










          • Thanks. What are the reason and purpose that SEGV will always be delivered before HUP, INT or WINCH?
            – Tim
            Dec 26 '18 at 14:30
















          3














          SEGV is usually delivered when the state of a process is corrupt (memory is not mapped where it should be or is mapped with different permissions than expected, the program logic is trying to access memory that it shouldn't be accessing, etc).



          In that case, it helps to dump core and die as soon as possible so that subsequent changes don't mess up everything further and render any post-mortem debugging futile.






          share|improve this answer






















          • Thanks. The question is how SIGSEGV is an example of "What happens if more than one signal is ready to be delivered to a process?"
            – Tim
            Dec 25 '18 at 19:16







          • 1




            @Tim I think you misquoted your own question.
            – undercat
            Dec 25 '18 at 19:34










          • Well you could just try it. Run sh -c 'echo $$; read f' in a terminal, stop it with ^Z, attach to it with strace -p <echoed pid>, and then from another window run kill -HUP <pid>; kill -INT <pid>; kill -SEGV <pid>; kill -CONT <pid> and see which of INT, HUP or SEGV will get it first. Does this make it an example?
            – Uncle Billy
            Dec 25 '18 at 19:50










          • @Tim. In case it isn't clear, SEGV will always be delivered before HUP, INT or WINCH, if all of them are pending. This is an example of ""signals related to the current state of the process (SEGV, BUS, ILL) be delivered before other signals (USR1, WINCH, INT, etc)"
            – Uncle Billy
            Dec 25 '18 at 20:19










          • Thanks. What are the reason and purpose that SEGV will always be delivered before HUP, INT or WINCH?
            – Tim
            Dec 26 '18 at 14:30














          3












          3








          3






          SEGV is usually delivered when the state of a process is corrupt (memory is not mapped where it should be or is mapped with different permissions than expected, the program logic is trying to access memory that it shouldn't be accessing, etc).



          In that case, it helps to dump core and die as soon as possible so that subsequent changes don't mess up everything further and render any post-mortem debugging futile.






          share|improve this answer














          SEGV is usually delivered when the state of a process is corrupt (memory is not mapped where it should be or is mapped with different permissions than expected, the program logic is trying to access memory that it shouldn't be accessing, etc).



          In that case, it helps to dump core and die as soon as possible so that subsequent changes don't mess up everything further and render any post-mortem debugging futile.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Dec 25 '18 at 18:11

























          answered Dec 25 '18 at 17:35









          Uncle Billy

          3845




          3845











          • Thanks. The question is how SIGSEGV is an example of "What happens if more than one signal is ready to be delivered to a process?"
            – Tim
            Dec 25 '18 at 19:16







          • 1




            @Tim I think you misquoted your own question.
            – undercat
            Dec 25 '18 at 19:34










          • Well you could just try it. Run sh -c 'echo $$; read f' in a terminal, stop it with ^Z, attach to it with strace -p <echoed pid>, and then from another window run kill -HUP <pid>; kill -INT <pid>; kill -SEGV <pid>; kill -CONT <pid> and see which of INT, HUP or SEGV will get it first. Does this make it an example?
            – Uncle Billy
            Dec 25 '18 at 19:50










          • @Tim. In case it isn't clear, SEGV will always be delivered before HUP, INT or WINCH, if all of them are pending. This is an example of ""signals related to the current state of the process (SEGV, BUS, ILL) be delivered before other signals (USR1, WINCH, INT, etc)"
            – Uncle Billy
            Dec 25 '18 at 20:19










          • Thanks. What are the reason and purpose that SEGV will always be delivered before HUP, INT or WINCH?
            – Tim
            Dec 26 '18 at 14:30

















          • Thanks. The question is how SIGSEGV is an example of "What happens if more than one signal is ready to be delivered to a process?"
            – Tim
            Dec 25 '18 at 19:16







          • 1




            @Tim I think you misquoted your own question.
            – undercat
            Dec 25 '18 at 19:34










          • Well you could just try it. Run sh -c 'echo $$; read f' in a terminal, stop it with ^Z, attach to it with strace -p <echoed pid>, and then from another window run kill -HUP <pid>; kill -INT <pid>; kill -SEGV <pid>; kill -CONT <pid> and see which of INT, HUP or SEGV will get it first. Does this make it an example?
            – Uncle Billy
            Dec 25 '18 at 19:50










          • @Tim. In case it isn't clear, SEGV will always be delivered before HUP, INT or WINCH, if all of them are pending. This is an example of ""signals related to the current state of the process (SEGV, BUS, ILL) be delivered before other signals (USR1, WINCH, INT, etc)"
            – Uncle Billy
            Dec 25 '18 at 20:19










          • Thanks. What are the reason and purpose that SEGV will always be delivered before HUP, INT or WINCH?
            – Tim
            Dec 26 '18 at 14:30
















          Thanks. The question is how SIGSEGV is an example of "What happens if more than one signal is ready to be delivered to a process?"
          – Tim
          Dec 25 '18 at 19:16





          Thanks. The question is how SIGSEGV is an example of "What happens if more than one signal is ready to be delivered to a process?"
          – Tim
          Dec 25 '18 at 19:16





          1




          1




          @Tim I think you misquoted your own question.
          – undercat
          Dec 25 '18 at 19:34




          @Tim I think you misquoted your own question.
          – undercat
          Dec 25 '18 at 19:34












          Well you could just try it. Run sh -c 'echo $$; read f' in a terminal, stop it with ^Z, attach to it with strace -p <echoed pid>, and then from another window run kill -HUP <pid>; kill -INT <pid>; kill -SEGV <pid>; kill -CONT <pid> and see which of INT, HUP or SEGV will get it first. Does this make it an example?
          – Uncle Billy
          Dec 25 '18 at 19:50




          Well you could just try it. Run sh -c 'echo $$; read f' in a terminal, stop it with ^Z, attach to it with strace -p <echoed pid>, and then from another window run kill -HUP <pid>; kill -INT <pid>; kill -SEGV <pid>; kill -CONT <pid> and see which of INT, HUP or SEGV will get it first. Does this make it an example?
          – Uncle Billy
          Dec 25 '18 at 19:50












          @Tim. In case it isn't clear, SEGV will always be delivered before HUP, INT or WINCH, if all of them are pending. This is an example of ""signals related to the current state of the process (SEGV, BUS, ILL) be delivered before other signals (USR1, WINCH, INT, etc)"
          – Uncle Billy
          Dec 25 '18 at 20:19




          @Tim. In case it isn't clear, SEGV will always be delivered before HUP, INT or WINCH, if all of them are pending. This is an example of ""signals related to the current state of the process (SEGV, BUS, ILL) be delivered before other signals (USR1, WINCH, INT, etc)"
          – Uncle Billy
          Dec 25 '18 at 20:19












          Thanks. What are the reason and purpose that SEGV will always be delivered before HUP, INT or WINCH?
          – Tim
          Dec 26 '18 at 14:30





          Thanks. What are the reason and purpose that SEGV will always be delivered before HUP, INT or WINCH?
          – Tim
          Dec 26 '18 at 14:30



          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?