Segmentation fault over larger arrays
See original GitHub issueHi,
I’ve been having issues with running PySR over larger input arrays. For instance, by modifying the input size in the example:
from pysr import pysr, best, get_hof
# Dataset
X = 2*np.random.randn(300000, 8) #changed from (100,5) to (300000, 8)
y = 2*np.cos(X[:, 3]) + X[:, 0]**2 - 2
# Learn equations
equations = pysr(X, y, niterations=5,
binary_operators=["plus", "mult"],
unary_operators=["cos", "exp", "sin"])
Results in the following trace output:
From worker 3:
From worker 3: signal (11): Segmentation fault
From worker 3: in expression starting at none:0
From worker 3: unknown function (ip: (nil))
From worker 3: Allocations: 14006734 (Pool: 14002705; Big: 4029); GC: 14
From worker 5:
From worker 5: signal (11): Segmentation fault
From worker 5: in expression starting at none:0
From worker 5: unknown function (ip: (nil))
From worker 5: Allocations: 14006758 (Pool: 14002728; Big: 4030); GC: 14
From worker 4:
From worker 4: signal (11): Segmentation fault
From worker 4: in expression starting at none:0
From worker 4: unknown function (ip: (nil))
From worker 4: Allocations: 14006745 (Pool: 14002716; Big: 4029); GC: 14
Couldn't find equation file!
I have replicated this behaviour across different machines, and for each I am fairly certain I have sufficient resources to hold the data in memory, so it’s not clear to me what the issue is.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Segmentation fault on large array sizes - c++ - Stack Overflow
The array is too big to fit in your program's stack region ; the stack growth limit is usually 8 MiB or 1...
Read more >Annoying segfault problem with large array. : r/C_Programming
Hello all. I am working with a large(ish) array. I am aware that large arrays should be allocated to the heap with malloc()...
Read more >Can we have more than 1000000 elements in an array? yes, but
It says “segmentation fault: core dumped”. I can stop here and just use 10,00,000 elements for my analysis. But I'm curious why C...
Read more >How to solve a segmentation fault while using an array in C ...
Hi, In programming in C and C++, error segmentation fault is occur when either array is out of index and you are accessing...
Read more >Segmentation Fault when dealing with big array in Vivado HLS
I also recommend reducing the array sizes to a smaller version. Verify that this works, then go back to the larger array sizes....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I can confirm as well that it is working now. Thanks for the fix and for the advice! I’ll close this issue since it has been resolved.
Okay, good. I think I know the seg fault’s cause. I’ll let you know when the fix is up.
Cheers, Miles