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

Segmentation fault with pmap and some complex module structure??? #3732

Closed
jxy opened this issue Jul 16, 2013 · 2 comments
Closed

Segmentation fault with pmap and some complex module structure??? #3732

jxy opened this issue Jul 16, 2013 · 2 comments
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@jxy
Copy link

jxy commented Jul 16, 2013

I got the seg fault while restructuring my code and turning some of the map to pmap. I put three question marks in the title because I was not sure what exactly caused the seg fault, and I can not reproduce it with currently simplified code. One thing I am certain of is that if I used map instead of pmap, there were no seg faults.

The following is the shortest back trace I saved earlier.

* thread #1: tid = 0x1803, 0x00000001000344c4 libjulia-debug.dylib`jl_method_table_assoc_exact(mt=0x000000011017f780, args=0x00007fff5fbfd3e0, n=1) + 84 at gf.c:249, stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x00000001000344c4 libjulia-debug.dylib`jl_method_table_assoc_exact(mt=0x000000011017f780, args=0x00007fff5fbfd3e0, n=1) + 84 at gf.c:249
   246      jl_methlist_t *ml = JL_NULL;
   247      if (n > 0) {
   248          jl_value_t *a0 = args[0];
-> 249          jl_value_t *ty = (jl_value_t*)jl_typeof(a0);
   250          if (mt->cache_targ != JL_NULL && ty == (jl_value_t*)jl_datatype_type) {
   251              ml = mtcache_hash_lookup(mt->cache_targ, a0, 1);
   252              if (ml != JL_NULL)
(lldb) bt
* thread #1: tid = 0x1803, 0x00000001000344c4 libjulia-debug.dylib`jl_method_table_assoc_exact(mt=0x000000011017f780, args=0x00007fff5fbfd3e0, n=1) + 84 at gf.c:249, stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x00000001000344c4 libjulia-debug.dylib`jl_method_table_assoc_exact(mt=0x000000011017f780, args=0x00007fff5fbfd3e0, n=1) + 84 at gf.c:249
    frame #1: 0x0000000100034afd libjulia-debug.dylib`jl_apply_generic(F=0x00000001101827c0, args=0x00007fff5fbfd3e0, nargs=1) + 61 at gf.c:1371
    frame #2: 0x000000010003e3cc libjulia-debug.dylib`jl_apply(f=0x00000001101827c0, args=0x00007fff5fbfd3e0, nargs=1) + 76 at julia.h:1018
    frame #3: 0x000000010003e0fe libjulia-debug.dylib`jl_f_apply(F=0x000000010484e300, args=0x00007fff5fbfd538, nargs=2) + 1294 at builtins.c:291
    frame #4: 0x000000010f2384e1
    frame #5: 0x000000010003e3cc libjulia-debug.dylib`jl_apply(f=0x000000010ec97c60, args=0x00007fff5fbfd750, nargs=3) + 76 at julia.h:1018
    frame #6: 0x0000000100040ef2 libjulia-debug.dylib`jl_trampoline(F=0x000000010ec97c60, args=0x00007fff5fbfd750, nargs=3) + 546 at builtins.c:847
    frame #7: 0x0000000100032e0c libjulia-debug.dylib`jl_apply(f=0x000000010ec97c60, args=0x00007fff5fbfd750, nargs=3) + 76 at julia.h:1018
    frame #8: 0x0000000100034cd4 libjulia-debug.dylib`jl_apply_generic(F=0x0000000110230e40, args=0x00007fff5fbfd750, nargs=3) + 532 at gf.c:1401
    frame #9: 0x000000010003e3cc libjulia-debug.dylib`jl_apply(f=0x0000000110230e40, args=0x00007fff5fbfd750, nargs=3) + 76 at julia.h:1018
    frame #10: 0x000000010003e0fe libjulia-debug.dylib`jl_f_apply(F=0x000000010484e300, args=0x00007fff5fbfd870, nargs=3) + 1294 at builtins.c:291
    frame #11: 0x000000010f23813b
    frame #12: 0x000000010003e3cc libjulia-debug.dylib`jl_apply(f=0x000000010ec97c20, args=0x00007fff5fbfd998, nargs=1) + 76 at julia.h:1018
    frame #13: 0x0000000100040ef2 libjulia-debug.dylib`jl_trampoline(F=0x000000010ec97c20, args=0x00007fff5fbfd998, nargs=1) + 546 at builtins.c:847
    frame #14: 0x0000000102d1d544
    frame #15: 0x000000010f237c8b
    frame #16: 0x000000010003e3cc libjulia-debug.dylib`jl_apply(f=0x000000010ee57780, args=0x0000000104fddf90, nargs=3) + 76 at julia.h:1018
    frame #17: 0x0000000100040ef2 libjulia-debug.dylib`jl_trampoline(F=0x000000010ee57780, args=0x0000000104fddf90, nargs=3) + 546 at builtins.c:847
    frame #18: 0x0000000100032e0c libjulia-debug.dylib`jl_apply(f=0x000000010ee57780, args=0x0000000104fddf90, nargs=3) + 76 at julia.h:1018
    frame #19: 0x0000000100034cd4 libjulia-debug.dylib`jl_apply_generic(F=0x0000000110230e40, args=0x0000000104fddf90, nargs=3) + 532 at gf.c:1401
    frame #20: 0x000000010003e3cc libjulia-debug.dylib`jl_apply(f=0x0000000110230e40, args=0x0000000104fddf90, nargs=3) + 76 at julia.h:1018
    frame #21: 0x000000010003e1f9 libjulia-debug.dylib`jl_f_apply(F=0x000000010484e300, args=0x00007fff5fbfdf70, nargs=3) + 1545 at builtins.c:297
    frame #22: 0x000000010f21a292
    frame #23: 0x000000010003e3cc libjulia-debug.dylib`jl_apply(f=0x0000000111abf160, args=0x00007fff5fbfe190, nargs=8) + 76 at julia.h:1018
    frame #24: 0x0000000100040ef2 libjulia-debug.dylib`jl_trampoline(F=0x0000000111abf160, args=0x00007fff5fbfe190, nargs=8) + 546 at builtins.c:847
    frame #25: 0x0000000100032e0c libjulia-debug.dylib`jl_apply(f=0x0000000111abf160, args=0x00007fff5fbfe190, nargs=8) + 76 at julia.h:1018
    frame #26: 0x0000000100034cd4 libjulia-debug.dylib`jl_apply_generic(F=0x00000001101b6f80, args=0x00007fff5fbfe190, nargs=8) + 532 at gf.c:1401
    frame #27: 0x000000010003e3cc libjulia-debug.dylib`jl_apply(f=0x00000001101b6f80, args=0x00007fff5fbfe190, nargs=8) + 76 at julia.h:1018
    frame #28: 0x000000010003e0fe libjulia-debug.dylib`jl_f_apply(F=0x000000010484e300, args=0x00007fff5fbfe358, nargs=3) + 1294 at builtins.c:291
    frame #29: 0x000000010f218f11
    frame #30: 0x000000010003e3cc libjulia-debug.dylib`jl_apply(f=0x000000010ff64460, args=0x00007fff5fbfe6d8, nargs=3) + 76 at julia.h:1018
    frame #31: 0x0000000100040ef2 libjulia-debug.dylib`jl_trampoline(F=0x000000010ff64460, args=0x00007fff5fbfe6d8, nargs=3) + 546 at builtins.c:847
    frame #32: 0x0000000100032e0c libjulia-debug.dylib`jl_apply(f=0x000000010ff64460, args=0x00007fff5fbfe6d8, nargs=3) + 76 at julia.h:1018
    frame #33: 0x0000000100034cd4 libjulia-debug.dylib`jl_apply_generic(F=0x00000001101b7020, args=0x00007fff5fbfe6d8, nargs=3) + 532 at gf.c:1401
    frame #34: 0x000000010003e3cc libjulia-debug.dylib`jl_apply(f=0x00000001101b7020, args=0x00007fff5fbfe6d8, nargs=3) + 76 at julia.h:1018
    frame #35: 0x000000010003e889 libjulia-debug.dylib`jl_f_kwcall(F=0x000000010484e140, args=0x00007fff5fbfe688, nargs=13) + 1161 at builtins.c:365
    frame #36: 0x00000001000a9eac libjulia-debug.dylib`jl_apply(f=0x000000010484e140, args=0x00007fff5fbfe688, nargs=13) + 76 at julia.h:1018
    frame #37: 0x00000001000a9d6e libjulia-debug.dylib`do_call(f=0x000000010484e140, args=0x000000010f8d5f58, nargs=13, locals=0x00007fff5fbfec00, nl=1) + 318 at interpreter.c:56
    frame #38: 0x00000001000a7daf libjulia-debug.dylib`eval(e=0x00000001101b71e0, locals=0x00007fff5fbfec00, nl=1) + 1871 at interpreter.c:160
    frame #39: 0x00000001000a9927 libjulia-debug.dylib`eval_body(stmts=0x000000011017bee0, locals=0x00007fff5fbfec00, nl=1, start=0) + 455 at interpreter.c:407
    frame #40: 0x00000001000a971a libjulia-debug.dylib`jl_interpret_toplevel_thunk_with(lam=0x0000000110154580, loc=0x0000000000000000, nl=1) + 458 at interpreter.c:457
    frame #41: 0x00000001000a9ae3 libjulia-debug.dylib`jl_interpret_toplevel_thunk(lam=0x0000000110154580) + 51 at interpreter.c:464
    frame #42: 0x00000001000bdc37 libjulia-debug.dylib`jl_toplevel_eval_flex(e=0x00000001101b70e0, fast=1) + 2135 at toplevel.c:394
    frame #43: 0x00000001000be7b9 libjulia-debug.dylib`jl_parse_eval_all(fname=0x0000000104855980) + 377 at toplevel.c:427
    frame #44: 0x00000001000be9a9 libjulia-debug.dylib`jl_load(fname=0x0000000104855980) + 217 at toplevel.c:459
    frame #45: 0x00000001000bea4b libjulia-debug.dylib`jl_load_(str=0x000000010d822360) + 43 at toplevel.c:469
    frame #46: 0x0000000102d49102
    frame #47: 0x0000000102d48e63
    frame #48: 0x000000010003e3cc libjulia-debug.dylib`jl_apply(f=0x0000000103de4ca0, args=0x00007fff5fbff438, nargs=1) + 76 at julia.h:1018
    frame #49: 0x0000000100040ef2 libjulia-debug.dylib`jl_trampoline(F=0x0000000103de4ca0, args=0x00007fff5fbff438, nargs=1) + 546 at builtins.c:847
    frame #50: 0x0000000100032e0c libjulia-debug.dylib`jl_apply(f=0x0000000103de4ca0, args=0x00007fff5fbff438, nargs=1) + 76 at julia.h:1018
    frame #51: 0x0000000100034cd4 libjulia-debug.dylib`jl_apply_generic(F=0x0000000103de4c60, args=0x00007fff5fbff438, nargs=1) + 532 at gf.c:1401
    frame #52: 0x0000000102d47e96
    frame #53: 0x000000010003e3cc libjulia-debug.dylib`jl_apply(f=0x000000010387b420, args=0x00007fff5fbff668, nargs=1) + 76 at julia.h:1018
    frame #54: 0x0000000100040ef2 libjulia-debug.dylib`jl_trampoline(F=0x000000010387b420, args=0x00007fff5fbff668, nargs=1) + 546 at builtins.c:847
    frame #55: 0x0000000100032e0c libjulia-debug.dylib`jl_apply(f=0x000000010387b420, args=0x00007fff5fbff668, nargs=1) + 76 at julia.h:1018
    frame #56: 0x0000000100034cd4 libjulia-debug.dylib`jl_apply_generic(F=0x000000010387b3e0, args=0x00007fff5fbff668, nargs=1) + 532 at gf.c:1401
    frame #57: 0x0000000102d00d51
    frame #58: 0x0000000102d00a40
    frame #59: 0x000000010003e3cc libjulia-debug.dylib`jl_apply(f=0x0000000103aaf880, args=0x0000000000000000, nargs=0) + 76 at julia.h:1018
    frame #60: 0x0000000100040ef2 libjulia-debug.dylib`jl_trampoline(F=0x0000000103aaf880, args=0x0000000000000000, nargs=0) + 546 at builtins.c:847
    frame #61: 0x0000000100032e0c libjulia-debug.dylib`jl_apply(f=0x0000000103aaf880, args=0x0000000000000000, nargs=0) + 76 at julia.h:1018
    frame #62: 0x0000000100034cd4 libjulia-debug.dylib`jl_apply_generic(F=0x0000000103aaf800, args=0x0000000000000000, nargs=0) + 532 at gf.c:1401
    frame #63: 0x0000000100001f1c julia-debug-basic`jl_apply(f=0x0000000103aaf800, args=0x0000000000000000, nargs=0) + 76 at julia.h:1018
    frame #64: 0x00000001000021ce julia-debug-basic`true_main(argc=1, argv=0x00007fff5fbffbc0) + 462 at repl.c:263
    frame #65: 0x00000001000b297f libjulia-debug.dylib`julia_trampoline(argc=1, argv=0x00007fff5fbffbc0, pmain=0x0000000100002000) + 207 at init.c:696
    frame #66: 0x000000010000272b julia-debug-basic`main(argc=1, argv=0x00007fff5fbffbc0) + 171 at repl.c:303
    frame #67: 0x00000001000016d4 julia-debug-basic`start + 52

The longest backtrace I saw had a frame number up to 7000. I cannot give a minimal code example. Somehow when the code gets simplified, the issue went away. Now I am not writing my code in multiple modules, I also don't see the issue. I hope someone here might get some idea from this backtrace. Please let me know if I can be of further help.

@JeffBezanson
Copy link
Member

Without the code I won't be able to confirm whether we have fixed this, but it would be good to keep the failing code around and retry it every so often as we commit bug fixes to see if we address it.

@jxy
Copy link
Author

jxy commented Jul 18, 2013

You are right. It is quite a bad bug report. I just instinctively ran it through lldb, but since I was focusing on getting the code to work, I didn't bother to keep the environment.

Keno pushed a commit that referenced this issue Dec 21, 2023
Stdlib: Pkg
URL: https://github.com/JuliaLang/Pkg.jl.git
Stdlib branch: master
Julia branch: master
Old commit: 85f1e5564
New commit: 3c86ba27e
Julia version: 1.11.0-DEV
Pkg version: 1.11.0
Bump invoked by: @IanButterworth
Powered by:
[BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl)

Diff:
JuliaLang/Pkg.jl@85f1e55...3c86ba2

```
$ git log --oneline 85f1e5564..3c86ba27e
3c86ba27e add `add --weak/extra Foo` to add to [weakdeps] or [extras] (#3708)
2e640f92f respect --color=no in Pkg.precompile (#3740)
cbd5d08ad Automatically add compat entries when adding deps to a package (#3732)
03de920b3 rm old manual handling of `--compiled-modules` (#3738)
314d5497b Use realpaths for temp dirs during tests. Fix SparseArrays `why` breakage (#3734)
a6531d4be environments.md: update Julia version (#3715)
a509bc062 Revise the API of is_manifest_current. (#3701)
60b7b7995 rm incorrect kwargs in add docstring (#3733)
```

Co-authored-by: Dilum Aluthge <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants