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

update to allow mingw support #282

Closed
wants to merge 2 commits into from
Closed

update to allow mingw support #282

wants to merge 2 commits into from

Conversation

ryancinsight
Copy link
Contributor

mingw doesn't work well with gets so adding string for memset and utility for std::pair corrects build issues.

Add  <utility> for mingw support
@ghost
Copy link

ghost commented Feb 12, 2021

CLA assistant check
All CLA requirements met.

@ryancinsight
Copy link
Contributor Author

@SchrodingerZhu this should correct snmalloc-rs build on mingw, I'll check if any of my cmake flags contribute and create a pull request if they do.

Add string for mingw support
@SchrodingerZhu
Copy link
Contributor

hi, I am very glad to see this. But MinGW seems to have other issues: it still does not destroy the static TLS correctly when I tried it out last week.

Did you try to run the full set of test cases with MinGW (especially the func-malloc series) ? If they passed, could you provide the version info of your tool chain?

@ryancinsight
Copy link
Contributor Author

hi, I am very glad to see this. But MinGW seems to have other issues: it still does not destroy the static TLS correctly when I tried it out last week.

Did you try to run the full set of test cases with MinGW (especially the func-malloc series) ? If they passed, could you provide the version info of your tool chain?

(base) D:\fork\snmalloc-rs\snmalloc-sys\snmalloc-build>ctest
Test project D:/fork/snmalloc-rs/snmalloc-sys/snmalloc-build
Start 1: perf-contention-1
1/51 Test #1: perf-contention-1 ................Exit code 0xc0000139
***Exception: 0.76 sec
Start 2: perf-contention-16
2/51 Test #2: perf-contention-16 ...............Exit code 0xc0000139
***Exception: 0.13 sec
Start 3: perf-contention-oe
3/51 Test #3: perf-contention-oe ...............Exit code 0xc0000139
***Exception: 0.13 sec
Start 4: perf-external_pointer-1
4/51 Test #4: perf-external_pointer-1 .......... Passed 14.66 sec
Start 5: perf-external_pointer-16
5/51 Test #5: perf-external_pointer-16 ......... Passed 13.83 sec
Start 6: perf-external_pointer-oe
6/51 Test #6: perf-external_pointer-oe ......... Passed 18.59 sec
Start 7: perf-low_memory-1
7/51 Test #7: perf-low_memory-1 ................ Passed 4.17 sec
Start 8: perf-low_memory-16
8/51 Test #8: perf-low_memory-16 ............... Passed 3.15 sec
Start 9: perf-low_memory-oe
9/51 Test #9: perf-low_memory-oe ............... Passed 3.57 sec
Start 10: perf-singlethread-1
10/51 Test #10: perf-singlethread-1 .............. Passed 0.47 sec
Start 11: perf-singlethread-16
11/51 Test #11: perf-singlethread-16 ............. Passed 0.48 sec
Start 12: perf-singlethread-oe
12/51 Test #12: perf-singlethread-oe ............. Passed 0.46 sec
Start 13: func-bits-1
13/51 Test #13: func-bits-1 ...................... Passed 0.14 sec
Start 14: func-bits-16
14/51 Test #14: func-bits-16 ..................... Passed 0.31 sec
Start 15: func-bits-oe
15/51 Test #15: func-bits-oe ..................... Passed 0.19 sec
Start 16: func-external_pagemap-1
16/51 Test #16: func-external_pagemap-1 .......... Passed 0.11 sec
Start 17: func-external_pagemap-16
17/51 Test #17: func-external_pagemap-16 ......... Passed 0.12 sec
Start 18: func-external_pagemap-oe
18/51 Test #18: func-external_pagemap-oe ......... Passed 0.11 sec
Start 19: func-first_operation-1
19/51 Test #19: func-first_operation-1 ...........Exit code 0xc0000139
***Exception: 0.14 sec
Start 20: func-first_operation-16
20/51 Test #20: func-first_operation-16 ..........Exit code 0xc0000139
***Exception: 0.15 sec
Start 21: func-first_operation-oe
21/51 Test #21: func-first_operation-oe ..........Exit code 0xc0000139
***Exception: 0.14 sec
Start 22: func-fixed_region-1
22/51 Test #22: func-fixed_region-1 .............. Passed 0.22 sec
Start 23: func-fixed_region-16
23/51 Test #23: func-fixed_region-16 ............. Passed 0.24 sec
Start 24: func-fixed_region-oe
24/51 Test #24: func-fixed_region-oe ............. Passed 0.23 sec
Start 25: func-malloc-1
25/51 Test #25: func-malloc-1 .................... Passed 0.23 sec
Start 26: func-malloc-16
26/51 Test #26: func-malloc-16 ................... Passed 1.87 sec
Start 27: func-malloc-oe
27/51 Test #27: func-malloc-oe ................... Passed 0.17 sec
Start 28: func-memory-1
28/51 Test #28: func-memory-1 .................... Passed 0.19 sec
Start 29: func-memory-16
29/51 Test #29: func-memory-16 ................... Passed 0.29 sec
Start 30: func-memory-oe
30/51 Test #30: func-memory-oe ................... Passed 0.19 sec
Start 31: func-memory_usage-1
31/51 Test #31: func-memory_usage-1 .............. Passed 0.15 sec
Start 32: func-memory_usage-16
32/51 Test #32: func-memory_usage-16 ............. Passed 0.27 sec
Start 33: func-memory_usage-oe
33/51 Test #33: func-memory_usage-oe ............. Passed 0.17 sec
Start 34: func-pagemap-1
34/51 Test #34: func-pagemap-1 ................... Passed 0.72 sec
Start 35: func-pagemap-16
35/51 Test #35: func-pagemap-16 .................. Passed 0.72 sec
Start 36: func-pagemap-oe
36/51 Test #36: func-pagemap-oe .................. Passed 0.67 sec
Start 37: func-sandbox-1
37/51 Test #37: func-sandbox-1 ................... Passed 0.20 sec
Start 38: func-sandbox-16
38/51 Test #38: func-sandbox-16 .................. Passed 0.15 sec
Start 39: func-sandbox-oe
39/51 Test #39: func-sandbox-oe .................. Passed 0.15 sec
Start 40: func-sizeclass-1
40/51 Test #40: func-sizeclass-1 ................. Passed 0.14 sec
Start 41: func-sizeclass-16
41/51 Test #41: func-sizeclass-16 ................ Passed 0.55 sec
Start 42: func-sizeclass-oe
42/51 Test #42: func-sizeclass-oe ................ Passed 0.13 sec
Start 43: func-statistics-1
43/51 Test #43: func-statistics-1 ................ Passed 0.14 sec
Start 44: func-statistics-16
44/51 Test #44: func-statistics-16 ............... Passed 0.13 sec
Start 45: func-statistics-oe
45/51 Test #45: func-statistics-oe ............... Passed 0.15 sec
Start 46: func-thread_alloc_external-1
46/51 Test #46: func-thread_alloc_external-1 ..... Passed 0.13 sec
Start 47: func-thread_alloc_external-16
47/51 Test #47: func-thread_alloc_external-16 .... Passed 0.14 sec
Start 48: func-thread_alloc_external-oe
48/51 Test #48: func-thread_alloc_external-oe .... Passed 0.13 sec
Start 49: func-two_alloc_types-1
49/51 Test #49: func-two_alloc_types-1 ........... Passed 0.16 sec
Start 50: func-two_alloc_types-16
50/51 Test #50: func-two_alloc_types-16 .......... Passed 0.18 sec
Start 51: func-two_alloc_types-oe
51/51 Test #51: func-two_alloc_types-oe .......... Passed 0.16 sec

88% tests passed, 6 tests failed out of 51

Total Test time (real) = 70.91 sec

The following tests FAILED:
1 - perf-contention-1 (Exit code 0xc0000139
)
2 - perf-contention-16 (Exit code 0xc0000139
)
3 - perf-contention-oe (Exit code 0xc0000139
)
19 - func-first_operation-1 (Exit code 0xc0000139
)
20 - func-first_operation-16 (Exit code 0xc0000139
)
21 - func-first_operation-oe (Exit code 0xc0000139
)
Errors while running CTest

running allocation tests with cargo:
(base) D:\fork\snmalloc-rs>cargo test --target x86_64-pc-windows-gnu
Compiling snmalloc-sys v0.2.24 (D:\fork\snmalloc-rs\snmalloc-sys)
Compiling snmalloc-rs v0.2.24 (D:\fork\snmalloc-rs)
Finished test [unoptimized + debuginfo] target(s) in 14.14s
Running target\x86_64-pc-windows-gnu\debug\deps\snmalloc_rs-80a5f043511ee0e8.exe

running 3 tests
test tests::it_frees_zero_allocated_memory ... ok
test tests::it_frees_allocated_memory ... ok
test tests::it_frees_reallocated_memory ... ok

test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

Doc-tests snmalloc-rs

running 1 test
test src\lib.rs - (line 24) ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.70s

and I just updated to rust 1.50 using windows 10 and msys2/mingw, which technically cmake-rs will choose msys compiler toolchain

@SchrodingerZhu
Copy link
Contributor

SchrodingerZhu commented Feb 12, 2021

sorry to see that. so the problem actually remains.

did you check #217

it can actually be rebased onto current master directly. And it fixes one problem: ctllz.

But yes, last time I tested it, the source need to add the additional cstring header.

Perhaps this pr is duplicated with #217. Thanks for your trying out thou.

@ryancinsight
Copy link
Contributor Author

well these are just dll errors, this should be an easy fix:

Dump of file perf-contention-1.exe

File Type: EXECUTABLE IMAGE

Image has the following dependencies:

KERNEL32.dll
api-ms-win-core-processthreads-l1-1-3.dll
api-ms-win-core-errorhandling-l1-1-3.dll
api-ms-win-core-psapi-l1-1-0.dll
api-ms-win-core-synch-l1-2-1.dll
api-ms-win-core-memory-l1-1-7.dll
msvcrt.dll
libatomic-1.dll
libgcc_s_seh-1.dll
libstdc++-6.dll

Summary

@ryancinsight
Copy link
Contributor Author

should only be first_func now, error is allocator in use:

  Start  1: perf-contention-1

1/51 Test #1: perf-contention-1 ................ Passed 0.86 sec
Start 2: perf-contention-16
2/51 Test #2: perf-contention-16 ............... Passed 0.86 sec
Start 3: perf-contention-oe
3/51 Test #3: perf-contention-oe ............... Passed 0.96 sec
Start 4: perf-external_pointer-1
4/51 Test #4: perf-external_pointer-1 .......... Passed 0.15 sec
Start 5: perf-external_pointer-16
5/51 Test #5: perf-external_pointer-16 ......... Passed 0.16 sec
Start 6: perf-external_pointer-oe
6/51 Test #6: perf-external_pointer-oe ......... Passed 0.15 sec
Start 7: perf-low_memory-1
7/51 Test #7: perf-low_memory-1 ................ Passed 0.02 sec
Start 8: perf-low_memory-16
8/51 Test #8: perf-low_memory-16 ............... Passed 0.02 sec
Start 9: perf-low_memory-oe
9/51 Test #9: perf-low_memory-oe ............... Passed 0.02 sec
Start 10: perf-singlethread-1
10/51 Test #10: perf-singlethread-1 .............. Passed 0.32 sec
Start 11: perf-singlethread-16
11/51 Test #11: perf-singlethread-16 ............. Passed 0.32 sec
Start 12: perf-singlethread-oe
12/51 Test #12: perf-singlethread-oe ............. Passed 0.33 sec
Start 13: func-bits-1
13/51 Test #13: func-bits-1 ...................... Passed 0.02 sec
Start 14: func-bits-16
14/51 Test #14: func-bits-16 ..................... Passed 0.02 sec
Start 15: func-bits-oe
15/51 Test #15: func-bits-oe ..................... Passed 0.02 sec
Start 16: func-external_pagemap-1
16/51 Test #16: func-external_pagemap-1 .......... Passed 0.02 sec
Start 17: func-external_pagemap-16
17/51 Test #17: func-external_pagemap-16 ......... Passed 0.02 sec
Start 18: func-external_pagemap-oe
18/51 Test #18: func-external_pagemap-oe ......... Passed 0.02 sec
Start 19: func-first_operation-1
19/51 Test #19: func-first_operation-1 ...........***Failed 0.02 sec
Start 20: func-first_operation-16
20/51 Test #20: func-first_operation-16 ..........***Failed 0.03 sec
Start 21: func-first_operation-oe
21/51 Test #21: func-first_operation-oe ..........***Failed 0.02 sec
Start 22: func-fixed_region-1
22/51 Test #22: func-fixed_region-1 .............. Passed 0.12 sec
Start 23: func-fixed_region-16
23/51 Test #23: func-fixed_region-16 ............. Passed 0.11 sec
Start 24: func-fixed_region-oe
24/51 Test #24: func-fixed_region-oe ............. Passed 0.12 sec
Start 25: func-malloc-1
25/51 Test #25: func-malloc-1 .................... Passed 0.12 sec
Start 26: func-malloc-16
26/51 Test #26: func-malloc-16 ................... Passed 1.57 sec
Start 27: func-malloc-oe
27/51 Test #27: func-malloc-oe ................... Passed 0.06 sec
Start 28: func-memory-1
28/51 Test #28: func-memory-1 .................... Passed 0.09 sec
Start 29: func-memory-16
29/51 Test #29: func-memory-16 ................... Passed 0.18 sec
Start 30: func-memory-oe
30/51 Test #30: func-memory-oe ................... Passed 0.09 sec
Start 31: func-memory_usage-1
31/51 Test #31: func-memory_usage-1 .............. Passed 0.03 sec
Start 32: func-memory_usage-16
32/51 Test #32: func-memory_usage-16 ............. Passed 0.14 sec
Start 33: func-memory_usage-oe
33/51 Test #33: func-memory_usage-oe ............. Passed 0.03 sec
Start 34: func-pagemap-1
34/51 Test #34: func-pagemap-1 ................... Passed 0.50 sec
Start 35: func-pagemap-16
35/51 Test #35: func-pagemap-16 .................. Passed 0.51 sec
Start 36: func-pagemap-oe
36/51 Test #36: func-pagemap-oe .................. Passed 0.51 sec
Start 37: func-sandbox-1
37/51 Test #37: func-sandbox-1 ................... Passed 0.03 sec
Start 38: func-sandbox-16
38/51 Test #38: func-sandbox-16 .................. Passed 0.03 sec
Start 39: func-sandbox-oe
39/51 Test #39: func-sandbox-oe .................. Passed 0.03 sec
Start 40: func-sizeclass-1
40/51 Test #40: func-sizeclass-1 ................. Passed 0.05 sec
Start 41: func-sizeclass-16
41/51 Test #41: func-sizeclass-16 ................ Passed 0.64 sec
Start 42: func-sizeclass-oe
42/51 Test #42: func-sizeclass-oe ................ Passed 0.03 sec
Start 43: func-statistics-1
43/51 Test #43: func-statistics-1 ................ Passed 0.02 sec
Start 44: func-statistics-16
44/51 Test #44: func-statistics-16 ............... Passed 0.02 sec
Start 45: func-statistics-oe
45/51 Test #45: func-statistics-oe ............... Passed 0.02 sec
Start 46: func-thread_alloc_external-1
46/51 Test #46: func-thread_alloc_external-1 ..... Passed 0.02 sec
Start 47: func-thread_alloc_external-16
47/51 Test #47: func-thread_alloc_external-16 .... Passed 0.02 sec
Start 48: func-thread_alloc_external-oe
48/51 Test #48: func-thread_alloc_external-oe .... Passed 0.02 sec
Start 49: func-two_alloc_types-1
49/51 Test #49: func-two_alloc_types-1 ........... Passed 0.02 sec
Start 50: func-two_alloc_types-16
50/51 Test #50: func-two_alloc_types-16 .......... Passed 0.02 sec
Start 51: func-two_alloc_types-oe
51/51 Test #51: func-two_alloc_types-oe .......... Passed 0.02 sec

94% tests passed, 3 tests failed out of 51

Total Test time (real) = 9.69 sec

The following tests FAILED:
19 - func-first_operation-1 (Failed)
20 - func-first_operation-16 (Failed)
21 - func-first_operation-oe (Failed)
Errors while running CTest

@ryancinsight
Copy link
Contributor Author

@SchrodingerZhu thanks for the heads up, Looks like you made more changes than needed but I'll close since final issue is same on only func-first_operations failing.

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

Successfully merging this pull request may close these issues.

2 participants