bugGNU Common Lisp - Bugs: bug #51939, Troubles with SIGPIPE

 
 

bug #51939: Troubles with SIGPIPE

Submitted by:  Martin Saturka <kvutza>
Submitted on:  Tue 05 Sep 2017 12:10:21 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 05 Sep 2017 12:10:21 AM UTC, original submission:

To keep GCL telling me about broken-pipe situations (that is, not ignoring SIGPIPE events), I have to use the respective call for signal allowing:
(si:allow-signal 13)

When it happens that I actually get broken-pipe situation, and when then I do the ''(si:allow-signal 13)'' call that is not matched then by a new broken-pipe situation though, I get (apparently spurious) broken-pipe situations during exiting that GCL session.

Such late broken-pipe event prevents the actual leaving of the GCL session, and I have to call that ''BYE'' function again then.

That late (spurious) broken-pipe event is executed after going into the ''exit(exit_code);'' part at the "BYE" function. See the "o/main.c" file, starting at the line:
''DEFUNO_NEW("BYE",object,fSbye,SI''

If I change the "exit" calling into
''_exit(exit_code);''
then those late broken-pipe events are not executed. Thus it seems to be based on something like atexit/on_exit setting, but I have not found what sets it in.

Notice that I use GCL (mainly) via the Maxima software (in Ubuntu 16.04), and this issue is based on Maxima sessions; I do not have such issues with other lisp interpreters that I tested (they do not need that signal re-enabling though).

A quick/dirty way to go around this is by defining a new variable that says whether we are within leaving the session, and ignoring the broken-pipe calls then.
It can be done e.g. via putting (at top-level) into the ''o/main.c'':
int passing_through_quit = 0;
and then setting it into a nonzero value just before going into the ''exit(exit_code);'' part.
Then at the ''o/usig.c'' file, it can be checked in the ''sigpipe(void)'' function, and only trigger the error processing there if it is zero valued (if the leaving is left anyway, it has to be nullified again though).
I guess that some cleaner way is possible too.

Martin Saturka <kvutza>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by kvutza (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup1