Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2018-11-28
10:25 • Closed ticket [2aebcbb15b]: file tail "~/~/h" and file nativename &quo... artifact: 91396ba981 user: sebres
2018-11-22
14:35 • Closed ticket [7a9dc52b29]: tclsh crashes with tilde chars in filenames plus... artifact: 7c6aecf1a4 user: sebres
13:58
merge 8.5: fixes segfault [7a9dc52b29] and wrong normalization (inside TclJoinPath) for pure relativ... check-in: 8e8688f048 user: sebres tags: core-8-6-branch
12:48
fixes segfault [7a9dc52b29] and wrong normalization (inside TclJoinPath) for pure relative path-segm... check-in: bcee71a177 user: sebres tags: core-8-5-branch
2018-11-20
20:33 • Pending ticket [7a9dc52b29]: tclsh crashes with tilde chars in filenames plu... artifact: 77c24fdcb2 user: sebres
18:15 • Ticket [7a9dc52b29]: 4 changes artifact: 6f8d56e8c0 user: sebres
18:02
fixes segfault [7a9dc52b29]: unexpected decrement of the ref-count after TclJoinPath check-in: 10e9bd8b12 user: sebres tags: bug-7a9dc52b29
16:55 • Ticket [7a9dc52b29] tclsh crashes with tilde chars in filenames status still... artifact: 9f2b2eb250 user: sebres
16:37 • New ticket [7a9dc52b29]. artifact: d8577b2a3a user: avl42

tclsh crashes with tilde chars in filenames

Closed / Fixed7a9dc52b29a879858bc1d916d9bb7e182b3bfc0eCreated 8 years agoUpdated 8 years ago
Descriptionplain2018-11-20 16:37:39
testcase:
% file normalize ~/~foo    ;#  tilde slash tilde something
Segmentation Fault

Same result on attempt to [open] a such-named file

I noticed it in 8.6.3 and 8.6.5,  people on chat confirmed it for 8.6.8 and 8.7a2

back in 8.4 and 8.5 it didn't crash, but return a wrong result ("~foo").
Referenced by4
  • 91396ba981Closed ticket [2aebcbb15b]: file tail "~/~/h" and file nativename "~/~/h" is crashing plus 6 other changes ticket2018-11-28 10:25:37
  • 8e8688f048merge 8.5: fixes segfault [7a9dc52b29] and wrong normalization (inside TclJoinPath) for pure relative path-segments; test-cases extended and several windows-related are fixed. check-in2018-11-22 13:58:37
  • bcee71a177fixes segfault [7a9dc52b29] and wrong normalization (inside TclJoinPath) for pure relative path-segments; test-cases extended and several windows-related are fixed. check-in2018-11-22 12:48:42
  • 10e9bd8b12fixes segfault [7a9dc52b29]: unexpected decrement of the ref-count after TclJoinPath check-in2018-11-20 18:02:32
sebresplain2018-11-20 16:55:57
found the bug: `TclDecrRefCount(absolutePath)` releases absolutePath object that implicit releases the "fsPathPtr->normPathPtr" returned later.
Possibly Tcl_FSConvertToPathType references objects a bit wrong (resp. misses a increment of refCount somewhere).
WiP
sebreswiki2018-11-20 18:15:23

Segfault is fixed in [10e9bd8b12], but... working on the test-cases should cover that, I found strange behavior:

% file normalize ~/~foo
~foo
% file normalize ~/bar/~foo
/home/sebres/bar/~foo
I think the first is invalid, it should be similar to:
% file normalize ~/foo
/home/sebres/foo
The same doing *nix platforms, e. g. `cd ~/foo` as well as `cd ~/~foo` just append second path-segment to current user home.

I'm trying to find a proper solution here (and will provide then the covering test-cases).

sebreswiki2018-11-20 20:33:15

both things are fixed now in bug-7a9dc52b29 branch, the branch is tested on *nix/win and can be merged >= 8.5.

sebreswiki2018-11-22 14:35:00

segfault & normalization bug fixed and merged to all branches (8.5...9.0).

also note: `file normalize ~/~foo` results into `/<home/user>/~foo` now, in opposite to wrong normalization `~foo` as absolute path segment previously (as it still went in old versions).

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