[M3devel] threading on Windows?

Mika Nystrom mika at async.caltech.edu
Sat Feb 12 02:57:15 CET 2011


Hello m3devel,

I'm attempting to test the CVS head as of Jay's latest checkins with
the thread tester.

I'm afraid there seems to be something wrong.

I get a seg fault when running a few threads that do the following:

PROCEDURE TApply(cl : Closure) : REFANY =
  BEGIN
    Thread.Pause(InitPause);
    LOOP
      TRY
        WITH now = Time.Now() DO
          times1[cl.id]:= FLOOR(now);
          IF now < 0.0d0 THEN RAISE X END
        END
      EXCEPT X => <*ASSERT FALSE*>
      END
    END
  END TApply;

The crash is as follows:

(gdb) run -tests tryexcept
Starting program: /home/mika/cm3-cvs/cm3/m3-libs/m3core/tests/thread/LINUXLIBC6/threadtest -tests tryexcept
[Thread debugging using libthread_db enabled]
Writing file...done
Creating tryexcept threads...done
running...printing oldest/median age/newest
.
Program received signal SIGSEGV, Segmentation fault.
0x0808cc0f in TimePosix__Now () at ../src/time/POSIX/TimePosixC.c:53
53      {
(gdb) where
#0  0x0808cc0f in TimePosix__Now () at ../src/time/POSIX/TimePosixC.c:53
#1  0x0808cb57 in Time__Now () at ../src/time/POSIX/TimePosix.m3:14
#2  0x0804b875 in Main__TApply (cl=<error reading variable>)
    at ../src/Main.m3:205
#3  0x08086c5e in ThreadPosix__RunThread ()
    at ../src/thread/POSIX/ThreadPosix.m3:993
#4  0x400c343b in makecontext () from /lib/libc.so.6
#5  0x00000000 in ?? ()
(gdb) 

Note I am using user threads since pthreads are known to be buggy at the
moment.

I would like to find one configuration (any configuration!!) that lets
me run a multithreaded program under AMD64_LINUX.  I don't care what
version of the compiler it is, whether the threads are user or pthreads,
how many things I have to hack.  Does anyone know what I need to do?

     Mika



More information about the M3devel mailing list