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

It won't work on Windows with TLS error #201

Closed
bigos opened this issue Apr 14, 2019 · 5 comments
Closed

It won't work on Windows with TLS error #201

bigos opened this issue Apr 14, 2019 · 5 comments

Comments

@bigos
Copy link

bigos commented Apr 14, 2019

I have copied downloaded ccl to c:/ folder as there is not windows specific instructions
nothing seems to work

c:/ccl $ ./wx86cl64.exe -n
unexpected TLS index value: wanted 6, got 26
c:/ccl $ ./wx86cl.exe -V
unexpected TLS index value: wanted 7, got 27
c:/ccl $


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@bigos
Copy link
Author

bigos commented Apr 21, 2019

It seems to be environment related. This time it was run in a different folder and with the -n options I had some success.

PS C:\Users\Jacek\Downloads\ccl-1.11.5-windowsx86\ccl> .\wx86cl64.exe --help
unexpected TLS index value: wanted 6, got 26
PS C:\Users\Jacek\Downloads\ccl-1.11.5-windowsx86\ccl> .\wx86cl64.exe -n
Clozure Common Lisp Version 1.11.5/v1.11.5 (WindowsX8664)

For more information about CCL, please see http://ccl.clozure.com.

CCL is free software. It is distributed under the terms of the Apache
Licence, Version 2.0.
? (+ 1 2 3)
6

@xrme
Copy link
Member

xrme commented Apr 22, 2019

CCL tries to reserve some contiguous TLS slots at startup time. See reserve_tls_slots() (https://github.com/Clozure/ccl/blob/master/lisp-kernel/windows-calls.c#L1036). If it can't do this, it complains in the manner that you described.

I am not sure what causes TLS slots to get used up before CCL tries to reserve them.

CCL wants slots 30 through 63. The code assumes that TLS slots are allocated in order, but maybe that's not true? Maybe there's no need to give up if some slot under 30 is already reserved, as long as we can reserve slots 30 through 63?

@bigos
Copy link
Author

bigos commented Apr 22, 2019

http://www.nynaeve.net/?p=190
the last paragraph mentions some possible magic happening behind the scenes.

@phoe phoe mentioned this issue May 11, 2020
@eugeneia
Copy link
Contributor

I happen to have a windows 10 box at hand and can reproduce this. Might try to formulate a fix over the weekend, however be warned that I don't know much about windows hacking.

@xrme can you explain to me what these TLS slots are used for, why CCL reserves them, why we want their IDs to be consecutive and in order (is this just an implementation detail or a hard requirement), and why CCL seems to work without reserving TLS slots / what limitations apply when we don't have them?

@xrme
Copy link
Member

xrme commented May 20, 2020

This is a duplicate of #311 (wherein I suggest a fix).

@xrme xrme closed this as completed May 20, 2020
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

3 participants