Skip to content
Tcl Source Code View Ticket
Login

View Ticket

crash in source command if script file is very large

Closed / Duplicate2418583fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 17 years ago
Descriptionplain2008-12-11 22:30:40
I am using the Tcl_FSEvalFileEx() to source a script file. When the script file size is 1.2G there is a crash, here is the stack trace:

#0  0x0000002a96e7d984 in Tcl_ExternalToUtf ()
#1  0x0000002a96e9ac56 in ReadChars () from
#2  0x0000002a96e9afbd in DoReadChars ()
#3  0x0000002a96ea7faf in Tcl_FSEvalFileEx ()

Our application is running on 64 bits machine.

We are using Tcl 8.5 on Linux Red Hat 4.

Thanks,

Israel
dgpplain2008-12-12 08:54:25
ReadChars suggests failure
in the channel system.  Reassigning.

At such sizes, I would guess something
is running into the 2Gb size limit on
string values.
israeltplain2008-12-18 01:10:34
Any work-around for this issue?

Thanks,
Israel
dgp Ticket [2418583fff]: 1 change [History diff]2009-10-02 03:33:29
dkfplain2009-10-07 00:21:55
Keep the script size below 1GB! You can do this by writing multiple files (each of which is, say, 100MB) and then writing a separate script that just sources these other files in order. You could even put it all together in a directory for neatness sake.

Tcl makes no attempt to handle reading very large scripts graceful.
dkf Ticket [2418583fff]: 1 change [History diff]2009-10-07 00:22:00
dgpplain2009-10-07 01:02:11
This report overlaps with Patch 2107634.
Will track both issues there.
dgpplain2009-10-07 01:02:13
allow_comments - 1
Log in (anonymous is fine) to add a comment.