Comments (8)
The porting difficulties are:
- how to get main stack base (bottom)
- how to get main data root(s)
from bdwgc.
How to build embox/x86 with gctest in qemu (on Ubuntu/x64):
- prerequisites: https://github.com/embox/embox-docs/blob/master/ru/embox_quick_start_ru.md
- git clone https://github.com/embox/embox.git
- cd embox
- make confload-x86
- (cd download; wget https://mirror.iscas.ac.cn/yocto/mirror/sources/acpica-unix-20210331.tar.gz)
- mkdir src/cmds/gctest
- (cd src/cmds/gctest; git clone https://github.com/ivmai/bdwgc.git)
- vi src/cmds/gctest/Mybuild // see the content below
- vi conf/mods.conf // add line: include embox.cmd.gctest
- make -j
- ./scripts/qemu/auto_qemu
from bdwgc.
Sample "Mybuild" file for gctest:
package embox.cmd
@AutoCmd
@Cmd(name = "gctest", help="BDWGC tests")
module gctest {
@IncludePath("$(SRC_DIR)/cmds/gctest/bdwgc/include")
@Cflags("-D GC_GCJ_SUPPORT")
@Cflags("-D ENABLE_DISCLAIM")
source "bdwgc/tests/gctest.c"
//source "bdwgc/tests/huge.c"
//source "bdwgc/tests/leak.c"
//source "bdwgc/tests/middle.c"
//source "bdwgc/tests/realloc.c"
//source "bdwgc/tests/smash.c"
//source "bdwgc/tests/disclaim.c"
//source "bdwgc/tests/disclaim_bench.c"
//source "bdwgc/tests/weakmap.c"
@IncludePath("$(SRC_DIR)/cmds/gctest/bdwgc/include")
@Cflags("-D GC_GCJ_SUPPORT")
@Cflags("-D ENABLE_DISCLAIM")
@Cflags("-D GC_ASSERTIONS")
source "bdwgc/extra/gc.c"
}
from bdwgc.
how to get main stack base (bottom)
The portable way is to use pthread_... primitives, but they are not supported in Embox yet, I've created an issue about it - embox/embox#2779
from bdwgc.
Current status:
- pthread_attr_getstack() is missing
- undefined reference to _end, __data_start
from bdwgc.
The portable way is to use pthread_... primitives, but they are not supported in Embox yet
Use instead, for now:
# include <kernel/thread/thread_stack.h>
...
pthread_t self = pthread_self();
void *stack_addr = thread_stack_get(self);
sb -> mem_base = stack_addr + thread_stack_get_size(self);
from bdwgc.
undefined reference to __data_start, _end
Use _modules_data_start and _apps_bss_end instead.
Note: this includes data/bss for all compiled-in modules and apps, size >25MB.
from bdwgc.
Current limitations:
- No support of ISAs other than x86
- C++ support was not tested
- No threads support
- No memory unmaping to OS
- No malloc redirection support
- ALL_INTERIOR_POINTERS mode does not work (leads to out of memory (122MB) in gctest)
- restart of gctest command (module) leads to crash (because data & bss are not cleared between runs)
from bdwgc.
Related Issues (20)
- Unexpected heap growth in gctest single-threaded incremental mode with checksums on Linux/x64
- SEGFAULT in gctest on Win64
- gctest sometimes hang on Linux/x64 when compiled with DONT_ADD_BYTE_AT_END HOT 2
- gc-8.2.2 gctest fail on linux/aarch64 (qemu) HOT 5
- initfromthreadtest fail on Ubuntu 22 x64 HOT 4
- Signals delivery fails in gctest on Ubuntu Jammy if compiled with TSan HOT 10
- Incremental GC collecting referenced objects (gctest fails with soft vdb if shared build by zig) HOT 13
- Best practice on parallel + incremental / generational ? HOT 8
- Design question, concurent GC + free? HOT 4
- Provide global aligned allocators in gccpp library HOT 1
- Bad complex descriptor occurs rarely in find-leak mode HOT 3
- Assertion violation in cpptest about nFreed/nAllocated with ASan on E2K HOT 1
- SIGSEGV in gctest, disclaimtest, weakmaptest if compiled with TSan and MPROTECT_VDB mode active on Linux HOT 2
- SIGPWR signal on Debian HOT 3
- Inconsistent soft-dirty against mprotect dirty bits HOT 3
- Downstream libgc releases (May 2023) HOT 30
- config doesn't recognize riscv on netbsd HOT 3
- Provide build.zig for building libgc? HOT 2
- Initial support of KOS/arm64 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bdwgc.