HVM icon indicating copy to clipboard operation
HVM copied to clipboard

hvm-c segfaults with some programs

Open developedby opened this issue 1 year ago • 3 comments

Describe the bug Some programs are causing hvm-c to run into a segmentation fault. As reported in https://github.com/HigherOrderCO/Bend/issues/397.

To Reproduce Run this program with bend run-c https://github.com/HigherOrderCO/Bend/files/15368994/sat.bend.txt Or the compiled-to-hvm version with hvm run-c https://github.com/HigherOrderCO/Bend/files/15368996/sat.hvm.txt

Another user reported on discord a segfault when running a simple hello world with bend run-c, but I haven't been able to reproduce

def main():
  return "Hello, world!"

User says: "I am running on WSL2 under Windows 10"

developedby avatar May 19 '24 11:05 developedby

Another case of SIGSEGV in bend run-c, on Mac M1 Pro:

def testArrayMapArrayNonrecursive(_):
  * = lambda x: x+1
  return 1

def main():
  return 1

Interestingly, either removing the lambda definition or renaming the test eg. to y makes the error go away.

The renaming behaviour makes me think this might be related to https://github.com/HigherOrderCO/HVM/pull/305

Janiczek avatar May 19 '24 17:05 Janiczek

I get SIGSEGV no matter the bend script I run. Any program I wrote and ran with bend run-c resulted in SIGSEGV.

OS: WSL2 under Windows 10 CPU: Ryzen 9 5950x

zylkowski avatar May 19 '24 17:05 zylkowski

This one was fixed with larger names I believe, right?

VictorTaelin avatar May 23 '24 01:05 VictorTaelin

Closing as I can't reprocude. If a segfault comes up again another issue should be opened.

enricozb avatar Jun 17 '24 10:06 enricozb

I have this issue.

OS: ubuntu on WSL2 on win11 GPU: nividia geforece 940MX

hvm 2.0.22 bend-lang 0.2.36

nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2023 NVIDIA Corporation Built on Fri_Jan__6_16:45:21_PST_2023 Cuda compilation tools, release 12.0, V12.0.140 Build cuda_12.0.r12.0/compiler.32267302_0

gcc (Ubuntu 12.3.0-17ubuntu1) 12.3.0

g++ (Ubuntu 12.3.0-17ubuntu1) 12.3.0

hvm run runs perfectly hvm run-c Segmentation fault on every program including

def main:
  return "test"

i compiled it to .hvm first then run it using hvm of cause.

hvm run-cu will cause Infinite Loop

sinsikyan avatar Aug 17 '24 13:08 sinsikyan

I have this issue.

OS: ubuntu on WSL2 on win11 GPU: nividia geforece 940MX

hvm 2.0.22 bend-lang 0.2.36

nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2023 NVIDIA Corporation Built on Fri_Jan__6_16:45:21_PST_2023 Cuda compilation tools, release 12.0, V12.0.140 Build cuda_12.0.r12.0/compiler.32267302_0

gcc (Ubuntu 12.3.0-17ubuntu1) 12.3.0

g++ (Ubuntu 12.3.0-17ubuntu1) 12.3.0

hvm run runs perfectly hvm run-c Segmentation fault on every program including

def main:
  return "test"

i compiled it to .hvm first then run it using hvm of cause.

hvm run-cu will cause Infinite Loop

Can you please open a new issue for this?

developedby avatar Aug 21 '24 11:08 developedby