Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2005-10-05
13:34 • Closed ticket [1067708fff]: bad argv handling for fconfigure -ttycontrol plu... artifact: 6a012d544d user: hobbs
2004-12-02
05:26 • Ticket [1067708fff]: 4 changes artifact: dcab91fa73 user: andreas_kupries
05:22 • Ticket [1067708fff]: 4 changes artifact: 9ae57e9cfb user: dgp
2004-11-17
09:53 • Ticket [1067708fff]: 7 changes artifact: d5d1240115 user: hobbs
09:53 • Ticket [1067708fff]: 1 change artifact: 1e1587ccc1 user: hobbs
07:50 • Ticket [1067708fff]: 4 changes artifact: f0d9e6d5dd user: dgp
07:50 • Ticket [1067708fff]: 1 change artifact: aef41cfd8d user: dgp
06:57 • Ticket [1067708fff]: 4 changes artifact: 4127b7c83b user: hobbs
06:57 • Ticket [1067708fff]: 6 changes artifact: e3df6d932a user: hobbs
06:57 • Add attachment 1067708.patch to ticket [1067708fff] artifact: 738fcd4fcd user: hobbs
2004-11-16
23:25 • New ticket [1067708fff] Threaded Tcl crashes on fconfigure -ttycontrol. artifact: b0ae2106e9 user: nobody

bad argv handling for fconfigure -ttycontrol

Closed / Fixed1067708fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 21 years ago
Descriptionplain2004-11-16 23:25:18
Tcl 8.4.7, built with threads enabled, crashes when
configuring a serial port on a Linux system. The
following code  reproduces the problem:

> % info patchlevel
> 8.4.7
> % open /dev/ttyS0 {RDWR}
> file7
> % fconfigure file7 -mode "9600,n,8,1"
> % fconfigure file7 -ttycontrol {RTS 1 DTR 1}
> Segmentation fault

The fault appears to be specific to the 'ttycontrol'
option and does not happen on a non-threaded build. The
platform is Slackware Linux 9.1 with GCC 3.2.3 and
glibc 2.3.2. The configure options used to compile Tcl
were "--enable-shared --enable-threads".

George
fr30 at dial dot pipex dot com
hobbsplain2004-11-17 06:57:48
Logged In: YES 
user_id=72656

I believe the following patch is correct for 8.4.8.  Please
verify - may need adjustment for 8.5a2.
hobbsplain2004-11-17 06:57:49
File Added - 109035: 1067708.patch
dgp Ticket [1067708fff]: 1 change [History diff]2004-11-17 07:50:27
dgpplain2004-11-17 07:50:28
Logged In: YES 
user_id=80530

patch applies to both branches, and
after application the crash is gone in
both branches.

changes look correct too.
hobbs Ticket [1067708fff]: 1 change [History diff]2004-11-17 09:53:33
hobbsplain2004-11-17 09:53:34
Logged In: YES 
user_id=72656

Fixed this in 8.4.8 and 8.5a2.  Noticed that tclWinChan.c
avoided this by never freeing the argv array!  This moves to
an open bug on win/tclWinChan.c to free that memory
(correctly!).
dgpplain2004-12-02 05:22:02
Logged In: YES 
user_id=80530

should this be closed now?
andreas_kupriesplain2004-12-02 05:26:07
Logged In: YES 
user_id=75003

No, because we still have to fix the memleak on windows.
hobbsplain2005-10-05 13:34:26
Logged In: YES 
user_id=72656

properly free argv in 8.4.12 and 8.5a4.
Log in (anonymous is fine) to add a comment.

Attachments: