guild icon
Toit
#Initialization of global 'client' in progress.
Thread channel in help
Koirin
Koirin 12/12/2022 01:18 PM
Why is this stopping my process? And how to avoid it?
floitsch
floitsch 12/12/2022 01:52 PM
Globals and statics are initialized at first access.
floitsch
floitsch 12/12/2022 01:53 PM
Once the initializer has been finished, the return value is assigned to the global and used from then one.
floitsch
floitsch 12/12/2022 01:54 PM
The error message you are getting is, because something accessed a global (client) in a task, but hasn't returned yet. In a different task you accessed the same global, which leads to the error.
floitsch
floitsch 12/12/2022 01:57 PM
Actually. I'm wrong; In that case we just wait for the first one to finish.
floitsch
floitsch 12/12/2022 01:58 PM
What you are hitting here is simpler: You are trying to read a global that is being initialized while initializing it.
floitsch
floitsch 12/12/2022 01:58 PM
Simplified example:
use_global: print global return 499 global := use_global main: print global
floitsch
floitsch 12/12/2022 01:58 PM
In your case the global is client.
KoirinOPKoirin
Why is this stopping my process? And how to avoid it?
floitsch
floitsch 12/12/2022 02:06 PM
It's not completely clear why client is showing up in the stack-trace, though. In my test-case, the global name is the last one before run_global_initializer_.
floitsch
floitsch 12/12/2022 02:06 PM
Do you maybe have a bit more context?
Koirin
Koirin 12/13/2022 08:02 AM
I found the error. Just some variable-name errors. Thanks for the help :😄:
Koirin
Koirin 12/13/2022 08:07 AM
Although, I do have another question. I updated Visual Studio to the 2022 update, and now I am missing the Toit Extentions. But when I try to install it, nothing really happens. Visual Studio doesn't really react, and I can't find Toit anymore on their "marketplace". Have you seen this before?
KoirinOPKoirin
Although, I do have another question. I updated Visual Studio to the 2022 update, and now I am missing the Toit Extentions. But when I try to install it, nothing really happens. Vi...
floitsch
floitsch 12/13/2022 08:46 AM
Visual studio 2022 and vscode are two completely different products.
I don't think their extensions are compatible.
floitschfloitsch
Visual studio 2022 and vscode are two completely different products. I don't think their extensions are compatible.
Koirin
Koirin 12/13/2022 08:56 AM
You are correct, and I have made a big but innocent mistake. I am back on track now :😄:
What vacations doesn't do to you :😄:
😄1
Koirin
Koirin 12/13/2022 09:54 AM
Now I've fixed the client, but I get this stack trace error now
KoirinOPKoirin
Now I've fixed the client, but I get this stack trace error now
Koirin
Koirin 12/13/2022 10:02 AM
I fixed this, but I don't understand how.
So, I start the client in the beginning of main, then everything works. But if I call a "client.start" in a function instead, it will give this stack-trace
floitsch
floitsch 12/13/2022 10:53 AM
The stacktrace seems to indicate that the client isn't connected yet.
floitsch
floitsch 12/13/2022 10:53 AM
The null-error is on session_ which is set during connect.
floitsch
floitsch 12/13/2022 10:54 AM
Setting the session_ is one of the first things connect does.
floitsch
floitsch 12/13/2022 10:54 AM
My guess is, it hasn't been called yet.
RobvanLopik
RobvanLopik 12/13/2022 11:47 AM
jag
21 messages in total