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

cordtest hang on Windows if shared build by Zig using msvc #640

Open
ivmai opened this issue May 2, 2024 · 7 comments
Open

cordtest hang on Windows if shared build by Zig using msvc #640

ivmai opened this issue May 2, 2024 · 7 comments

Comments

@ivmai
Copy link
Owner

ivmai commented May 2, 2024

Source: master (2eaa40c)
Build: https://github.com/ivmai/bdwgc/actions/runs/8928784437/job/24525078409
Zig version: 0.12.0
Command: zig build -Dtarget=native-native-msvc -DBUILD_SHARED_LIBS=true -Ddisable_handle_fork=false -Denable_cplusplus=false -Denable_gc_assertions=true -Denable_gc_debug=false -Denable_large_config=false -Denable_munmap=true -Denable_parallel_mark=false -Denable_redirect_malloc=false -Denable_rwlock=false -Denable_thread_local_alloc=false -Denable_threads=false -Denable_werror -Dbuild_cord=true "-DCFLAGS_EXTRA=-DGC_PRINT_VERBOSE_STATS -DCONSOLE_LOG" test
Output (cordtest):

Got 65536 bytes from OS
Got 6[5](https://github.com/ivmai/bdwgc/actions/runs/8928784437/job/24525078409#step:4:6)536 bytes from OS
Got 6553[6](https://github.com/ivmai/bdwgc/actions/runs/8928784437/job/24525078409#step:4:7) bytes from OS
In-use heap: 0% (0 KiB pointers + 0 KiB other)
Got 65536 bytes from OS
Grow heap to 64 KiB after 0 bytes allocated
Grew heap sections array to 32 elements
Initiating full world-stop collection!
0 bytes in heap blacklisted for interior pointers
Found new system malloc AllocationBase at 00000291F[7](https://github.com/ivmai/bdwgc/actions/runs/8928784437/job/24525078409#step:4:8)900000
--> Marking for collection #1 after 0 allocated bytes
World-stopped marking took 16 ms 0 ns (16 ms in average)
Bytes recovered before sweep - f.l. count = 0
GC #1 freed 0 bytes, heap 64 KiB (+ 0 KiB unmapped + 362 KiB internal)
In-use heap: 0% (0 KiB pointers + 0 KiB other)
0 finalization entries; 0/0 short/long disappearing links alive
0 finalization-ready objects; 0/0 short/long links cleared
Finalize and initiate sweep took 0 ms 0 ns + 0 ms 0 ns
Complete collection took [16](https://github.com/ivmai/bdwgc/actions/runs/8928784437/job/24525078409#step:4:17) ms 0 ns
Initializing mprotect virtual dirty bit implementation
Using GetWriteWatch()
Adding block map for size of 1 granules (16 bytes)
Adding block map for size of 2 granules (32 bytes)
@ivmai
Copy link
Owner Author

ivmai commented May 3, 2024

I tried to reproduce it locally, but failed to setup build environment with Zig using MSVC (I don't have such issue with e.g. cmake):
<path_to_zig>\zig.exe build -Dtarget=native-native-msvc produces output (without enough details):

Build Summary: 1/6 steps succeeded; 1 failed (disable with --summary none)
install transitive failure
+- install gc transitive failure
|  +- zig build-lib gc Debug native-native-msvc failure
+- install cord transitive failure
   +- zig build-lib cord Debug native-native-msvc transitive failure
      +- zig build-lib gc Debug native-native-msvc (reused)
error: the following build command failed with exit code 1:
...\zig-cache\o\e6349bcf924ab91855bda5bf668ba4bf\build.exe

@ivmai
Copy link
Owner Author

ivmai commented May 3, 2024

@kassane If possible, please help investigating this issue.

@kassane

This comment was marked as outdated.

@ivmai
Copy link
Owner Author

ivmai commented May 3, 2024

commit: b1fe062 MinGW build: 🆗 MSVC build: ❌

preview-error

Please give me more details: which build configuration? Do you have ideas why process.h is not found?

@kassane
Copy link
Contributor

kassane commented May 3, 2024

Please give me more details: which build configuration? Do you have ideas why process.h is not found?

Sorry! It was a winSDK dependency failure. [ignore]

After using windbg, I realized that it always marked the same point, so I tested each test function separately.

The issue occurs on test_extras - exactly Cord_from_file().
image

@kassane
Copy link
Contributor

kassane commented May 3, 2024

ABORT(msg) no emit any error about...

msvc-sharedlib

image

@kassane
Copy link
Contributor

kassane commented May 3, 2024

I tried to reproduce it locally, but failed to setup build environment with Zig using MSVC (I don't have such issue with e.g. cmake):

CMake - msvc libs - more complete

Zig - msvc libs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants