Skip to content
Tcl Source Code View Ticket
Login

View Ticket

expr parser stack overflow

Closed / Fixed906201ffffffffffffffffffffffffffffffffffCreated 23 years agoUpdated 20 years ago
Descriptionplain2004-02-27 22:00:23
Calling expr "[string repeat +1 10000]"
in later versions of tcl (8.4+) will cause a core/gpf due 
to a stack overflow. What is happening is 
CompileSubExpr is recursively calling itself as it compiles 
each +1 token pair.
dgpplain2004-02-28 09:02:09
Logged In: YES 
user_id=80530

Later versions of Tcl ?
The recursive nature of
CompileSubExpr() hasn't
changed, has it?

FWIW, on my system (Solaris 9):

% expr [string repeat +1 10000]
10000

returns in just a few seconds.
mistachkinplain2004-03-10 06:32:22
Logged In: YES 
user_id=113501

Confirmed for HEAD.

The exact value required to get a crash is system dependant 
due to variations in actual stack size on different platforms.
dgpplain2006-07-05 12:34:56
Logged In: YES 
user_id=80530


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