Tcl Source Code

View Ticket
Login
2026-10-26
20:52 • Closed ticket [1696642fff]: sigpipes in test suite plus 9 other changes artifact: f69b0a78e0 user: jan.nijtmans
16:54
Fix [1696642fff]: "make gdb-test" and "make gdb" tell gdb not to stop on SIGPIPE check-in: 3dd530527b user: jan.nijtmans tags: core-8-6-branch
16:42
Fix [1696642fff]: "make gdb-test" and "make gdb" tell gdb not to stop on SIGPIPE check-in: 59a640d4e4 user: jan.nijtmans tags: core-9-0-branch
16:41
Fix [1696642fff]: "make gdb-test" and "make gdb" tell gdb not to stop on SIGPIPE check-in: 4576331fff user: jan.nijtmans tags: trunk, main
2026-10-20
13:35 • Ticket [1696642fff] sigpipes in test suite status still Open with 4 other ch... artifact: d73e92e2bc user: serhiy.storchaka
13:35
Fix [1696642fff]: "make gdb-test" and "make gdb" tell gdb not to stop on SIGPIPE, which Tcl ignores. closed check-in: b0abe7aa01 user: serhiy.storchaka tags: gdb-ignore-sigpipe
2007-04-11
16:59 • Ticket [1696642fff] sigpipes in test suite status still Open with 1 other ch... artifact: b07a97cafe user: das
16:52 • Ticket [1696642fff]: 1 change artifact: 5b71ecc5ed user: das
2007-04-10
20:25 • Ticket [1696642fff]: 5 changes artifact: e9061e0ce4 user: dgp
19:40 • Ticket [1696642fff]: 4 changes artifact: 8ebffe6ca3 user: das
10:08 • Ticket [1696642fff]: 2 changes artifact: e2c2664f09 user: dgp
10:08 • Ticket [1696642fff]: 4 changes artifact: 1d7a731fa7 user: dgp
03:33 • Ticket [1696642fff]: 4 changes artifact: cb58fd127d user: andreas_kupries
2007-04-09
21:36 • Ticket [1696642fff]: 4 changes artifact: e32c7b3985 user: dgp
21:18 • Ticket [1696642fff]: 4 changes artifact: e5ce16f6da user: dgp
21:05 • Ticket [1696642fff]: 4 changes artifact: 0dd1159b37 user: dgp
06:32 • Ticket [1696642fff]: 4 changes artifact: 91f5b79449 user: msofer
06:32 • Add attachment backtrace.txt to ticket [1696642fff] artifact: dc194710df user: msofer
2007-04-08
23:32 • New ticket [1696642fff] sigpipe in http.test. artifact: 81a50fbae4 user: msofer

Ticket UUID: 1696642
Title: sigpipes in test suite
Type: Bug Created on: 2007-04-08 23:32:21
Submitter: msofer Assigned to: jan.nijtmans
Subsystem: 25. Channel System Severity: Minor
Priority: 2 Last modified: 2026-10-26 20:52:36
Status: Closed Closed by: jan.nijtmans
Resolution: Fixed Closed on: 2026-10-26 20:52:36
Version: 8.6.18, 9.0.5, 9.1.0
Description:
With today's head on linux, running a --disable-shared --enable-symbols=all test under gdb (make gdb-test), there is a sigpipe in http.test. Partial backtrace attached. (Bug found by dgp)
User Comments:
msofer added on 2007-04-09 06:32:22:

File Added - 224193: backtrace.txt

dgp added on 2007-04-09 21:05:15:
Logged In: YES 
user_id=80530
Originator: NO


same issue is in the 8.5a5 release.

dgp added on 2007-04-09 21:18:50:
Logged In: YES 
user_id=80530
Originator: NO

ditto 8.5a4...

ditto 8.5a2...

dgp added on 2007-04-09 21:36:18:
Logged In: YES 
user_id=80530
Originator: NO



and older releases than that
don't have a gdb-test target,
so further testing is non-trivial.

Apparently there's some long-term
issue lurking here.

andreas_kupries added on 2007-04-10 03:33:20:
Logged In: YES 
user_id=75003
Originator: NO

Given that there is a backtrace does this mean that the core crashed ?

I thought that a SIGPIPE simply causes a Tcl error to be thrown, something which can be caught ? Although, I have seen that only for actual pipes i.e. 'tclsh ... | ...' and the sigpipe happens when the consumer exists before the tclsh, pulling the rug out under tclsh.

What does SIGPIPE means for a socket connection ? ... Ok, google (sigpipe, socket) delivers <<http://docs.hp.com/en/32650-90372/ch02s14.html>>, quoting:

    A SIGPIPE is generated when a send operation is attempted on a broken socket.
    One way of breaking a socket is to do a shutdown(,2) on a socket.

That is the same semantics as for actual pipes, so I guess that we should behave in the same wat, throw a Tcl error.

So we simply might have to catch the sigpipe and throw as tcl errors, as we do for regular pipes. ... The relevant files for that seem to be "tclUnixInit.c" and "tclUnixPipe.c", just look for 'SIGPIPE'. ... Hm. The code in UnixInit does a global SIG_IGN for this signal, to ignore it, so this should apply to sockets as well!

Which of the test cases in http.test is actually breaking ?
Could it be that gdb overrides our handling of sigpipe ?
In that case the 'crash' might simply an artifact of execution under gdb and not an actual bug.

dgp added on 2007-04-10 10:08:13:
Logged In: YES 
user_id=80530
Originator: NO


better example of the issue
is test io-29.27.  Comments
there indicate that running
such tests in a debugger will
have this problem.

Perhaps some constraints would
be useful to allow the
`make gdb-test` target to
run to completion, but seems
less likely there's any real
bug behind this.  dropping prio.

das added on 2007-04-10 19:40:20:
Logged In: YES 
user_id=90580
Originator: NO

For exactly  this reason, I have the following in my .gdbinit:
handle SIGPIPE nostop noprint
I routinely run the testsuite in gdb from Xcode, and this allows it to complete without interruptions...

dgp added on 2007-04-10 20:25:54:
Logged In: YES 
user_id=80530
Originator: NO


aha! an effective workaround.
prio lower still.

serhiy.storchaka added on 2026-10-20 13:35:22:

Still the case on main. Not a Tcl bug: Tcl ignores SIGPIPE (unix/tclUnixInit.c) and handles EPIPE, but gdb stops on the signal anyway, e.g. in io-29.27.

Proposed in branch [b0abe7aa01|gdb-ignore-sigpipe]: the gdb-test and gdb targets of unix/Makefile.in pass -ex "handle SIGPIPE nostop noprint" to gdb (the workaround from this ticket). With it, io-29.27 runs to completion under make gdb-test.


jan.nijtmans added on 2026-10-26 20:52:36:

Fixed in [4576331fff3ad26e|trunk], core-9-0-branch and core-8-6-branch

Many thanks!


Attachments: