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

A Julia Example #176

Closed
SchrodingerZhu opened this issue May 6, 2020 · 9 comments
Closed

A Julia Example #176

SchrodingerZhu opened this issue May 6, 2020 · 9 comments

Comments

@SchrodingerZhu
Copy link
Collaborator

https://discourse.julialang.org/t/julia-vs-microsofts-rust-inspired-verona-language-and-e-g-snmalloc-allocator/38610/3

Seems that snmalloc runs into some performance issues and wrong memory issues here.

@mjp41
Copy link
Member

mjp41 commented May 6, 2020

The crash looks like it is not freeing with snmalloc:

munmap_chunk

Is not part of snmalloc. So we are not intercepting something there.

The perf is hard unless we can repro. I wonder if it is the debug version they are running?

@SchrodingerZhu
Copy link
Collaborator Author

SchrodingerZhu commented May 6, 2020 via email

@mjp41
Copy link
Member

mjp41 commented May 6, 2020

Perhaps, we should default the build, and then we would avoid this in the future.

@SchrodingerZhu
Copy link
Collaborator Author

SchrodingerZhu commented May 6, 2020

BTW, I have checked that, indeed, Julia is still trying to free some memory using libc even with snmalloc preloaded. A possible solution to check the improvement with is to rebuild Julia with snmalloc (seems that libc is invoked by libjulia.so), but its build system is plain GNU Make and I do not feel like having a try now.

@mjp41
Copy link
Member

mjp41 commented May 6, 2020

A stack trace of that call is probably enough to work out what we aren't intercepting?

@mjp41
Copy link
Member

mjp41 commented May 6, 2020

It seems looking at the discource page it is calling cfree

@mjp41
Copy link
Member

mjp41 commented May 6, 2020

I've exposed cfree in #179 hopefully this will fix the failing example.

@SchrodingerZhu
Copy link
Collaborator Author

@mjp41 unfortunately the commit does not fix the issue.

munmap_chunk(): invalid pointer

signal (6): Aborted
in expression starting at REPL[1]:1
gsignal at /usr/bin/../lib/libc.so.6 (unknown line)
abort at /usr/bin/../lib/libc.so.6 (unknown line)
__libc_message at /usr/bin/../lib/libc.so.6 (unknown line)
malloc_printerr at /usr/bin/../lib/libc.so.6 (unknown line)
munmap_chunk at /usr/bin/../lib/libc.so.6 (unknown line)
close_unit_1 at /build/gcc/src/gcc/libgfortran/io/unit.c:743
close_units at /build/gcc/src/gcc/libgfortran/io/unit.c:798
_dl_fini at /lib64/ld-linux-x86-64.so.2 (unknown line)
__run_exit_handlers at /usr/bin/../lib/libc.so.6 (unknown line)
exit at /usr/bin/../lib/libc.so.6 (unknown line)
jl_exit at /usr/bin/../lib/libjulia.so.1 (unknown line)
unknown function (ip: 0x7fd3567f199b)
unknown function (ip: 0x7fd3567f19a5)
unknown function (ip: 0x7fd36b697855)
unknown function (ip: 0x7fd36b6974fa)
unknown function (ip: 0x7fd36b698d84)
unknown function (ip: 0x7fd36b699832)
unknown function (ip: 0x7fd36b6b7371)
unknown function (ip: 0x7fd36b6b7a08)
jl_toplevel_eval_in at /usr/bin/../lib/libjulia.so.1 (unknown line)
unknown function (ip: 0x7fd35658be04)
unknown function (ip: 0x7fd3567b1bf9)
unknown function (ip: 0x7fd3567b1ef4)
unknown function (ip: 0x7fd36b69d439)
unknown function (ip: (nil))
Allocations: 2504 (Pool: 2494; Big: 10); GC: 0

I do not think it is snmalloc's fault.

I have traced into unit.c file on the GCC mirror at GitHub, line 743 is simply a free.

@SchrodingerZhu
Copy link
Collaborator Author

I think the problem is not related to snmalloc anymore.

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