Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2026-10-12
19:33 • Closed ticket [b0e16e3f34]: Crash (Tcl_Panic) when closing a file channel pl... artifact: 23870dbbb8 user: serhiy.storchaka
2026-03-06
09:31 • Ticket [010d8f3885] tclEpollNotfy PlatformEventsControl panics if websocket disc... artifact: 5be40c2137 user: jan.nijtmans
2025-04-11
16:18
(cherry-pick): Updated changes for [010d8f38]. Indenting check-in: dbc4e16d09 user: jan.nijtmans tags: core-9-0-branch
2025-04-07
09:41
(cherry-pick): Fix [010d8f3885] tclEpollNotfy PlatformEventsControl panics if websocket disconnected check-in: e3ffca215e user: jan.nijtmans tags: core-9-0-branch
04:20 • Closed ticket [010d8f3885]: tclEpollNotfy PlatformEventsControl panics if websoc... artifact: 0a636fb7a1 user: stevel
04:20
Fix [010d8f3885] tclEpollNotfy PlatformEventsControl panics if websocket disconnected check-in: 5c274ca404 user: stevel tags: trunk, main
2025-03-24
11:38 • Ticket [010d8f3885] tclEpollNotfy PlatformEventsControl panics if websocket disc... artifact: 258f41b71b user: stevel
10:16 • Ticket [010d8f3885]: 4 changes artifact: f013df1d93 user: oehhar
2025-02-25
08:55 • Add attachment tcl.patch to ticket [010d8f3885] artifact: 86a089eb41 user: stevel
2024-12-02
23:59 • Ticket [010d8f3885] tclEpollNotfy PlatformEventsControl panics if websocket disc... artifact: e695923f47 user: stevel
14:13 • Ticket [010d8f3885]: 3 changes artifact: c339bb1253 user: dkf
2024-12-01
23:43 • Ticket [010d8f3885]: 3 changes artifact: e9b8c2c510 user: stevel
23:42 • New ticket [010d8f3885]. artifact: b209585ece user: stevel

tclEpollNotfy PlatformEventsControl panics if websocket disconnected

Closed / Fixed010d8f3885642212cf2c65036dd4ad444e9f769eCreated 2 years agoUpdated 272 days ago
About ticket 010d8f3885642212cf2c65036dd4ad444e9f769e

Now in branch fix-010d8f3885-tclEpollNotfy-websocket-panic and ready for review before merging

Descriptionplain2024-12-01 23:42:44
The tclEpollNotfy PlatformEventsControl function panics if the TclOSfstat call returns -1, which occurs when using a websocket to a browser and the browser page is refreshed. 

Jan suggested changing the Panic call to LIST_REMOVE(filePtr, readyNode) to remove the filePtr from the hash table as that is more appropriate during the deletion of the handle, but that changes the behavior from a panic to a SIGSEGV.

Tested on Ubuntu 22.04.4 LTS.   Doesn't affect 8.6 since that doesn't have ePoll support on Linux.
Referenced by3
  • 23870dbbb8Closed ticket [b0e16e3f34]: Crash (Tcl_Panic) when closing a file channel plus 4 other changes ticket2026-10-12 19:33:22
  • e3ffca215e(cherry-pick): Fix [010d8f3885] tclEpollNotfy PlatformEventsControl panics if websocket disconnected check-in2025-04-07 09:41:52
  • 5c274ca404Fix [010d8f3885] tclEpollNotfy PlatformEventsControl panics if websocket disconnected check-in2025-04-07 04:20:04
stevel Ticket [010d8f3885]: 3 changes [History diff]2024-12-01 23:43:12
dkfmarkdown2024-12-02 14:13:55

At the moment, it seems that the fstat call isn't doing anything useful. In particular, the contents of the statbuf aren't examined afterwards on success; at best, it changes what message we panic with.

stevelplain2024-12-02 23:59:41
I've confirmed that just returning from PlatformEventsControl rather than a panic does avoid the crash.  So that's a workaround albeit at the cost of a memory leak.  Is that sufficient or should we keep looking for a better solution?
oehharwiki2025-03-24 10:16:18

Dear Steve, dear Donal, thanks for this great action. Is the current source code comment sufficiant? Would it feasable to mention this ticket in a source code comment?

I am wondering, why this ticket is shown as "new wiki page" in fossil timeline. Is it me?

Thanks for all, Harald

stevelplain2025-03-24 11:38:45
Comments added, link fixed
stevel Closed ticket [010d8f3885]. [History diff]2025-04-07 04:20:45
jan.nijtmanswiki2026-03-06 09:31:11

Fixed [here]. No problems with it reported.

If this change causes newly found problems (which is not expected), please re-open this ticket

Log in (anonymous is fine) to add a comment.

Attachments: