Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build with MEMFENCE failed #52973

Closed
inkydragon opened this issue Jan 19, 2024 · 3 comments · Fixed by #52975
Closed

Build with MEMFENCE failed #52973

inkydragon opened this issue Jan 19, 2024 · 3 comments · Fixed by #52975
Labels
building Build system, or building Julia or its dependencies GC Garbage collector

Comments

@inkydragon
Copy link
Sponsor Member

$ make
    CC julia-w64/src/gc-debug.dbg.obj
D:/jl/julia/src/gc-debug.c: In function 'gc_verify_tags_pagetable0':
D:/jl/julia/src/gc-debug.c:357:35: error: 'pagetable0_t' has no member named 'allocmap'
  357 |         uint32_t line = pagetable0->allocmap[pg_i];
      |                                   ^~
D:/jl/julia/src/gc-debug.c:361:57: warning: passing argument 1 of 'gc_verify_tags_page' makes pointer from integer without a cast [-Wint-conversion]
  361 |                     gc_verify_tags_page(pagetable0->meta[pg_i * 32 + j]);
      |                                         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
      |                                                         |
      |                                                         uint8_t {aka unsigned char}
D:/jl/julia/src/gc-debug.c:290:51: note: expected 'jl_gc_pagemeta_t *' {aka 'struct _jl_gc_pagemeta_t *'} but argument is of type 'uint8_t' {aka 'unsigned char'}
  290 | static void gc_verify_tags_page(jl_gc_pagemeta_t *pg)
      |                                 ~~~~~~~~~~~~~~~~~~^~
D:/jl/julia/src/gc-debug.c: In function 'gc_verify_tags_pagetable1':
D:/jl/julia/src/gc-debug.c:371:35: error: 'pagetable1_t' has no member named 'allocmap0'
  371 |         uint32_t line = pagetable1->allocmap0[pg_i];
      |                                   ^~
D:/jl/julia/src/gc-debug.c: In function 'gc_verify_tags_pagetable':
D:/jl/julia/src/gc-debug.c:385:25: error: 'memory_map' undeclared (first use in this function)
  385 |         uint32_t line = memory_map.allocmap1[pg_i];
      |                         ^~~~~~~~~~
D:/jl/julia/src/gc-debug.c:385:25: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [/d/jl/julia/src/Makefile:241: gc-debug.dbg.obj] Error 1
make: *** [/d/jl/julia/Makefile:97: julia-src-debug] Error 2

julia/src/gc.h

Lines 267 to 278 in eb26d63

// define the representation of the levels of the page-table (0 to 2)
typedef struct {
uint8_t meta[REGION0_PG_COUNT];
} pagetable0_t;
typedef struct {
pagetable0_t *meta0[REGION1_PG_COUNT];
} pagetable1_t;
typedef struct {
pagetable1_t *meta1[REGION2_PG_COUNT];
} pagetable_t;

error: 'pagetable0_t' has no member named 'allocmap'

julia/src/gc-debug.c

Lines 352 to 355 in eb26d63

static void gc_verify_tags_pagetable0(pagetable0_t *pagetable0)
{
for (int pg_i = 0; pg_i < REGION0_PG_COUNT / 32; pg_i++) {
uint32_t line = pagetable0->allocmap[pg_i];

error: 'pagetable1_t' has no member named 'allocmap0'

julia/src/gc-debug.c

Lines 366 to 369 in eb26d63

static void gc_verify_tags_pagetable1(pagetable1_t *pagetable1)
{
for (int pg_i = 0; pg_i < REGION1_PG_COUNT / 32; pg_i++) {
uint32_t line = pagetable1->allocmap0[pg_i];

error: 'memory_map' undeclared

julia/src/gc-debug.c

Lines 380 to 392 in ca1e519

static void gc_verify_tags_pagetable(void)
{
for (int pg_i = 0; pg_i < (REGION2_PG_COUNT + 31) / 32; pg_i++) {
uint32_t line = memory_map.allocmap1[pg_i];
if (line) {
for (int j = 0; j < 32; j++) {
if ((line >> j) & 1) {
gc_verify_tags_pagetable1(memory_map.meta1[pg_i * 32 + j]);
}
}
}
}
}

@inkydragon inkydragon added building Build system, or building Julia or its dependencies GC Garbage collector labels Jan 19, 2024
@vchuravy
Copy link
Member

What compiler are you using?

@inkydragon
Copy link
Sponsor Member Author

inkydragon commented Jan 19, 2024

  • Windows 11 23H2 + MSYS2 + mingw-w64
  • MSYS2: MINGW64_NT-10.0-22631 A309-Y9000P 3.4.10.x86_64 2023-11-30 06:09 UTC x86_64 Msys
  • gcc: gcc.exe (Rev3, Built by MSYS2 project) 13.2.0
  • ld: GNU ld (GNU Binutils) 2.41

I've searched the project, and memory_map is indeed undefined.
https://github.com/search?q=repo%3AJuliaLang%2Fjulia%20memory_map&type=code

@d-netto
Copy link
Member

d-netto commented Jan 19, 2024

Apparently we don't test any builds with MEMFENCE enabled on CI, so these functions probably just rot after the recent allocation changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building Build system, or building Julia or its dependencies GC Garbage collector
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants