"Illegal operation" error on windows

8 views
Skip to first unread message

Saverio Castellano

unread,
Sep 6, 2002, 9:32:36 AM9/6/02
to
I'm the author of a TCL IRC Client (called savIRC
http://sourceforge.net/projects/savirc/) for Linux and Windows.
On Linux the client works great but on Windows
after I use it for a while it crashes throwing an "Illegal Operation" error.

I don't think that this is a error I made writing the code
because i don't get a tcl error.
It doesn't even seem to depend on the tcl/tk version
I use because I have tried it with several versions and neither it depends
on the Windows system, I get the same illegal operation on Win95,Win98,Win2K,WinXP.

I have heard that when Tk widgets are destroyed under
windows the memory is not freed so programs that use
many widget will use more and more memory until they
crash. Is this true ? Could this be the reason?
Probably not because I haven't seen other TCL programs that always
crash like this on windows but I also know that
my program uses text widgets to display the text for channels
and queries and text tags for format mIRC colors, and many other widgets
for the GUI.

Is there any way, or something I can do to the tcl code so
that I won't get the Illegal Operation again ?

Any help is very appraciated!

David Gravereaux

unread,
Sep 6, 2002, 4:30:49 PM9/6/02
to
save...@tiscali.it (Saverio Castellano) wrote:

>Is there any way, or something I can do to the tcl code so
>that I won't get the Illegal Operation again ?

More info needed.. Is this a "Dr. Watson" error like "Your application has
performed an illegal operation and will be shutdown"?

Sounds like a job for a debugger and I don't mean a Tcl debugger.
--
David Gravereaux <davy...@pobox.com>
Tomasoft Engineering, Hayward, CA
[species: human; planet: earth,milkyway,alpha sector]

Saverio Castellano

unread,
Sep 7, 2002, 8:04:14 AM9/7/02
to
David Gravereaux <davy...@pobox.com> wrote in message news:<qh3inus22hdsqhsq2...@4ax.com>...

> save...@tiscali.it (Saverio Castellano) wrote:
>
> >Is there any way, or something I can do to the tcl code so
> >that I won't get the Illegal Operation again ?
>
> More info needed.. Is this a "Dr. Watson" error like "Your application has
> performed an illegal operation and will be shutdown"?
>
> Sounds like a job for a debugger and I don't mean a Tcl debugger.

Yes, I get a "Dr. Watson" error like "Your application has performed
an illegal operation and will be shutdown" message.

Kevin Kenny

unread,
Sep 7, 2002, 10:57:47 AM9/7/02
to
Saverio Castellano wrote:

> Yes, I get a "Dr. Watson" error like "Your application has performed an
> illegal operation and will be shutdown" message.

You shouldn't be able to cause a Dr Watson with ANYTHING you can do from
Tcl/Tk. The maintainers take this sort of thing very seriously. and make
every effort to see that it doesn't happen.

OK, now come the next series of questions:

(1) Are you using any extensions beyond tclsh/wish? If so, what are they?

If you're not using any C-coded extensions, then you've unquestionably
found a bug in Tcl/Tk itself. All the maintainers are eager to
exterminate these bugs, but you have to help us help you:

(2) What version of Tcl/Tk is this? Are you running a binary
distribution, or did you rebuild it from source? If you're running a
binary distribution, where did you get it? (If it fails on multiple
versions, tell us about the newest. We still will need version
information even if it fails everywhere, because we're likely at some
point to need to match our source code to your binary.)

(3) Is there anything you can take out of your program and still have it
crash? It's easiest to approach this sort of thing from the smallest
possible example.

If you are not using any extensions, can you please file a bug report at
SourceForge with a precise recipe for making it crash (That is, upload
all the code that's needed to make it fail, and specific steps to take
to reproduce the error.) If you have trouble making it crash on demand,
there are further steps that we can take, but they get more difficult.

If it fails on Windows NT or 2k with one of the standard distributions
from ActiveState, another thing that can help is if you search your hard
disk for a file named 'drwtsn32.log'. When you find it, open it with
Notepad, and go to the last log entry (they're each a page or so long).
Snip it and attach it to your bug report with a note stating the PRECISE
binary download that you used.
-------------------------------------------------------------------------

Please DON'T see this message as an effort to get rid of you. An
"Illegal operation" error can be almost anything wrong with the C code:
we need lots more information to locate the error. Expect lots more
questions as we work with you.

Also expect some delays; the annual Tcl/Tk conference starts in just
over a week, and most of the people that can help you will be in
Vancouver. (You have had the misfortune of catching us just before the
conference, and just as the finishing touches are being put on Tcl 8.4,
so there's not a lot of extra time for troubleshooting.)
--
73 de ke9tv/2, Kevin Kenny

Saverio Castellano

unread,
Sep 8, 2002, 11:17:14 AM9/8/02
to
Kevin Kenny <ken...@acm.org> wrote in message news:<3D7A13EB...@acm.org>...


Ok, I'll try to give you all informations you need.

At the moment I'm using the TCL binary version TCL8.4a2, the package
comes
with the following libraries: dde1.1, encoding, http1.0 and http2.3,
msgcat1.2,
opt0.4, reg1.0, tcltest2.0. I'm not using any other Tk extension like
blt or bwidgets.

I have also tried with other binary versions like the old TCL8.3.3 or
with
ActiveTcl 8.3.4.3.

I really don't think that it depends on the TCL version, I once also
used
the tcl version that comes with Cygwin and mktclapp.c to compile my
IRC client
with gcc like a normal C application for linux. But when I used the
program
under windows after a while I got the same "Illegal Operation" error.

To wrap my program I have used Freewrap, the Jan Nijtmans's wrap
program that is based on Tcl/Tk8.2.1 and the TCLProp ProWrap wrapper
tool. Needless to say,
with all of those wrapping tool the .exe gave me the "Illegal
Operation" error
after a while I had been using the program.


I have also tried with several Windows systems: Windows95 and 98,
Windows ME,
Windows XP and Windows2000. With all of them I got the same problem,
though
I noticed that under Windows 2000 I can run my program for a longer
time
before getting the Illegal Operation error and having to shut it down.
I guess this could be because Windows 2000 handles memory better than
the
others.

I have tried several time to take off bits from my program in order to
understand what causes it but the result is been at the most to delay
the
Illegal Op. What's strange is that there isn't a operation or an
action that I
do that always makes the program crash, it just does it after a while
you
have been using it. Because it's an IRC client that uses MDI for
dedicated
windows what I have noticed and I'm sure about is that the more
channels
you join and the more queries you open the sooner the program will
crash.
It doesn't even matter if after you join some channels you then close
them,
the program will still start running abit slower and the crash...this
made
me thing that under Windows when you create and then destroy a widget
the
memorey used by the widget doesn't get freed...

If you really want to help me (and I'll appraciated it) the best thing
to
see and maybe understand the problem is to try out the program (I can
garantee
that you will get a Illegal Operation all you have to do is join a few
channels
or open some queries). The program is downloadable from
http://sourceforge.net/projects/savirc or http://www.savirc.com

I have also experienced this with very fast computers, also with a
1700Mhz pentium with 512mb of memory..the only difference is that I
got the Illegal Operation a little bit later then i normally get it.

Thanx

Gerald W. Lester

unread,
Sep 8, 2002, 12:48:00 PM9/8/02
to
Saverio Castellano wrote:
Kevin Kenny <ken...@acm.org> wrote in message news:<3D7A13EB...@acm.org>...
> Saverio Castellano wrote:
>
>  > Yes, I get a "Dr. Watson" error like "Your application has performed an
>  >  illegal operation and will be shutdown" message.
>...
> Please DON'T see this message as an effort to get rid of you.  An
> "Illegal operation" error can be almost anything wrong with the C code:
> we need lots more information to locate the error. Expect lots more
> questions as we work with you.
>
> Also expect some delays; the annual Tcl/Tk conference starts in just
> over a week, and most of the people that can help you will be in
> Vancouver. (You have had the misfortune of catching us just before the
> conference, and just as the finishing touches are being put on Tcl 8.4,
> so there's not a lot of extra time for troubleshooting.)

Ok, I'll try to give you all informations you need.

...

To wrap my program I have used Freewrap, the Jan Nijtmans's wrap
program that is based on Tcl/Tk8.2.1 and the TCLProp ProWrap wrapper
tool. Needless to say,
with all of those wrapping tool the .exe gave me the "Illegal
Operation" error
after a while I had been using the program.

...

I have also experienced this with very fast computers, also with a
1700Mhz pentium with 512mb of memory..the only difference is that I
got the Illegal Operation a little bit later then i normally get it.

A couple of questions:

Does it happen when you don't wrap but just run the scripts via wish or tclsh?

Try monitoring the memory use of the program with the Task Manager to see if it using a *lot* of memory.  Please post its starting and ending memory usage.

--
+--------------------------------+---------------------------------------+
| Gerald W. Lester               | "The man who fights for his ideals is |
| Gerald...@cox.net          |  the man who is alive." -- Cervantes  |
+--------------------------------+---------------------------------------+
 

David Gravereaux

unread,
Sep 8, 2002, 8:47:40 PM9/8/02
to
save...@tiscali.it (Saverio Castellano) wrote:

>If you really want to help me (and I'll appraciated it) the best thing
>to
>see and maybe understand the problem is to try out the program (I can
>garantee
>that you will get a Illegal Operation all you have to do is join a few
>channels
>or open some queries). The program is downloadable from
>http://sourceforge.net/projects/savirc or http://www.savirc.com


Hi Saverio,

I tried it out in VC++ with a symbols 8.4b3 but no luck getting it crash. I had
about 6 channels open and a couple queries for a few hours. No custom scripts
or anything.

Adding a server in the config dialog can fall into an endless loop on an error
message, though. Somehow related to the network combobox, I think.

invalid command name "tkTabToWindow"
invalid command name "tkTabToWindow"
while executing
"tkTabToWindow [::combobox::convert .newsvr.svr.f.f.enet -W].entry"
(command bound to event)

Saverio Castellano

unread,
Sep 9, 2002, 3:05:37 PM9/9/02
to
David Gravereaux <davy...@pobox.com> wrote in message news:<upqnnucjtoe4oneh7...@4ax.com>...

> save...@tiscali.it (Saverio Castellano) wrote:
>
> >If you really want to help me (and I'll appraciated it) the best thing
> >to
> >see and maybe understand the problem is to try out the program (I can
> >garantee
> >that you will get a Illegal Operation all you have to do is join a few
> >channels
> >or open some queries). The program is downloadable from
> >http://sourceforge.net/projects/savirc or http://www.savirc.com
>
>
> Hi Saverio,
>
> I tried it out in VC++ with a symbols 8.4b3 but no luck getting it crash. I had
> about 6 channels open and a couple queries for a few hours. No custom scripts
> or anything.
>
> Adding a server in the config dialog can fall into an endless loop on an error
> message, though. Somehow related to the network combobox, I think.
>
> invalid command name "tkTabToWindow"
> invalid command name "tkTabToWindow"
> while executing
> "tkTabToWindow [::combobox::convert .newsvr.svr.f.f.enet -W].entry"
> (command bound to event)


Thanx to David Gravereaux for his reply.

In reply to Gerald W. Lester:
I have been monitoring the program's memory usage.
When I start it it uses 5900K, while it is running the memory usage
increases and can get to >9000K if I join many channels.

David Gravereaux

unread,
Sep 9, 2002, 5:44:54 PM9/9/02
to
save...@tiscali.it (Saverio Castellano) wrote:


Saverio,

I did find a small problem in snack. During Tcl_Exit(), Snack_Mulaw2Lin()
causes a memory block to be overshot and is caught by the debugger. As for the
"illegal instruction" issue, I'm not getting it here, at all.

I hate these types of bugs :)

David Gravereaux

unread,
Sep 9, 2002, 5:46:38 PM9/9/02
to
"Gerald W. Lester" <gerald...@cox.net> wrote:

>Does it happen when you don't wrap but just run the scripts via wish or tclsh?

I'm not getting it when unwrapped. I haven't tried it wrapped, yet.

Saverio Castellano

unread,
Sep 10, 2002, 7:33:24 AM9/10/02
to
David Gravereaux <davy...@pobox.com> wrote in message news:<fu4qnukmnc9it0el8...@4ax.com>...


To David Gravereaux:
Ok, I understood that thing about snack, but I don't think it has
anything to
do with the real problem causing Illegal Operation while the program
runs, I have also tried many times without using snack.
So you can run savIRC without ever getting an Illegal Operation ?
Have you tried joining many channels or being on IRC for a while ?
What Windows version and PC do you have ?

Thanx for the help

David Gravereaux

unread,
Sep 10, 2002, 9:21:01 AM9/10/02
to
save...@tiscali.it (Saverio Castellano) wrote:

>Ok, I understood that thing about snack, but I don't think it has
>anything to
>do with the real problem causing Illegal Operation while the program
>runs, I have also tried many times without using snack.
>So you can run savIRC without ever getting an Illegal Operation ?

Yes.

>Have you tried joining many channels or being on IRC for a while ?

Overnight on 6 channels or so.

>What Windows version and PC do you have ?

Win2k-sp3. The hardware shouldn't matter but it's a dual p3 supermicro m/b.

David Gravereaux

unread,
Sep 10, 2002, 6:56:38 PM9/10/02
to
David Gravereaux <davy...@pobox.com> wrote:

>>So you can run savIRC without ever getting an Illegal Operation ?
>
>Yes.

I did run it outside the wrapper, though. I changed savirc.exe to savirc.zip
and pulled-out all the scripts and ran it with a wish done for symbols and in
the VC++ debugger.

Unfortunately, I hope I'm not bypassing the "illegal instruction" bug by doing
this. I have it running from the wrapper right now, and still no errors for me,
yet.

<blatent_self_advertising>

I'm in the midst of writing an IRC extension for Tcl, if you want to glance it
over. It's a xircon work-alike, but minus a UI. Basically everything unseen
and handles the duties of sockets, parsing, user scripts, and default behavior.
It's working, but only about half done. I want to add java, python, and perl
for user scripts, too, and i'm having a bear of a time :)

I have a rough alpha @
http://prdownloads.sourceforge.net/tomasoft/tmhwk_a4.zip?download

The GUI is good enough to use for testing the extension (all channels just
lumped to one status window). The commandbox isn't functional and all commands
are entered from wish's console like:

% $a raw "privmsg #somechan :hi there!"
% $a raw "join #xircon"

Where $a is the connection object. I could use some help planning the UI
command API. I'm rather distracted trying to fit java into the user scripting
parts.

The irc_engine extension is extremely OS neutral and a friend is working with it
on MacOSX, but hasn't given me his makefile yet. Under testing, the parser
clocks at around 18k lines/sec, but being new code, socks5, ircsec and most all
"icing" features are still missing.

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tomasoft/tomahawk/irc_engine/generic/

</blatent_self_advertising>

Reply all
Reply to author
Forward
0 new messages