-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Objects can protect illegal recursion but tuples cant #23885
Comments
This example comes from a CI failure in an unrelated PR that is crashing code very similar in karax: https://github.com/karaxnim/karax/blob/f4014d134ff48e118eb4810e9ebceb2920f1af1b/karax/vdom.nim#L152 |
!nim c type
EventHandler = proc(target: BB)
BB = (EventHandler,) |
🐧 Linux bisect by @juancarlospaco (collaborator)devel 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("EventHandler"),
newEmptyNode(),
nnkProcTy.newTree(
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("target"),
newIdentNode("BB"),
newEmptyNode()
)
),
newEmptyNode()
)
),
nnkTypeDef.newTree(
newIdentNode("BB"),
newEmptyNode(),
nnkTupleConstr.newTree(
newIdentNode("EventHandler")
)
)
)
) stable 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("EventHandler"),
newEmptyNode(),
nnkProcTy.newTree(
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("target"),
newIdentNode("BB"),
newEmptyNode()
)
),
newEmptyNode()
)
),
nnkTypeDef.newTree(
newIdentNode("BB"),
newEmptyNode(),
nnkTupleConstr.newTree(
newIdentNode("EventHandler")
)
)
)
) 2.0.4 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("EventHandler"),
newEmptyNode(),
nnkProcTy.newTree(
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("target"),
newIdentNode("BB"),
newEmptyNode()
)
),
newEmptyNode()
)
),
nnkTypeDef.newTree(
newIdentNode("BB"),
newEmptyNode(),
nnkTupleConstr.newTree(
newIdentNode("EventHandler")
)
)
)
) 2.0.0 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("EventHandler"),
newEmptyNode(),
nnkProcTy.newTree(
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("target"),
newIdentNode("BB"),
newEmptyNode()
)
),
newEmptyNode()
)
),
nnkTypeDef.newTree(
newIdentNode("BB"),
newEmptyNode(),
nnkTupleConstr.newTree(
newIdentNode("EventHandler")
)
)
)
) 1.6.20 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("EventHandler"),
newEmptyNode(),
nnkProcTy.newTree(
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("target"),
newIdentNode("BB"),
newEmptyNode()
)
),
newEmptyNode()
)
),
nnkTypeDef.newTree(
newIdentNode("BB"),
newEmptyNode(),
nnkTupleConstr.newTree(
newIdentNode("EventHandler")
)
)
)
) 1.4.8 👍 OKOutput
IRCompiled filesize91.16 Kb (93,344 bytes)
#define NIM_INTBITS 64
#include "nimbase.h"
#define nimfr_(x, y)
#define nimln_(x, y)
static N_INLINE(void, initStackBottomWith)(void* locals);
N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom);
N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static N_INLINE(void, initStackBottomWith)(void* locals) {
nimGC_setStackBottom(locals);
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
void (*volatile inner)(void);
inner = PreMainInner;
systemDatInit000();
initStackBottomWith((void *)&inner);
systemInit000();
(*inner)();
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
void (*volatile inner)(void);
PreMain();
inner = NimMainInner;
initStackBottomWith((void *)&inner);
(*inner)();
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
}
} Stats
1.2.18 👍 OKOutput
IRCompiled filesize86.88 Kb (88,968 bytes)
#define NIM_INTBITS 64
#include "nimbase.h"
#define nimfr_(x, y)
#define nimln_(x, y)
static N_INLINE(void, initStackBottomWith)(void* locals);
N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom);
N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static N_INLINE(void, initStackBottomWith)(void* locals) {
nimGC_setStackBottom(locals);
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
void (*volatile inner)(void);
inner = PreMainInner;
systemDatInit000();
initStackBottomWith((void *)&inner);
systemInit000();
(*inner)();
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
void (*volatile inner)(void);
PreMain();
inner = NimMainInner;
initStackBottomWith((void *)&inner);
(*inner)();
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
}
} Stats
1.0.10 👍 OKOutput
IRCompiled filesize81.98 Kb (83,952 bytes)
#define NIM_INTBITS 64
#include "nimbase.h"
#define nimfr_(x, y)
#define nimln_(x, y)
static N_INLINE(void, initStackBottomWith)(void* locals);
N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom);
N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static N_INLINE(void, initStackBottomWith)(void* locals) { nimGC_setStackBottom(locals);
}
void PreMainInner(void) {
}
int cmdCount;
char** cmdLine;
char** gEnv;
void PreMain(void) {
void (*volatile inner)(void);
inner = PreMainInner;
systemDatInit000();
initStackBottomWith((void *)&inner);
systemInit000();
(*inner)();
}
N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
void (*volatile inner)(void);
PreMain();
inner = NimMainInner;
initStackBottomWith((void *)&inner);
(*inner)();
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
}
} Stats
#0286a0879 ➡️ 🐛Diagnosticscooldome introduced a bug at
The bug is in the files:
The bug can be in the commits: (Diagnostics sometimes off-by-one). Stats
🤖 Bug found in |
@Graveflo see #23885 (comment) looks like #16658 is the cause... |
Description
Posting this so I don't forget, it might have been documented already. This appears to sigsev the compiler on a version before #23869 and now infinitely recurses. I guess that means it may be solvable from the same place IE
liftParamType
but this is fine:
Nim Version
Nim Compiler Version 2.1.9 [Linux: amd64]
Compiled at 2024-07-23
Copyright (c) 2006-2024 by Andreas Rumpf
git hash: 8d7f932
Current Output
Expected Output
Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: