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

nim c -c SIGSEGV regression between 1.6 and 2.0, both refc and ORC #22187

Closed
tersec opened this issue Jun 29, 2023 · 1 comment · Fixed by #22189
Closed

nim c -c SIGSEGV regression between 1.6 and 2.0, both refc and ORC #22187

tersec opened this issue Jun 29, 2023 · 1 comment · Fixed by #22189

Comments

@tersec
Copy link
Contributor

tersec commented Jun 29, 2023

Description

template m(T: type, s: int64): int64 = s
func p(n: int64): int = int(n)
type F[T; s: static int64] = object
  k: array[p(m(T, s)), int64]

The compilation (mis)behaves the same way under refc and ORC under each tested compiler version, version-1-6 (1.6.14), version-2-0 (e8d0f1c3aedd8290cc972e3d06f642e88dbe783e), and devel (41ec894cb0aa0b0d233a0f62ff4929d64ddad3a7).

Nim Version

Compiles successfully:

Nim Compiler Version 1.6.14 [Linux: amd64]
Compiled at 2023-06-29
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: 71ba2e7f3c5815d956b1ae0341b0743242b8fec6
active boot switches: -d:release

Regression between 1.6 and 2.0, so these SIGSEGV.

version-2-0:

Nim Compiler Version 1.9.5 [Linux: amd64]
Compiled at 2023-06-29
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: e8d0f1c3aedd8290cc972e3d06f642e88dbe783e
active boot switches: -d:release

devel:

Nim Compiler Version 1.9.5 [Linux: amd64]
Compiled at 2023-06-29
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: 41ec894cb0aa0b0d233a0f62ff4929d64ddad3a7
active boot switches: -d:release

Current Output

SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Segmentation fault

Expected Output

Not a SIGSEGV

Possible Solution

No response

Additional Information

No response

@metagn
Copy link
Collaborator

metagn commented Jun 29, 2023

This is caused by #22029 (I wrote about (U + 1) * 2, the problem is the nested call), I thought it was pre-existing so I didn't look into it

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 a pull request may close this issue.

2 participants