Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

[FIXED] [mac] bin/osx/bob hangs

Moderators: kris

Posted: 02/10/10 12:46:17 Modified: 02/16/10 12:49:10

Mac OS X 10.5.8 (Intel 32bit), DMD 1.051, LDC Trunk, Tango trunk.

Problem 1: bob hangs after calling ldc or dmd to compile first tango module. Compiler compiles successfully, and bob hangs after it.

(ldc/import:) ./build/bin/osx32/bob -c=ldc -r=ldc -p=osx -vu .
ldc -c -I./tango/core -I./tango/core/rt/compiler/ldc -I. -I./tango/core/vendor -release -oftango-core-Array-release.o ./tango/core/Array.d 
<ldc generates .o, bob hangs here>

Sampling bob from mac system monitor shows this:

Sampling process 31119 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling bob (pid 31119) every 1 millisecond
Call graph:
    2525 Thread_2507
      2525 0x23be
        2525 _d_interface_vtbl
          2525 D2rt8compiler3dmd2rt6dmain24mainUiPPaZi7tryExecMFDFZvZv
            2525 D2rt8compiler3dmd2rt6dmain24mainUiPPaZi6runAllMFZv
              2525 D2rt8compiler3dmd2rt6dmain24mainUiPPaZi7tryExecMFDFZvZv
                2525 D2rt8compiler3dmd2rt6dmain24mainUiPPaZi7runMainMFZv
                  2525 0x24fb
                    2525 D3bob6MacOSX3ldcMFZi
                      2525 D3bob10FileFilter7opApplyMFDFKC5tango2io8FilePath8FilePathZiZi
                        2525 D3bob6MacOSX3ldcMFZi15__foreachbody32MFKC5tango2io8FilePath8FilePathZi
                          2525 D3bob6MacOSX7compileMFC5tango2io8FilePath8FilePathAaZAa
                            2525 D3bob10FileFilter4execMFAAaHAaAaAaZv
                              2525 D5tango3sys7Process7Process7executeMFZC5tango3sys7Process7Process
                                2525 read
                                  2525 read

Total number in stack (recursive counted multiple, when >=5):

Sort by top of stack, same collapsed (when >= 5):
        read        2525
Sample analysis of process 31119 written to file /dev/stdout

Problem 2: bob.sh builds libtango.a fine, but on my mac, linking that lib fails (with dmd or ldc setup): dmd -c test.d and all compilation with dmd or ldc succeeds, but calling ld with linking tango fails with printing missing symbols from libtango.a (lots, maybe all):

(lots of missing symbols from all .o in libtango.a)

_D5tango4text6locale4Data11CultureData21getDataFromRegionNameFKAaZPS5tango4text6locale4Data11CultureData in libtango.a(tango.text.locale.Data.o)
  "_D6object9Exception5_ctorMFAaAalC9ExceptionZC9Exception", referenced from:
      _D5tango4core9Exception20OutOfMemoryException5_ctorMFAalZC5tango4core9Exception20OutOfMemoryException in libtango.a(tango.core.Exception.o)
      _D5tango4core9Exception15AssertException5_ctorMFAalZC5tango4core9Exception15AssertException in libtango.a(tango.core.Exception.o)
      _D5tango4core9Exception15AssertException5_ctorMFAaAalZC5tango4core9Exception15AssertException in libtango.a(tango.core.Exception.o)
      _D5tango4core9Exception20ArrayBoundsException5_ctorMFAalZC5tango4core9Exception20ArrayBoundsException in libtango.a(tango.core.Exception.o)
      _D5tango4core9Exception15SwitchException5_ctorMFAalZC5tango4core9Exception15SwitchException in libtango.a(tango.core.Exception.o)
  "_D16TypeInfo_Pointer6__vtblZ", referenced from:
      _D44TypeInfo_PS5tango4core6Thread6Thread7Context6__initZ in libtango.a(tango.core.Thread.o)
  "__d_arraycatT", referenced from:
      _D5tango2io6device7Conduit7Conduit4seekMFlE5tango2io5model8IConduit8IOStream6AnchorZl in libtango.a(tango.io.device.Conduit.o)
      _D5tango4stdc7stringz11toString16zFAuZPu in libtango.a(tango.stdc.stringz.o)
      _D5tango4stdc7stringz11toString32zFAwZPw in libtango.a(tango.stdc.stringz.o)
      _D5tango4text6locale5Posix14setUserCultureFiZv in libtango.a(tango.text.locale.Posix.o)
      _D5tango4text6locale5Posix14setUserCultureFiZv in libtango.a(tango.text.locale.Posix.o)
      _D5tango4text6locale5Posix13compareStringFiAakkAakkbZi in libtango.a(tango.text.locale.Posix.o)
  "_D6Object7__ClassZ", referenced from:
      _D5tango4text7convert6Layout13__T6LayoutTaZ6Layout7__ClassZ in libtango.a(tango.io.Stdout.o)
      _D5tango2io6device7Conduit7Conduit7__ClassZ in libtango.a(tango.io.device.Conduit.o)
      _D5tango2io6device7Conduit11InputFilter7__ClassZ in libtango.a(tango.io.device.Conduit.o)
      _D5tango2io6device7Conduit12OutputFilter7__ClassZ in libtango.a(tango.io.device.Conduit.o)
      _D5tango2io7Console7Console5Input7__ClassZ in libtango.a(tango.io.Console.o)
      _D5tango2io7Console7Console6Output7__ClassZ in libtango.a(tango.io.Console.o)
      __TMP2 in libtango.a(tango.core.Thread.o)
      __TMP14 in libtango.a(tango.core.Thread.o)
      _D5tango4core6Thread6Thread7__ClassZ in libtango.a(tango.core.Thread.o)
      _D5tango4core6Thread11ThreadGroup7__ClassZ in libtango.a(tango.core.Thread.o)
      __TMP90 in libtango.a(tango.core.Thread.o)
      _D5tango4core6Thread5Fiber9Scheduler7__ClassZ in libtango.a(tango.core.Thread.o)
      _D5tango4core6Thread5Fiber7__ClassZ in libtango.a(tango.core.Thread.o)
      _D5tango4time6chrono8Calendar8Calendar7__ClassZ in libtango.a(tango.time.chrono.Calendar.o)
  "_D13TypeInfo_Enum7__ClassZ", referenced from:
      _D13TypeInfo_Enum7__ClassZ$non_lazy_ptr in libtango.a(tango.io.Stdout.o)
  "_D16TypeInfo_Typedef6__vtblZ", referenced from:
      _D54TypeInfo_T5tango2io5model8IConduit11ISelectable6Handle6__initZ in libtango.a(tango.io.model.IConduit.o)
      _D44TypeInfo_T5tango4stdc5posix8langinfo7nl_item6__initZ in libtango.a(tango.stdc.posix.langinfo.o)
  "_D10TypeInfo_l6__initZ", referenced from:
      internal in test.o
      _D48TypeInfo_E5tango4time4Time8TimeSpan11__anonymous6__initZ in libtango.a(tango.time.Time.o)
      _D44TypeInfo_E5tango4time4Time4Time11__anonymous6__initZ in libtango.a(tango.time.Time.o)
  "__aaKeys", referenced from:
      _D5tango4core6Thread11ThreadGroup7opApplyMFDFKC5tango4core6Thread6ThreadZiZi in libtango.a(tango.core.Thread.o)
      _D5tango4core6Thread11ThreadGroup7joinAllMFbZv in libtango.a(tango.core.Thread.o)
  "_D14TypeInfo_Tuple6__vtblZ", referenced from:
      _D71TypeInfo_B59AalE5tango4core7Version5TangoE5tango4core7Version5TangoAaAa6__initZ in test.o
  "_D16TypeInfo_Typedef7__ClassZ", referenced from:
      _D16TypeInfo_Typedef7__ClassZ$non_lazy_ptr in libtango.a(tango.io.Stdout.o)
  "_D11TypeInfo_Aw6__initZ", referenced from:
      _D11TypeInfo_Aw6__initZ$non_lazy_ptr in libtango.a(tango.io.Stdout.o)
      _D11TypeInfo_Aw6__initZ$non_lazy_ptr in libtango.a(tango.text.convert.Float.o)
      _D11TypeInfo_Aw6__initZ$non_lazy_ptr in libtango.a(tango.io.stream.Format.o)
      _D11TypeInfo_Aw6__initZ$non_lazy_ptr in libtango.a(tango.text.convert.DateTime.o)
      _D11TypeInfo_Aw6__initZ$non_lazy_ptr in libtango.a(tango.text.convert.Utf.o)
      _D11TypeInfo_Aw6__initZ$non_lazy_ptr in libtango.a(tango.text.convert.Layout.o)
      _D11TypeInfo_Aw6__initZ$non_lazy_ptr in libtango.a(tango.stdc.stringz.o)

What can be the source of problem with linking?

Author Message

Posted: 02/10/10 16:42:08

Hi Digited, I think I heard that bob.sh doesn't do the correct thing on OSX, so the problem probably lies there. It is difficult for me to debug though. But maybe you could create ticket(s) for your problem(s)?

Posted: 02/10/10 21:17:33

On MacOSX, bob.d compiled with ldc works, but bob.d compiled with dmd hangs when executed.
As far as I see, the line that causes the problem is "dup2(pout.sink.fileHandle(), STDOUT_FILENO);" in tango.sys.Process.

Posted: 02/12/10 08:33:57

larsivi wrote:

Hi Digited, I think I heard that bob.sh doesn't do the correct thing on OSX, so the problem probably lies there. It is difficult for me to debug though. But maybe you could create ticket(s) for your problem(s)?

Done: #1858 (bob.sh) #1859 (bin/bob)

Posted: 02/16/10 12:48:47

Thanks. [fixed]