Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2005-10-05
20:08 • Ticket [1306310fff] Segmentation Fault when creating a itcl::class status st... artifact: dd92a83cf3 user: robsaye
10:55 • Closed ticket [1306310fff]. artifact: 7d14ac71f4 user: hobbs
2005-09-28
17:34 • Ticket [1306310fff]: 4 changes artifact: 82a1d7cbcf user: msofer
10:21 • Ticket [1306310fff]: 4 changes artifact: 9d4b3d922a user: nobody
08:03 • Ticket [1306310fff]: 4 changes artifact: 0d37bcfa13 user: msofer
05:48 • Ticket [1306310fff]: 4 changes artifact: 9cfeb28c69 user: robsaye
2005-09-27
22:34 • New ticket [1306310fff]. artifact: 967937b40c user: nobody

Segmentation Fault when creating a itcl::class

Closed / Invalid1306310fffffffffffffffffffffffffffffffffCreated 21 years agoUpdated 21 years ago
Descriptionplain2005-09-27 22:34:26
Running:

% package require Expect
5.42.1
% package require Itcl
3.1
% puts $tcl_version
8.4
% itcl::class Foo {
   common boolean
   set boolean(true) 1
   set boolean(false) 0
}
Segmentation fault

The same command in the itclsh shell works fine:

% class Foo {
   common boolean
   set boolean(true) 1
   set boolean(false) 0
}
%

I just moved to Debian Sarge "kernelversion 2.6"
robsayeplain2005-09-28 05:48:05
Logged In: YES 
user_id=1352898

This is my bug, I just created a username here. My email is
robsaye at comcast dot net.
msoferplain2005-09-28 08:03:14
Logged In: YES 
user_id=148712

Two questions:

1. is the 'package require Expect' necessary for the
segfault? You do not seem to include that itclsh.

2. please report any differences in the contents of
tcl_platform as well as tcl_patchlevel between the two cases
- trying to determine if both shells are built similarly.
nobodyplain2005-09-28 10:21:28
Logged In: NO 

1. Package Require Expect is not required, (It was just in
the test I had written that crashed)


2.  tclsh

% array get tcl_platform
osVersion 2.6.12-staros-9240 byteOrder littleEndian threaded
1 machine i686 platform unix os Linux user rsaye wordSize 4


 itclsh
array get tcl_platform
osVersion 2.6.12-staros-9240 byteOrder littleEndian machine
i686 platform unix os Linux user rsaye


On both there is no variable tcl_patchlevel

 puts $tcl_patchlevel
can't read "tcl_patchlevel": no such variable
msoferplain2005-09-28 17:34:02
Logged In: YES 
user_id=148712

Oops ... that should have been an [info patchlevel] request,
sorry.

Anyway: one difference is that your tclsh is a threaded
build, whereas the itclsh is not. So now the question is if
your itcl package is built for threads (a "no" would explain
the crash). Do you know how it was compiled? 

ISTR that expect is known to have problems with threads.
Does your test also crash without requiring it?
hobbsplain2005-10-05 10:55:32
Logged In: YES 
user_id=72656

Someone hasn't put together the pieces right.  The following
is from a threaded Linux ActiveTcl build that indicates this
works when compiled right:

tellar [~] 93 > ~/ActiveTcl-8.4t/bin/tclsh
% package require Expect
5.43.0
% package require Itcl
3.3
% itcl::class Foo {
common boolean
set boolean(true) 1
set boolean(false) 0
}
% parray tcl_platform
tcl_platform(byteOrder) = littleEndian
tcl_platform(machine)   = i686
tcl_platform(os)        = Linux
tcl_platform(osVersion) = 2.6.8-24.14-default
tcl_platform(platform)  = unix
tcl_platform(threaded)  = 1
tcl_platform(user)      = jeffh
tcl_platform(wordSize)  = 4
% package require ActiveTcl
8.4.11.1.198139
robsayeplain2005-10-05 20:08:50
Logged In: YES 
user_id=1352898

That would help greatly, the Debian "Sarge" release has Itcl
version 3.1 which can't handle the --enable_threads option
tcl 8.4 was built with. To solve this I just rolled back to
tcl 8.3 which does not have threads enabled. I updated a
Debian Bug on this.
Log in (anonymous is fine) to add a comment.