Re: [Monotone-devel] problem with tester on WIN32 MinGW

2007-08-30 Thread Stephen Leake
Jack Lloyd [EMAIL PROTECTED] writes:

 On Wed, Aug 29, 2007 at 06:21:55AM -0400, Stephen Leake wrote:
 I'm not very familiar with C++ debugging. I'm using gdb from the
 AdaCore distribution (there isn't one in the MinGW distribution); it
 understands C++, but break exception isn't a recognized command (it
 is for Ada :).

 Try 'catch throw' and 'catch catch'. You may need the workaround
 described in http://www.cygwin.com/ml/gdb/2004-11/msg00192.html (I did
 for gdb 6.3).

Those commands are present.

However, they don't help:

(gdb) catch throw
Catchpoint 1 (throw)
(gdb) catch catch
Catchpoint 2 (catch)
(gdb) run -r  c:/Gnu/monotone/tester-testsuite.lua 
c:/Gnu/monotone-build_mingw/tester_dir cleanup-1
Starting program: c:\Gnu\monotone-build_mingw/tester.exe -r  
c:/Gnu/monotone/tester-testsuite.lua c:/Gnu/monotone-build_mingw/tester_dir 
cleanup-1

Program exited with code 0174.
(gdb)

Hmm. The top-level exception handler in this case seems to be in
tester.cc test_invoker::operator(). I can set a breakpoint in the
catch clause, and it triggers. So apparently my version of gdb doesn't
properly implement 'catch throw'.

I have gdb 6.4 for mingw:
GNU gdb 6.4 for GNAT Pro 6.0.2 (20070703)
This GDB was configured as i586-pc-mingw32...

So I added an error message in the exception handler:

  catch (std::exception  e)
{
  E(false, F(error running test %s: %s) % testname % e.what());
  retcode = 124;

It reports:

[EMAIL PROTECTED] ./tester.exe -r  c:/Gnu/monotone/tester-testsuite.lua 
c:/Gnu/monotone-build_mingw/tester_dir cleanup-1
error: error running test cleanup-1: lua error: [string testlib.lua]:1054: 
bad argument #-1 to 'posix_umask' (number expected, got nil)

That appears to be from testlib.lua, line 1054, which is in run_one_test:

  local oldmask = posix_umask(0)
  posix_umask(oldmask)

it's the second call to posix_umask that's dying, so apparently the
first call is returning nil.

posix_umask is defined in tester.cc; it can return nil. I suspect it
should return 0 instead; I've changed it to that locally; that lets
tests run.

Should I commit that change in tester.cc posix_umask, or is there a
better solution? I think 'umask' isn't meaningful on Win32.

--
-- Stephe



___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel


Re: [Monotone-devel] problem with tester on WIN32 MinGW

2007-08-30 Thread Zack Weinberg
On 8/30/07, Stephen Leake [EMAIL PROTECTED] wrote:
[...]
 So I added an error message in the exception handler:

   catch (std::exception  e)
 {
   E(false, F(error running test %s: %s) % testname % e.what());
   retcode = 124;

 It reports:

 [EMAIL PROTECTED] ./tester.exe -r  c:/Gnu/monotone/tester-testsuite.lua 
 c:/Gnu/monotone-build_mingw/tester_dir cleanup-1
 error: error running test cleanup-1: lua error: [string testlib.lua]:1054: 
 bad argument #-1 to 'posix_umask' (number expected, got nil)

 That appears to be from testlib.lua, line 1054, which is in run_one_test:

   local oldmask = posix_umask(0)
   posix_umask(oldmask)

 it's the second call to posix_umask that's dying, so apparently the
 first call is returning nil.

 posix_umask is defined in tester.cc; it can return nil. I suspect it
 should return 0 instead; I've changed it to that locally; that lets
 tests run.

 Should I commit that change in tester.cc posix_umask, or is there a
 better solution? I think 'umask' isn't meaningful on Win32.

Yes, please commit the change to posix_umask. It is indeed not
meaningful on Win32, and it is supposed to be a no-op there, so we
don't have to have #ifdefs in the higher layers.

It'd be nice if you could commit the more detailed error message change too.

zw


___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel


Re: [Monotone-devel] problem with tester on WIN32 MinGW

2007-08-30 Thread Stephen Leake
Zack Weinberg [EMAIL PROTECTED] writes:

 On 8/30/07, Stephen Leake [EMAIL PROTECTED] wrote:

 Should I commit that change in tester.cc posix_umask, or is there a
 better solution? I think 'umask' isn't meaningful on Win32.

 Yes, please commit the change to posix_umask. It is indeed not
 meaningful on Win32, and it is supposed to be a no-op there, so we
 don't have to have #ifdefs in the higher layers.

 It'd be nice if you could commit the more detailed error message change too.


Ok, done.

-- 
-- Stephe



___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel


Re: [Monotone-devel] problem with tester on WIN32 MinGW

2007-08-29 Thread Stephen Leake
Stephen Leake [EMAIL PROTECTED] writes:

 I tried to fix the compilation errors in tester on WIN32; see
 824a6c7947919ec2a96e41c3e8862712651e44be

 But it's still broken; running `run_lua_tests' gives:

   1 (imp)_deleting_directoriesFAIL (unhandled exception 
 in child process)

 and the same error for all 454 tests.

 Same error if I run a single test:

 [EMAIL PROTECTED] ./run_lua_tests 1
 Running tests...
   1 (imp)_deleting_directoriesFAIL (unhandled exception 
 in child process)

 Any suggestions?

 I can run this under the debugger; I haven't tried that yet.

I've tried this; I can get into the Lua interpreter, but I don't see
what exception is being raised. Is there a way to break on any
exception? 

I'm not very familiar with C++ debugging. I'm using gdb from the
AdaCore distribution (there isn't one in the MinGW distribution); it
understands C++, but break exception isn't a recognized command (it
is for Ada :).

When I run:

tester.exe -r  c:/Gnu/monotone/tester-testsuite.lua 
c:/Gnu/monotone-build_mingw/tester_dir cleanup-1

it exits with code 0174.

There is a -d option to tester.exe, but it doesn't work with -r, and
doesn't add any info otherwise:

./tester.exe -d c:/Gnu/monotone/tester-testsuite.lua cleanup-1
Running tests...
  1 cleanup-1 FAIL (unhandled exception in 
child process)

Of 1 tests run:
0 succeeded
1 failed
0 had expected failures
0 succeeded unexpectedly
0 were skipped

Is there a Lua hook or environment variable I can set to get more
debug info printed out?

-- 
-- Stephe



___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel


Re: [Monotone-devel] problem with tester on WIN32 MinGW

2007-08-29 Thread Jack Lloyd
On Wed, Aug 29, 2007 at 06:21:55AM -0400, Stephen Leake wrote:
 I'm not very familiar with C++ debugging. I'm using gdb from the
 AdaCore distribution (there isn't one in the MinGW distribution); it
 understands C++, but break exception isn't a recognized command (it
 is for Ada :).

Try 'catch throw' and 'catch catch'. You may need the workaround
described in http://www.cygwin.com/ml/gdb/2004-11/msg00192.html (I did
for gdb 6.3).

Jack


___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel