discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OpenBSD hangs / crashes with Suduku


From: Riccardo Mottola
Subject: Re: OpenBSD hangs / crashes with Suduku
Date: Wed, 22 Jun 2011 23:49:13 +0200
User-agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.15) Gecko/20101113 SeaMonkey/2.0.10

Hi,

indeed. Just to be sure, I used a platform where SUdoku and put a breakpoint. I confirm that the exception is always thrown. Terrible code, I have the urge to rewrite it properly... it looks like roughly like tail-recursion.

In any case it is no excuse for exceptions not working on openbsd :)

Riccardo

Fred Kiefer wrote:
As Sebastian already pointed out not the exception is the problem here, but the way we currently implement it.

The exception itself is part of the algorithm of that application. It's a sort of structured long jump, when a solution is found somewhere deep down in the recursion it jumps back to the top of the stack. Not a very nice way to do this, but at least it pretends not to be a goto :-)

On 22.06.2011 11:04, Riccardo Mottola wrote:
Hi,

I am able to reproduce the problems Sebastian has on my own OpenBSD/x86
box. I get this problem only on OpenBSD. I use gcc and its standard
runtime. The same combination appears to work fine on NetBSD or Linux.

The problem happens with "New" inside Sudoku (latest version from CVS of
GAP).

The happening is:

1) Sudoku is run normally (not in GDB). Sudokup.apps remains eternally
at 99% of CPU usage and hangs
2) If run inside GDB, I get the same broken crash of Sebastian:
#0 0x0d8ea287 in NSCountFrames () at NSDebug.m:1009
#1 0x0d8edf19 in GSPrivateStackAddresses () at NSDebug.m:1112
#2 0x0d902f5f in -[GSStackTrace init] (self=0x7d17a2e8, _cmd=0x2d8e89e8)
at NSException.m:605
#3 0x0d951942 in +[NSObject new] (self=0x2d8cfac0, _cmd=0x2d8cfb40)
at NSObject.m:1281
#4 0x0d90387c in -[NSException raise] (self=0x7d17a168, _cmd=0x2d8cfba8)
at NSException.m:960
#5 0x0d902e04 in +[NSException raise:format:arguments:] (self=0x2d8cf9c0,
_cmd=0x2d8cfb90, name=0x3c00615c, format=0x3c006150,
argList=0xcfbf0a80 "ðR÷\213h¾O'\027\003") at NSException.m:849
#6 0x0d903cf3 in +[NSException raise:format:] (self=0x2d8cf9c0,
_cmd=0x3c0060f8, name=0x3c00615c, format=0x3c006150) at NSException.m:835
#7 0x1c0070ad in -[Sudoku doFind:] (self=0x7e509008, _cmd=0x3c0060d8,
seen=0x87e36fc8) at Sudoku.m:457
#8 0x1c006fbe in -[Sudoku doFind:] (self=0x7e509008, _cmd=0x3c0060d8,
seen=0x87e36fc8) at Sudoku.m:524
#9 0x1c006fbe in -[Sudoku doFind:] (self=0x7e509008, _cmd=0x3c0060d8,
seen=0x87e36fc8) at Sudoku.m:524
#10 0x1c006fbe in -[Sudoku doFind:] (self=0x7e509008, _cmd=0x3c0060d8,
seen=0x87e36fc8) at Sudoku.m:524
#11 0x1c006fbe in -[Sudoku doFind:] (self=0x7e509008, _cmd=0x3c0060d8,
seen=0x87e36fc8) at Sudoku.m:524


I can also put a breakpoint in NSException raise and get the similar
output:

#0 -[NSException raise] (self=0x7c139488, _cmd=0x2835eba8)
at NSException.m:956
#1 0x08391e04 in +[NSException raise:format:arguments:] (self=0x2835e9c0,
_cmd=0x2835eb90, name=0x3c006174, format=0x3c006168,
argList=0xcfbf01f0 "0÷\234\201h®\210&\027\003") at NSException.m:849
#2 0x08392cf3 in +[NSException raise:format:] (self=0x2835e9c0,
_cmd=0x3c0060f8, name=0x3c006174, format=0x3c006168) at NSException.m:835
#3 0x1c006f80 in -[Sudoku doFind:] (self=0x84f0a008, _cmd=0x3c0060d8,
seen=0x87651648) at Sudoku.m:452
#4 0x1c006fbe in -[Sudoku doFind:] (self=0x84f0a008, _cmd=0x3c0060d8,
seen=0x87651648) at Sudoku.m:524
#5 0x1c006fbe in -[Sudoku doFind:] (self=0x84f0a008, _cmd=0x3c0060d8,
seen=0x87651648) at Sudoku.m:524
#6 0x1c006fbe in -[Sudoku doFind:] (self=0x84f0a008, _cmd=0x3c0060d8,
seen=0x87651648) at Sudoku.m:524
#7 0x1c006fbe in -[Sudoku doFind:] (self=0x84f0a008, _cmd=0x3c0060d8,
seen=0x87651648) at Sudoku.m:524
#8 0x1c006fbe in -[Sudoku doFind:] (self=0x84f0a008, _cmd=0x3c0060d8,
seen=0x87651648) at Sudoku.m:524
#9 0x1c006fbe in -[Sudoku doFind:] (self=0x84f0a008, _cmd=0x3c0060d8,
seen=0x87651648) at Sudoku.m:524
#10 0x1c006fbe in -[Sudoku doFind:] (self=0x84f0a008, _cmd=0x3c0060d8,
seen=0x87651648) at Sudoku.m:524

the exception is raised from line 452;
[NSException raise:EX_COMPLETE format:EX_COMPLETE_FMT];

line 524:
[self doFind:seen];

(which means indeed recursion)


Seen as this it looks like a code problem, but if it happens only on
OpenBSD I think of some kind of corruption. "placed" gets initialized
before...

Thanks,
Riccardo


and seq is an object instance variable, which makes me think of
corruption in the object.


_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnustep




reply via email to

[Prev in Thread] Current Thread [Next in Thread]