1. EXW crash

Rob,
Sometimes, exw.exe crashes because of programmers error, like invalid pointer
etc.
This window is shown :

Application Error: C:\EUPHORIA\BIN\EXW.EXE  [X]
-----------------------------------------------
The instruction at xxxxxxxx referenced memory at ffffffff.
The memory could not be read from.

Click OK to terminate the application.

                                           [OK]

The error message is not from Windows, but from some C runtime libraries
linked in EXW.EXE. Do you think it would be possible for exw to add its own
handler
for this and show where the crash happened and do some cleanup?

    Martin

new topic     » topic index » view message » categorize

2. Re: EXW crash

Martin Stachon writes:
> Sometimes, exw.exe crashes because of programmers error, 
> like invalid pointer etc.
> This window is shown :
>
> Application Error: C:\EUPHORIA\BIN\EXW.EXE  [X]
> -----------------------------------------------
> The instruction at xxxxxxxx referenced memory at ffffffff.
> The memory could not be read from.
>
> Click OK to terminate the application.
>
>                                           [OK]
>
> The error message is not from Windows, but from some 
> C runtime libraries linked in EXW.EXE. Do you think it would 
> be possible for exw to add its own handler for this and show 
> where the crash happened and do some cleanup?

Excellent idea! I should have tried this long ago. Somehow
I thought it wasn't possible. I set up an exception handler
under Watcom/DOS a long time ago, and it didn't work at all,
but I never tried it with Windows. I think it will probably work 
with Linux and FreeBSD too. 

As a test, I just added a handler for both segmentation violation
and illegal instruction to exw, and it worked. I got a nice 
Euphoria traceback pointing to:  poke(0, 999), where 
before I would have seen a useless message like the one
you show above. When I think of all the hours people have
spent debugging these sorts of errors ...  Yikes!

(2.4 alpha-test should be available in a few weeks.)

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

3. Re: EXW crash

On Sat, Dec 21, 2002 at 06:38:06PM -0500, Robert Craig wrote:

> Excellent idea! I should have tried this long ago. Somehow
> I thought it wasn't possible. I set up an exception handler
> under Watcom/DOS a long time ago, and it didn't work at all,
> but I never tried it with Windows. I think it will probably work 
> with Linux and FreeBSD too. 

Right.

signal(SIGILL, <signal handler>);
signal(SIGSEGV, <signal handler>);

for my version of Linux:

SIGILL == 4
SIGSEGV == 11

I've said this more for reference for other *nix programmers in EUforum
(as RobC undoubtably already knows this).

> 
> Regards,
>    Rob Craig
>    Rapid Deployment Software
>    http://www.RapidEuphoria.com
> 
> 
> 






jbrown

new topic     » goto parent     » topic index » view message » categorize

4. Re: EXW crash

Andy Serpa writes:
> Most errors I get involving .dlls cause a pop-up "EXW.EXE 
> has caused an error in such-and-such."  Not sure it ever
> makes its way back to the interpreter.  Any chance of 
> catching those?  They can be very hard to pin down...

It looks like that case will work too.
To test this, I inserted a bug into a .dll (written in Euphoria,
translated to C). When the crash occurred, I got a normal 
Euphoria traceback and ex.err dump, pointing at the c_func() 
line in the main program where the .dll routine is called.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

5. Re: EXW crash

On Sat, Dec 21, 2002 at 09:00:18PM -0500, jbrown1050 at hotpop.com wrote:
> 
> On Sat, Dec 21, 2002 at 06:38:06PM -0500, Robert Craig wrote:
> 
> > Excellent idea! I should have tried this long ago. Somehow
> > I thought it wasn't possible. I set up an exception handler
> > under Watcom/DOS a long time ago, and it didn't work at all,
> > but I never tried it with Windows. I think it will probably work 
> > with Linux and FreeBSD too. 
> 
> Right.
> 
> signal(SIGILL, <signal handler>);
> signal(SIGSEGV, <signal handler>);
> 
> for my version of Linux:
> 
> SIGILL == 4
> SIGSEGV == 11
> 
> I've said this more for reference for other *nix programmers in EUforum
> (as RobC undoubtably already knows this).

Rob, not sure if you knew this.

signal(SIGINT, <check_break handler>);

This can be used to emulate allocate_break()/check_break() for exu.

I wrote a lib for this once, I'll post it to this list
if i can find it.

jbrown

> 
> > 
> > Regards,
> >    Rob Craig
> >    Rapid Deployment Software
> >    http://www.RapidEuphoria.com
> > 
> > 
> jbrown
> 
> 
>

new topic     » goto parent     » topic index » view message » categorize

6. EXW crash

I'm getting a fairly consistent crash (EXW caused an invalid page 
fault in module KERNEL32.DLL at 0167:bff71459) under the following 
circumstances:

The application is a Japanese - English dictionary.

euGrid is used to display the data, of either the entire dictionary 
database or the results of a search.

As I scroll down through the list, on each row change the Japanese 
characters from one or two fields are written above the grid, using a 
16 x 16 bitmap font. I use repaintWindow to erase the previous 
character bitmaps (I can't just write over them, as there might be 
fewer characters than previous)

After scrolling through several dozen rows, thus having painted 
perhaps a few hundred bitmaps, the crash occurs.

A screensave of the application is here - 
http://www.welchaviation.org/carnarvon/euphoria/screensave.bmp
(over a megabyte).

The code to draw the characters is:

-- On any change, re-write the japanese text above the grid

-- See if the row has changed
cell_data = EGW_GetCurrentCell(self)
row = cell_data[ROW]
column = cell_data[COLUMN]
if row != old_row and row != -1 then
	-- changed focus to new row, re-write japanese text
	row_buffer = EGW_GetDataRow (self, row)
	if length(row_buffer[KANJI]) = 0 then
		to_write = row_buffer[KANA]
	else
		to_write = row_buffer[KANJI]
		& BJQ & row_buffer[KANA] & EJQ
	end if
		
	repaintWindow( Window2 )
	x = 1
	y = 1
	for i = 1 to length(to_write) by 2 do
		char_to_write = to_write[i] & to_write[i+1]
		makebitmap(char_to_write) -- expands the font data
		drawBitmap( Window2, hBitmap, x,y)
		x  += 16
	end for
	
	old_row = cell_data[ROW]
end if -- row had changed, so write Japanese chars above grid


I guess it's a resource problem, with memory being chewed up and not 
freed. I've looked in the archives, and see a few posts that touch on 
the issue, but none that directly seem to solve this problem.

Appreciate any advice.

Thanks,

-- 
Craig

new topic     » goto parent     » topic index » view message » categorize

7. Re: EXW crash

On Sun, 26 Sep 2004 10:03:18 +1000, Craig Welch
<euphoria at welchaviation.org> wrote:

>I'm getting a fairly consistent crash (EXW caused an invalid page 
>fault in module KERNEL32.DLL at 0167:bff71459) under the following 
>circumstances:
Can I ask what version of windows and win32lib you are using?

Regards,
Pete

new topic     » goto parent     » topic index » view message » categorize

8. Re: EXW crash

Craig Welch wrote:

> I'm getting a fairly consistent crash (EXW caused an invalid page fault 
> in module KERNEL32.DLL at 0167:bff71459) under the following circumstances:

It seems to be fixed. I looked at 'resources' on the Win32Lib help 
page, and as a result added:

deleteObject (hBitmap)

after each

drawBitmap( Window2, hBitmap, x,y)

With hindsight it makes sense ...

My apologies if my first post has caused anyone to start pondering the 
issue.

-- 
Craig

new topic     » goto parent     » topic index » view message » categorize

9. Re: EXW crash

Pete Lomax wrote:

> Can I ask what version of windows and win32lib you are using?

Win98 and 0.60.4.

But unfortunately, my second post in which I mention that it's fixed, 
overlapped with your request for versions. Thanks all the same ...

-- 
Craig

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu