Bug 159226 - [libedit] [patch] libedit does not always restore its signal handler
Summary: [libedit] [patch] libedit does not always restore its signal handler
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 7.3-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-27 11:30 UTC by AIDA Shinra
Modified: 2017-12-31 22:29 UTC (History)
0 users

See Also:


Attachments
libedit-multisignal.diff (685 bytes, patch)
2011-07-27 11:30 UTC, AIDA Shinra
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description AIDA Shinra 2011-07-27 11:30:08 UTC
If a program gets the same signal twice in a single call to el_gets(), editline's internal signal handler is not used to the second one.

Fix: Apply the attached patch.
How-To-Repeat: I found this bug when testing CURRENT's BSD bc.

You can also reproduce the problem by inserting "printf" or "write" to libedit's sig_handler() and run ftp(1).
Comment 1 Pedro F. Giffuni freebsd_committer 2012-07-02 20:53:15 UTC
It is likely that this bug was fixed by r237448,=0Awhich merged some update=
s from NetBSD, among them=0ACVS 1.13:=0A=0Ain order for read() to return EI=
NTR we need to use sigaction, not signal,=0Aotherwise SA_RESTART is set.=0A=
=0Ahttp://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libedit/sig.c.diff?r1=3D1.12=
&r2=3D1.13&only_with_tag=3DMAIN
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:11 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped