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

zeroes(1,1,0) & zeroes(1,1,0) segfaults #429

Closed
falsifian opened this issue Apr 23, 2023 · 1 comment
Closed

zeroes(1,1,0) & zeroes(1,1,0) segfaults #429

falsifian opened this issue Apr 23, 2023 · 1 comment

Comments

@falsifian
Copy link
Contributor

pdl> zeroes(1,1,0) & zeroes(1,1,0)
Segmentation fault (core dumped) 

This is PDL 2.081 on OpenBSD current on amd64.

@mohawk2
Copy link
Member

mohawk2 commented Apr 26, 2023

For the sake of posterity: looping in PDL operates at 3 levels:

  • there are each operation's "inherent" dimensions (which might be none, for a dimensionless/scalar operation like addition), over which any broadcasting happens; any loops happen within each operation's code
  • there are two further dimension that happen in the "inner loop" generated for each readdata/writebackdata
  • anything above that gets managed by startbroadcastloop which sets up data structures, and iterbroadcastloop which moves along higher dimensions until done

The two inner loops already knew about dealing with empties, because they are implemented with two for loops, which are a while loop with extra stuff, but that didn't help here because the and2 operation is dimensionless, and the two inner-loop dims had 1 each. The iterbroadcastloop knew how to stop correctly.

However, the startbroadcastloop did not check for empty and do nothing; the commit above changes that, and now all works correctly.

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

No branches or pull requests

2 participants