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

use-of-uninitialized-values #3243

Closed
ghost opened this issue Nov 10, 2016 · 5 comments
Closed

use-of-uninitialized-values #3243

ghost opened this issue Nov 10, 2016 · 5 comments

Comments

@ghost
Copy link

ghost commented Nov 10, 2016

mruby 1.2.0 (2015-11-17)
build/test/bin/mrbtest

Uninitialized bytes in __interceptor_localtime_r at offset 0 inside [0x705000000cd0, 8)
==4733==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x6663c8 in mrb_time_update_datetime /home/fuzzer/git/mruby-memory/mrbgems/mruby-time/src/time.c:194:11
    #1 0x66787f in current_mrb_time /home/fuzzer/git/mruby-memory/mrbgems/mruby-time/src/time.c:293:3
    #2 0x65ea92 in mrb_time_now /home/fuzzer/git/mruby-memory/mrbgems/mruby-time/src/time.c:302:50
    #3 0x571f77 in mrb_vm_exec /home/fuzzer/git/mruby-memory/src/vm.c:1165:18
    #4 0x56499c in mrb_vm_run /home/fuzzer/git/mruby-memory/src/vm.c:766:10
    #5 0x599fb8 in mrb_top_run /home/fuzzer/git/mruby-memory/src/vm.c:2452:12
    #6 0x601fb6 in mrb_load_irep_cxt /home/fuzzer/git/mruby-memory/src/load.c:638:10
    #7 0x602597 in mrb_load_irep /home/fuzzer/git/mruby-memory/src/load.c:644:10
    #8 0x48c5d3 in mrb_init_mrbtest /home/fuzzer/git/mruby-memory/build/test/mrbgems/mruby-test/mrbtest.c:26:3
    #9 0x48bc1f in main /home/fuzzer/git/mruby-memory/mrbgems/mruby-test/driver.c:161:3
    #10 0x7f482b41782f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #11 0x41a938 in _start (/home/fuzzer/git/mruby-memory/build/test/bin/mrbtest+0x41a938)

SUMMARY: MemorySanitizer: use-of-uninitialized-value /home/fuzzer/git/mruby-memory/mrbgems/mruby-time/src/time.c:194:11 in mrb_time_update_datetime
==6122==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x5c461c in ary_concat /home/fuzzer/git/mruby-memory/src/array.c:259:20
    #1 0x5c43c1 in mrb_ary_concat /home/fuzzer/git/mruby-memory/src/array.c:273:3
    #2 0x563ab9 in mrb_vm_exec /home/fuzzer/git/mruby-memory/src/vm.c:2137:7
    #3 0x53ac2c in mrb_vm_run /home/fuzzer/git/mruby-memory/src/vm.c:766:10
    #4 0x570248 in mrb_top_run /home/fuzzer/git/mruby-memory/src/vm.c:2452:12
    #5 0x62300e in load_exec /home/fuzzer/git/mruby-memory/mrbgems/mruby-compiler/core/parse.y:5711:7
    #6 0x621447 in mrb_load_file_cxt /home/fuzzer/git/mruby-memory/mrbgems/mruby-compiler/core/parse.y:5720:10
    #7 0x48a26d in main /home/fuzzer/git/mruby-memory/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c:226:9
    #8 0x7f8f7f03f82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #9 0x41aab8 in _start (/home/fuzzer/git/mruby-memory/build/test/bin/mruby+0x41aab8)

SUMMARY: MemorySanitizer: use-of-uninitialized-value /home/fuzzer/git/mruby-memory/src/array.c:259:20 in ary_concat
@matz
Copy link
Member

matz commented Nov 11, 2016

Could you provide more info to reproduce the result?
The script you tested, clang command-line options you used etc. please?

@ghost
Copy link
Author

ghost commented Nov 11, 2016

Hi matz,

compile using -fsanitize=memory and

module Rs
class Rsclass
def $a.m
f@a.f@a.m *$Cd
    end
f$a.m
 end
end

and first stacktrace use mrbtest

@matz
Copy link
Member

matz commented Nov 11, 2016

On my linux box, compiling with clang -fsanitize=memory causes a lot of link errors, but that must be an issue of my side (installation?). I will investigate it later.

matz added a commit that referenced this issue Jan 18, 2017
@matz
Copy link
Member

matz commented Jan 18, 2017

I still cannot compile mruby with -fsanitize=memory but I fixed the suspicious code.
@revskills could you try the recent mruby after fe0e455, please?

@matz
Copy link
Member

matz commented Mar 20, 2017

Seems to be resolved now. Reopen if you see the issue.

@matz matz closed this as completed Mar 20, 2017
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

1 participant