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

segfault running julialang/julia#3775 #22

Closed
ViralBShah opened this issue Jul 20, 2013 · 10 comments
Closed

segfault running julialang/julia#3775 #22

ViralBShah opened this issue Jul 20, 2013 · 10 comments

Comments

@ViralBShah
Copy link

I get a segfault running this from JuliaLang/julia#3775

@sprofile let 
              tic()
              n = 10000;
              m = 100;
              l = 10;
              A = zeros(n,m);
              for i=1:n
                  for j=1:m
                      c = rand(10,10);
                      A[i,j] = c[2,5];
                  end
                  h = find(A[i,:].>0.5);
                  for k=1:l
                      c = fft(A[:,l]);
                      d = min(abs(c));
                  end
              end
              toc()
              end;

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000f78
0x00007fff8d327610 in libunwind::CompactUnwinder_x86_64<libunwind::LocalAddressSpace>::stepWithCompactEncodingRBPFrame ()
(gdb) bt
#0  0x00007fff8d327610 in libunwind::CompactUnwinder_x86_64<libunwind::LocalAddressSpace>::stepWithCompactEncodingRBPFrame ()
#1  0x00007fff8d32758f in libunwind::CompactUnwinder_x86_64<libunwind::LocalAddressSpace>::stepWithCompactEncoding ()
#2  0x00007fff8d32750e in libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::step ()
#3  0x00000001002ccbb6 in rec_backtrace (data=0x104037b88, maxsize=971470) at task.c:533
#4  0x00000001011fcd18 in sprofile_bt ()
#5  <signal handler called>
#6  0x00007fff92bf8831 in free ()
#7  0x000000010ba03dc8 in hinsert ()
@timholy
Copy link
Owner

timholy commented Jul 20, 2013

Did not segfault for me on Kubuntu 12.04. Are you on OSX? If so, this is presumably the same as #14.

@ViralBShah
Copy link
Author

Yes, I am on OS X, and I suspect it is the same thing.

@timholy
Copy link
Owner

timholy commented Jul 20, 2013

OK, closing. If you get evidence that this is somehow different, feel free to reopen.

@timholy timholy closed this as completed Jul 20, 2013
@ViralBShah
Copy link
Author

Sure. I just wanted it recorded here, so that it is yet another test case, if we do ever find a way to fix #14. I am hoping that @loladiro 's recent work on OS X backtraces might help.

@Keno
Copy link

Keno commented Jul 20, 2013

@timholy You might want to try if you can make this work for OS X: http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_sample.html . The basic implementation should be similar to my recent pull request against julia. If you need help figuring this out, feel free to ping me.

@Keno
Copy link

Keno commented Jul 20, 2013

There's also http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/thread_sample.html, which might actually be better in this case.

@timholy
Copy link
Owner

timholy commented Jul 24, 2013

Thanks @loladiro. I may give this a go at some point, though I'll need willing testers on the Mac.

From another perspective, what's probably happening is that Profile is revealing a bug in Julia's backtraces. For what may be a separate problem, that eventually became clear in JuliaLang/julia#3469. So in a sense maybe it's better not to fix it by working around the problem specifically in Profile, but to focus our attention on the Julia side.

@ViralBShah
Copy link
Author

I am happy to test!

@timholy
Copy link
Owner

timholy commented Jul 24, 2013

:-)

@vtjnash
Copy link

vtjnash commented Aug 10, 2013

It's interesting to walk the stack for this in gdb -- the frame before it faults has the instruction pointer off by one. I'm not sure how the sigtramp function would cause this (it appears to be is approximately apple's version of sigreturn).

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

4 participants