Open Alogani opened 5 months ago
115.47 Kb (118,240 bytes)
```cpp
#define NIM_INTBITS 64
#include "nimbase.h"
#include 2024-05-30T13:30:20
2024-05-30T13:30:22
1 minutes
111.17 Kb (113,840 bytes)
```cpp
#define NIM_INTBITS 64
#include "nimbase.h"
#include 2024-05-30T13:30:22
2024-05-30T13:30:23
1 minutes
111.17 Kb (113,840 bytes)
```cpp
#define NIM_INTBITS 64
#include "nimbase.h"
#include 2024-05-30T13:30:24
2024-05-30T13:30:25
1 minutes
111.17 Kb (113,840 bytes)
```cpp
#define NIM_INTBITS 64
#include "nimbase.h"
#include 2024-05-30T13:30:28
2024-05-30T13:30:29
1 minutes
101.16 Kb (103,584 bytes)
```cpp
#define NIM_INTBITS 64
#include "nimbase.h"
#include 2024-05-30T13:30:31
2024-05-30T13:30:32
101.16 Kb (103,584 bytes)
```cpp
#define NIM_INTBITS 64
#include "nimbase.h"
#include 2024-05-30T13:30:35
2024-05-30T13:30:35
88.94 Kb (91,072 bytes)
```cpp
#define NIM_INTBITS 64
#include "nimbase.h"
#include 2024-05-30T13:30:37
2024-05-30T13:30:38
88.94 Kb (91,072 bytes)
```cpp
#define NIM_INTBITS 64
#include "nimbase.h"
#include 2024-05-30T13:30:40
2024-05-30T13:30:40
11.4.0
14.0.0
20.3
2024-05-30T13:29:53Z
1
nim c --gc:orc --threads:on -d:nimArcDebug -d:nimArcIds --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
:robot: Bug found in 23 minutes
bisecting 8
commits at 0
commits per second
!nim c --gc:refc --threads:on
import os
proc threadMain() {.thread.} =
sleep(100000)
proc main(): Thread[void] =
var th: Thread[void]
createThread(th, threadMain)
return th
var th = main()
joinThread(th)
113.77 Kb (116,504 bytes)
```cpp
#define NIM_INTBITS 64
#include "nimbase.h"
#include 2024-05-30T13:36:31
2024-05-30T13:36:32
1 minutes
113.76 Kb (116,488 bytes)
```cpp
#define NIM_INTBITS 64
#include "nimbase.h"
#include 2024-05-30T13:36:33
2024-05-30T13:36:34
1 minutes
113.76 Kb (116,488 bytes)
```cpp
#define NIM_INTBITS 64
#include "nimbase.h"
#include 2024-05-30T13:36:34
2024-05-30T13:36:35
1 minutes
113.76 Kb (116,488 bytes)
```cpp
#define NIM_INTBITS 64
#include "nimbase.h"
#include 2024-05-30T13:36:38
2024-05-30T13:36:39
1 minutes
112.41 Kb (115,112 bytes)
```cpp
#define NIM_INTBITS 64
#include "nimbase.h"
#include 2024-05-30T13:36:42
2024-05-30T13:36:43
1 minutes
108.41 Kb (111,016 bytes)
```cpp
#define NIM_INTBITS 64
#include "nimbase.h"
#include 2024-05-30T13:36:46
2024-05-30T13:36:46
108.16 Kb (110,760 bytes)
```cpp
#define NIM_INTBITS 64
#include "nimbase.h"
#include 2024-05-30T13:36:49
2024-05-30T13:36:50
99.05 Kb (101,424 bytes)
```cpp
#define NIM_INTBITS 64
#include "nimbase.h"
#include 2024-05-30T13:36:52
2024-05-30T13:36:52
11.4.0
14.0.0
20.3
2024-05-30T13:36:01Z
2
nim c --gc:refc --threads:on --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
:robot: Bug found in 25 minutes
bisecting 8
commits at 0
commits per second
Same behaviour from 1.0 to devel, with ORC and refc.
Likely related is #24094. The thread address is not supposed to escape during the thread's lifetime. I'm not sure if this is supported but you can do something like:
import os
proc threadMain() {.thread.} =
sleep(1000)
proc main(): ref Thread[void] =
new(result)
createThread(result[], threadMain)
var th = main()
joinThread(th[])
echo "abc"
Description
Hello,
Apparently, it is not possible to create a thread var and return it from a proc. It causes a SIGSEV
Nim Version
nim v2.0.4 on Fedora
Current Output
Expected Output
No response
Possible Solution
No response
Additional Information
No response