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

jl_typename_type->type is uninitialized? #1314

Closed
nolta opened this issue Sep 27, 2012 · 4 comments
Closed

jl_typename_type->type is uninitialized? #1314

nolta opened this issue Sep 27, 2012 · 4 comments

Comments

@nolta
Copy link
Member

nolta commented Sep 27, 2012

I've been seeing a lot of random crashes lately, so i ran julia through valgrind:

$ valgrind --track-origins=yes ./usr/bin/julia-debug-basic 
==25701== Memcheck, a memory error detector
==25701== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==25701== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==25701== Command: ./usr/bin/julia-debug-basic
==25701== 
--25701-- WARNING: Serious error when reading debug info
--25701-- When reading debug info from /scratch/r/rbond/nolta/julia/usr/lib/libjulia-debug.so:
--25701-- DWARF line info appears to be corrupt - the section is too small
==25701== Conditional jump or move depends on uninitialised value(s)
==25701==    at 0x54FB398: emit_getfield(_jl_value_t*, _jl_sym_t*, jl_codectx_t*) (codegen.cpp:699)
==25701==    by 0x54FDE87: emit_known_call(_jl_value_t*, _jl_value_t**, unsigned long, jl_codectx_t*, llvm::Value**, llvm::Value**, _jl_value_t*) (codegen.cpp:1084)
==25701==    by 0x54FE50D: emit_call(_jl_value_t**, unsigned long, jl_codectx_t*, _jl_value_t*) (codegen.cpp:1150)
==25701==    by 0x5500358: emit_expr(_jl_value_t*, jl_codectx_t*, bool, bool) (codegen.cpp:1463)
==25701==    by 0x54FBC81: emit_known_call(_jl_value_t*, _jl_value_t**, unsigned long, jl_codectx_t*, llvm::Value**, llvm::Value**, _jl_value_t*) (codegen.cpp:795)
==25701==    by 0x54FE50D: emit_call(_jl_value_t**, unsigned long, jl_codectx_t*, _jl_value_t*) (codegen.cpp:1150)
==25701==    by 0x5500358: emit_expr(_jl_value_t*, jl_codectx_t*, bool, bool) (codegen.cpp:1463)
==25701==    by 0x5503C2C: emit_function(_jl_lambda_info_t*, llvm::Function*) (codegen.cpp:2014)
==25701==    by 0x54E9EEC: to_function(_jl_lambda_info_t*) (codegen.cpp:170)
==25701==    by 0x54EA340: jl_compile (codegen.cpp:230)
==25701==    by 0x54E7759: jl_trampoline (builtins.c:669)
==25701==    by 0x54DDB48: jl_apply (julia.h:901)
==25701==  Uninitialised value was created by a heap allocation
==25701==    at 0x4C27223: malloc (vg_replace_malloc.c:263)
==25701==    by 0x55328BE: add_page (gc.c:319)
==25701==    by 0x55329C3: pool_alloc (gc.c:346)
==25701==    by 0x55337D7: allocobj (gc.c:767)
==25701==    by 0x5523884: newobj (newobj_internal.h:6)
==25701==    by 0x5524EC2: jl_new_uninitialized_struct_type (alloc.c:514)
==25701==    by 0x54DBBB1: jl_init_types (jltypes.c:2247)
==25701==    by 0x552810E: julia_init (init.c:159)
==25701==    by 0x402648: main (repl.c:292)
==25701== 
==25701== Conditional jump or move depends on uninitialised value(s)
==25701==    at 0x54DE044: mtcache_hash_lookup (gf.c:153)
==25701==    by 0x54DE57F: jl_method_table_assoc_exact (gf.c:266)
==25701==    by 0x54E1406: jl_apply_generic (gf.c:1309)
==25701==    by 0x404ACF7: ???
==25701==    by 0x54E4D9E: jl_apply (julia.h:901)
==25701==    by 0x54E77AE: jl_trampoline (builtins.c:672)
==25701==    by 0x54DDB48: jl_apply (julia.h:901)
==25701==    by 0x54E15A4: jl_apply_generic (gf.c:1339)
==25701==    by 0x401A22: jl_apply (julia.h:901)
==25701==    by 0x40242E: true_main (repl.c:249)
==25701==    by 0x5528816: julia_trampoline (init.c:290)
==25701==    by 0x402660: main (repl.c:293)
==25701==  Uninitialised value was created by a heap allocation
==25701==    at 0x4C27223: malloc (vg_replace_malloc.c:263)
==25701==    by 0x55328BE: add_page (gc.c:319)
==25701==    by 0x55329C3: pool_alloc (gc.c:346)
==25701==    by 0x55337D7: allocobj (gc.c:767)
==25701==    by 0x5523884: newobj (newobj_internal.h:6)
==25701==    by 0x5524EC2: jl_new_uninitialized_struct_type (alloc.c:514)
==25701==    by 0x54DBBB1: jl_init_types (jltypes.c:2247)
==25701==    by 0x552810E: julia_init (init.c:159)
==25701==    by 0x402648: main (repl.c:292)
==25701== 
               _
   _       _ _(_)_     |
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  A fresh approach to technical computing
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.0.0+97764241.r9a04
 _/ |\__'_|_|_|\__'_|  |  Commit 9a04865b89 (2012-09-27 12:23:07)
|__/                   |

@JeffBezanson
Copy link
Member

As far as I can tell, jl_typename_type->type is initialized. This must be something else.

JeffBezanson added a commit that referenced this issue Sep 27, 2012
@JeffBezanson
Copy link
Member

One thing that might help in cases like this is defining MEMDEBUG at the top of gc.c, which separately allocates all values so valgrind's origin info is better. Otherwise you get the allocation of the page containing the value.

@nolta
Copy link
Member Author

nolta commented Sep 27, 2012

Thanks, that fixed it. Not sure if this is still an error (it's compiled w/ MEMDEBUG):

$ valgrind --track-origins=yes ./usr/bin/julia-debug-basic 
==4388== Memcheck, a memory error detector
==4388== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==4388== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==4388== Command: ./usr/bin/julia-debug-basic
==4388== 
--4388-- WARNING: Serious error when reading debug info
--4388-- When reading debug info from /scratch/r/rbond/nolta/julia/usr/lib/libjulia-debug.so:
--4388-- DWARF line info appears to be corrupt - the section is too small
               _
   _       _ _(_)_     |
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  A fresh approach to technical computing
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.0.0+97770869.rf934.dirty
 _/ |\__'_|_|_|\__'_|  |  Commit f934b6b1b2 (2012-09-27 14:13:35)*
|__/                   |

julia> x=[1,2,3]
==4388== Conditional jump or move depends on uninitialised value(s)
==4388==    at 0x5533317: gc_mark_all (gc.c:597)
==4388==    by 0x55334D0: gc_mark (gc.c:651)
==4388==    by 0x5533618: jl_gc_collect (gc.c:705)
==4388==    by 0x55325BB: alloc_big (gc.c:225)
==4388==    by 0x5533721: alloc_2w (gc.c:773)
==4388==    by 0x550495A: jl_new_box (codegen.cpp:2096)
==4388==    by 0x404054F: ???
==4388==    by 0x403FF37: ???
==4388==    by 0x403FD9E: ???
==4388==    by 0x54DDB78: jl_apply (julia.h:901)
==4388==    by 0x54E15D4: jl_apply_generic (gf.c:1339)
==4388==    by 0x403B509: ???
==4388==  Uninitialised value was created by a heap allocation
==4388==    at 0x4C27223: malloc (vg_replace_malloc.c:263)
==4388==    by 0x5532609: alloc_big (gc.c:231)
==4388==    by 0x5533711: allocobj (gc.c:763)
==4388==    by 0x55238B4: newobj (newobj_internal.h:6)
==4388==    by 0x5524EF2: jl_new_uninitialized_struct_type (alloc.c:514)
==4388==    by 0x54DBC3E: jl_init_types (jltypes.c:2258)
==4388==    by 0x552813E: julia_init (init.c:159)
==4388==    by 0x402648: main (repl.c:292)
==4388== 
3-element Int64 Array:
 1
 2
 3

@vtjnash
Copy link
Member

vtjnash commented Oct 8, 2012

i think that is still an error:

jl_value_t *ctor_factory;
jl_value_t *instance;  // for singletons

are appear to also be uninitialized for jl_tag_kind

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

3 participants