PR# 12606 Stepping with Auto Expressions in sample graphical app causes crash

Problem Report Summary
Submitter: prestoat2000
Category: Debugger
Priority: Medium
Date: 2007/05/06
Class: Bug
Severity: Serious
Number: 12606
Release: 6.0.68140
Confidential: No
Status: Closed
Responsible: jfiat_es
Environment: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.8.1.2) Gecko/20070225 Firefox/2.0.0.2 Solaris 10 on x86
Synopsis: Stepping with Auto Expressions in sample graphical app causes crash

Description
Compile sample graphical application.
Click on Step into Routine.
In Watch tab, turn on Auto Expressions.
Do "Step into Routine" about 360 times.
When execution reached {EV_NOTIFY_ACTION_SEQUENCE}.auto_resize and
   instruction `lower := new_lower' within that routine, estudio
   crashes with no exception trace.
To Reproduce

										
Problem Report Interactions
From:jfiat_es    Date:2007/11/13    Status: Closed    Download   
I think it is now fixed by rev#71125.
The previous fix did break another part of the debugger.
Now rev#71125 handles both cases.

I hope this definitively fixes the crashes you are experiencing.

From:prestoat2000    Date:2007/07/30    Status: Analyzed    Download   
Still crashes when repeatedly doing Step into Routine on sample
graphical application on Solaris SPARC in rev 69618.
Reopening report.

From:jfiat_es    Date:2007/07/19    Status: Closed    Download   
This is now fixed by revision rev#69556


From:prestoat2000    Date:2007/06/16    Download   
I ran estudio from within a workbench estudio, opened the sample graphical
application and did repeated Step into Routine operations with Auto Expressions
turned on.  There were several "Compiler error" exceptions while evaluating
auto expressions, which I believe is normal when an expression cannot be
evaluated.  However, there was also a precondition violation when trying to 
evaluate the auto expression `l_item' in {EV_NOTIFY_ACTION_SEQUENCE}.has.
The precondition with tag `a_context_class_valid' of
{FORMAL_A}.is_multi_constrained was violated.  The first part of the
precondition was `a_context_class.is_generic', which was False because
`a_context_class.generics' was Void.

I have attached the stack trace when the precondition violation occurred.
I suspect this may be the cause of the one known remaining crash when 
stepping with Auto Expressions on (at least, the only one I know about).

If it isn't obvious what the problem is and you need to investigate further,
you can reproduce the prob
....
Output truncated, Click download to get the full message

Attachment: stack86.txt     Size:2013
From:prestoat2000    Date:2007/06/15    Download   
This still causes a crash after Step Into Routine about 275 times with
Auto Expressions turned on, using sample graphical application (with
precompiled vision2).  This is on Solaris x86.

Crash is when it is in {EV_NOTIFY_ACTION_SEQUENCE}.has.

From:prestoat2000    Date:2007/06/15    Download   
Never mind.  I think I figured out that I have to copy EV_APPLICATION_IMP
from SVN and then redo the precompile.  After I did that compiling
escln_graphical worked.  I'm building the whole thing from scratch now and
will test once it completes in an hour or so.

From:prestoat2000    Date:2007/06/15    Download   
No, I'm having trouble.  The build is failing on escln_graphical with

"/home/dave/build/EIFGENs/escln_graphical/F_code/C6/ev589.x", line 30: undefined  symbol: debug_mode
"/home/dave/build/EIFGENs/escln_graphical/F_code/C6/ev589.x", line 164: undefined symbol: debug_mode

Ev589.x is for class EV_APPLICATION_IMP.

I copied $EIFFEL_SRC/C/run-time/*.h into $ISE_EIFFEL/studio/spec/solaris-x86/include.
Also copied $EIFFEL_SRC/C/*.a (and *.so) into $ISE_EIFFEL/studio/spec/solaris-x86/lib.

But it didn't help.  Is there something else I'm supposed to do to get this
to compile?

From:jfiat_es    Date:2007/06/15    Download   
Are you able to build ec after revision rev#69074 ?
(make sure to use the compiled run-time, and also the eif_main.h in the include)

From:prestoat2000    Date:2007/06/14    Download   
The simpler example included with this report (doing Step Into all the way 
through the following routine with Auto Expressions turned on) seems to be
fixed in rev 69072:

        make is
                local
                        a: ARRAY [STRING]
                do
                        create a.make (1, 2)
                        a.force ("weasel", 3)
                end

I cannot test doing Step Into through the sample graphical application to see if
that is also fixed because of the following link error:

 ld: fatal: symbol `set_debug_mode' is multiply-defined:
        (file /home/dave/eiffel/Eiffel6.0.69072/library/vision2/spec/solaris-x86/lib/gtk_eiffel.o type=FUNC; file /home/dave/eiffel/Eiffel6.0.69072/studio/spec/solaris-x86/lib/libwkbench.a(wmain.o) type=FUNC);

Perhaps I have built something incorrectly.

From:prestoat2000    Date:2007/06/03    Download   
Here is one more small example which I think is representative of the
crash in the sample graphical application with Auto Expressions turned on.
May be the same root cause as the previously submitted small example.

To reproduce:

Freeze with attached class new_test.e (class TEST) and previously submitted
   .ecf file (no precompilation).
Click on Step into Routine.
Turn on Auto Expressions.
Click on Step into Routine 30 times.
Estudio crashes with no trace.

Attachment: new_test.e     Size:138
From:prestoat2000    Date:2007/06/03    Download   
I have reproduced a crash with auto expressions on a very small example.
You should fix this bug first and then we'll see if there are any remaining
problems with auto expressions.

To reproduce crash with Auto Expressions on a very small example:

Freeze with attached class TEST and .ecf file (has no precompile).
Click on Step into Routine.
Turn on Auto Expressions.
Click on Step into Routine 16 times.
Estudio crashes with no trace.

Attachment: test.e     Size:113
Attachment: test.ecf     Size:1466
From:jfiat_es    Date:2007/05/31    Download   
The evaluation of static external on precompiled classes is now fixed by revision rev#68779. (This need to recompile the runtime, and link the ec and the compiled applications with the runtime libraries)

We still need to reproduce and fix the last part (point .2) about the crash in {EV_NOTIFY_ACTION_SEQUENCE}.auto_resize when auto expression is enabled.

From:jfiat_es    Date:2007/05/30    Download   
Indeed, this commit didn't fixed the issue and we realized that.
That's why we didn't close this bug report.
It should be safely fixed soon, after we complete tests on this part.

From:prestoat2000    Date:2007/05/30    Download   
SVN commit log says:

r68756 | jfiat | 2007-05-30 07:22:31 -0700 (Wed, 30 May 2007) | 2 lines

Fixed evaluation of static call on external contained in a precompilation library.
Fixed part (5).2 of bug#12606: Stepping with Auto Expressions in sample graphical app causes crash

However, I tested this with rev 68773 and the watch expression
{EV_GTK_EXTERNALS}.gtk_min_ver still gives an error for the sample graphical
application, which uses precompiled vision2.  So I don't think this part has
really been fixed.


From:prestoat2000    Date:2007/05/28    Download   
I have now determined that there seem to be two problems.  

1. If I compile the
sample graphical application using the generated my_vision2_application_1.ecf
configuration file (which includes precompile for vision2), trying to evaluate
the expression {EV_GTK_EXTERNALS}.gtk_min_ver or {EV_GTK_EXTERNALS}.gtk_set_locale
fails with an exception.  But if I change the configuration file to remove
the precompile and freeze, then these watch expressions evaluate correctly 
without any problem.  So there seems to be a problem with evaluating
static external calls when the called routines are in a precompiled library.

2. If I compile the sample graphical application without a precompile, then
   static external expressions are evaluated correctly, whether via auto
   expressions or via a manually entered watch expression.  However, the
   crash originally reported then occurs if auto expressions are turned on
   (crash after about 360 Step Into operations, in 
   {EV_NOTIFY_ACTION_SEQUENCE}.auto_resi
....
Output truncated, Click download to get the full message

From:prestoat2000    Date:2007/05/23    Download   
I tried manually evaluating the auto expression that seems to be causing
the crash ({EV_GTK_EXTERNALS}.gtk_set_locale) by adding it to Watch tab.
t didn't crash estudio, but the evaluation of this expression failed with the
attached trace (seen by double-clicking on the Value column in the Watch tab).



Attachment: stack39.txt     Size:1006
From:prestoat2000    Date:2007/05/23    Download   
Compiling sample graphical application, clicking Step into Routine, turning
on Auto Expressions in the Watch tab and then clicking Step into Routine
about a dozen more times crashes estudio on rev 68604 (just built it from
scratch this morning).  Platform is Solaris 10 on x86.  If I don't turn on
auto expressions, I can step into {EV_GTK_EXTERNALS}.gtk_set_locale
(the line that causes the problem when auto expressions are on) and everything
works fine.

When it crashes, I just get the usual "net_send: setjmp /= 0".

From:jfiat_es    Date:2007/05/23    Download   
We fixed a few parts related to static call and also external call, on my development version it seems to work fine.
Is it still occuring with latest release 6.0.6.8510 (patched regarding the FUNCTION class file, and ecdbgd executable)  ?

Can you try to step into, and evaluate expression the "{EV_GTK_EXTERNALS}.gtk_set_locale"
Is it also crashing the debugger ?

From:prestoat2000    Date:2007/05/22    Download   
Compiling sample graphical application, clicking Step into Routine, turning
on Auto Expressions in Watch tab and clicking 11 more times now crashes
estudio.  The line where it crashes is in {EV_APPLICATION_IMP}.make:

   create locale_str.make_from_c ({EV_GTK_EXTERNALS}.gtk_set_locale)

Perhaps the call to te external is the problem.  This seems like a critical bug
since otherwise auto expressions cannot safely be used.