]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/tools/build/src/engine/boehm_gc/doc/README.solaris2
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / tools / build / src / engine / boehm_gc / doc / README.solaris2
CommitLineData
7c673cae
FG
1The collector supports both incremental collection and threads under
2Solaris 2. The incremental collector normally retrieves page dirty information
3through the appropriate /proc calls. But it can also be configured
4(by defining MPROTECT_VDB instead of PROC_VDB in gcconfig.h) to use mprotect
5and signals. This may result in shorter pause times, but it is no longer
6safe to issue arbitrary system calls that write to the heap.
7
8Under other UNIX versions,
9the collector normally obtains memory through sbrk. There is some reason
10to expect that this is not safe if the client program also calls the system
11malloc, or especially realloc. The sbrk man page strongly suggests this is
12not safe: "Many library routines use malloc() internally, so use brk()
13and sbrk() only when you know that malloc() definitely will not be used by
14any library routine." This doesn't make a lot of sense to me, since there
15seems to be no documentation as to which routines can transitively call malloc.
16Nonetheless, under Solaris2, the collector now (since 4.12) allocates
17memory using mmap by default. (It defines USE_MMAP in gcconfig.h.)
18You may want to reverse this decisions if you use -DREDIRECT_MALLOC=...
19
20
21SOLARIS THREADS:
22
23The collector must be compiled with -DGC_SOLARIS_THREADS (thr_ functions)
24or -DGC_THREADS to be thread safe. This assumes use of the pthread_
25interface. Old style Solaris threads are no longer supported.
26
27It is also essential that gc.h be included in files that call thr_create,
28thr_join, thr_suspend, thr_continue, or dlopen. Gc.h macro defines
29these to also do GC bookkeeping, etc. Gc.h must be included with
30one or both of these macros defined, otherwise
31these replacements are not visible.
32A collector built in this way way only be used by programs that are
33linked with the threads library.
34
35Since 5.0 alpha5, dlopen disables collection temporarily,
36unless USE_PROC_FOR_LIBRARIES is defined. In some unlikely cases, this
37can result in unpleasant heap growth. But it seems better than the
38race/deadlock issues we had before.
39
40If solaris_threads are used on an X86 processor with malloc redirected to
41GC_malloc, it is necessary to call GC_thr_init explicitly before forking the
42first thread. (This avoids a deadlock arising from calling GC_thr_init
43with the allocation lock held.)
44
45It appears that there is a problem in using gc_cpp.h in conjunction with
46Solaris threads and Sun's C++ runtime. Apparently the overloaded new operator
47is invoked by some iostream initialization code before threads are correctly
48initialized. As a result, call to thr_self() in garbage collector
49initialization segfaults. Currently the only known workaround is to not
50invoke the garbage collector from a user defined global operator new, or to
51have it invoke the garbage-collector's allocators only after main has started.
52(Note that the latter requires a moderately expensive test in operator
53delete.)
54
55I encountered "symbol <unknown>: offet .... is non-aligned" errors. These
56appear to be traceable to the use of the GNU assembler with the Sun linker.
57The former appears to generate a relocation not understood by the latter.
58The fix appears to be to use a consistent tool chain. (As a non-Solaris-expert
59my solution involved hacking the libtool script, but I'm sure you can
60do something less ugly.)
61
62Hans-J. Boehm
63(The above contains my personal opinions, which are probably not shared
64by anyone else.)