-
Notifications
You must be signed in to change notification settings - Fork 32
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
Crash(SEGV) when running with conf/huge_mget or conf/set_big_values #10
Comments
Thanks! I don't always use the included conf files, so I can see how that snuck in. I've rewritten most of the parsing recently. You can make them work by editing the conf files and detuning them a bit. |
Thanks for mc-crusher. I also observed this behaviour while running mc-crusher built from the master branch. Issue - valgrind "Invalid write of size 2" for mc-crusher/conf/set_big_values I am running on
Quick fix:
|
This is to support setting keys with value_size 1047552 (1023k) as done in conf/set_big_values. memcached#10
Description
Crash(SEGV) occurs when running mc-crusher with --conf ./conf/huge_mget or --conf ./conf/set_big_values. The rest of conf/* are fine.
Steps to Reproduce
System Information
Details
Valgrind was executed after normal execution crash and below are the logs:
==3335== Memcheck, a memory error detector
==3335== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==3335== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==3335== Command: ./mc-crusher --conf ./conf/set_big_values --ip 192.168.56.102
==3335==
ip address default: 192.168.56.102
id 0 for key send value ascii_set
id 1 for key recv value blind_read
id 5 for key conns value 1
id 8 for key key_prefix value foo
id 12 for key value_size value 1047552
id 26 for key key_prealloc value 0
id 20 for key key_count value 4000
done initializing
==3335== Thread 2:
==3335== Invalid write of size 2
==3335== at 0x4841B33: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==3335== by 0x10B9A1: ascii_write_flat_to_client (mc-crusher.c:487)
==3335== by 0x10BB53: run_write (mc-crusher.c:543)
==3335== by 0x10BD33: client_handler (mc-crusher.c:583)
==3335== by 0x4875A10: ??? (in /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2)
==3335== by 0x487633E: event_base_loop (in /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2)
==3335== by 0x10D346: thread_runner (mc-crusher.c:1063)
==3335== by 0x4C00668: start_thread (pthread_create.c:479)
==3335== by 0x4D3C322: clone (clone.S:95)
==3335== Address 0x4f2fc78 is 0 bytes after a block of size 66,952 alloc'd
==3335== at 0x483A7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==3335== by 0x10BE9D: new_connection (mc-crusher.c:636)
==3335== by 0x10D29A: start_template (mc-crusher.c:1048)
==3335== by 0x10D1D4: parse_config_line (mc-crusher.c:1032)
==3335== by 0x10D9DB: main (mc-crusher.c:1181)
==3335==
==3243== Memcheck, a memory error detector
==3243== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==3243== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==3243== Command: ./mc-crusher --conf ./conf/huge_mget --ip 192.168.56.102
==3243==
ip address default: 192.168.56.102
id 0 for key send value ascii_mget
id 1 for key recv value blind_read
id 5 for key conns value 1
id 15 for key mget_count value 500000
id 8 for key key_prefix value foobar
id 26 for key key_prealloc value 1
done initializing==3243== Thread 2:
==3243== Invalid write of size 2
==3243== at 0x4841B33: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==3243== by 0x10B3AB: ascii_mget_format (mc-crusher.c:393)
==3243== by 0x10B461: ascii_write_flat_mget_to_client (mc-crusher.c:406)
==3243== by 0x10BB53: run_write (mc-crusher.c:543)
==3243== by 0x10BD33: client_handler (mc-crusher.c:583)
==3243== by 0x4875A10: ??? (in /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2)
==3243== by 0x487633E: event_base_loop (in /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2)
==3243== by 0x10D346: thread_runner (mc-crusher.c:1063)
==3243== by 0x4C00668: start_thread (pthread_create.c:479)
==3243== by 0x4D3C322: clone (clone.S:95)
==3243== Address 0x4f2fc78 is 0 bytes after a block of size 66,952 alloc'd
==3243== at 0x483A7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==3243== by 0x10BE9D: new_connection (mc-crusher.c:636)
==3243== by 0x10D29A: start_template (mc-crusher.c:1048)
==3243== by 0x10D1D4: parse_config_line (mc-crusher.c:1032)
==3243== by 0x10D9DB: main (mc-crusher.c:1181)
==3243==
==3243== Invalid write of size 2
==3243== at 0x4841B33: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==3243== by 0x10DC5B: out2 (itoa_ljust.c:74)
==3243== by 0x10DE02: itoa (itoa_ljust.c:100)
==3243== by 0x10DF40: itoa_u32 (itoa_ljust.c:116)
==3243== by 0x10DFCF: itoa_u64 (itoa_ljust.c:132)
==3243== by 0x10B3D6: ascii_mget_format (mc-crusher.c:394)
==3243== by 0x10B461: ascii_write_flat_mget_to_client (mc-crusher.c:406)
==3243== by 0x10BB53: run_write (mc-crusher.c:543)
==3243== by 0x10BD33: client_handler (mc-crusher.c:583)
==3243== by 0x4875A10: ??? (in /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2)
==3243== by 0x487633E: event_base_loop (in /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2)
==3243== by 0x10D346: thread_runner (mc-crusher.c:1063)
==3243== Address 0x4f2fc7a is 2 bytes after a block of size 66,952 alloc'd
==3243== at 0x483A7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==3243== by 0x10BE9D: new_connection (mc-crusher.c:636)
==3243== by 0x10D29A: start_template (mc-crusher.c:1048)
==3243== by 0x10D1D4: parse_config_line (mc-crusher.c:1032)
==3243== by 0x10D9DB: main (mc-crusher.c:1181)
==3243==
==3243== Invalid write of size 1
==3243== at 0x4841A48: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==3243== by 0x10DC5B: out2 (itoa_ljust.c:74)
==3243== by 0x10DE26: itoa (itoa_ljust.c:102)
==3243== by 0x10DF40: itoa_u32 (itoa_ljust.c:116)
==3243== by 0x10DFCF: itoa_u64 (itoa_ljust.c:132)
==3243== by 0x10B3D6: ascii_mget_format (mc-crusher.c:394)
==3243== by 0x10B461: ascii_write_flat_mget_to_client (mc-crusher.c:406)
==3243== by 0x10BB53: run_write (mc-crusher.c:543)
==3243== by 0x10BD33: client_handler (mc-crusher.c:583)
==3243== by 0x4875A10: ??? (in /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2)
==3243== by 0x487633E: event_base_loop (in /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2)
==3243== by 0x10D346: thread_runner (mc-crusher.c:1063)
==3243== Address 0x4f2fc7c is 4 bytes after a block of size 66,952 alloc'd
==3243== at 0x483A7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==3243== by 0x10BE9D: new_connection (mc-crusher.c:636)
==3243== by 0x10D29A: start_template (mc-crusher.c:1048)
==3243== by 0x10D1D4: parse_config_line (mc-crusher.c:1032)
==3243== by 0x10D9DB: main (mc-crusher.c:1181)
==3243==
==3243== Invalid write of size 1
==3243== at 0x10DE2F: itoa (itoa_ljust.c:105)
==3243== by 0x10DF40: itoa_u32 (itoa_ljust.c:116)
==3243== by 0x10DFCF: itoa_u64 (itoa_ljust.c:132)
==3243== by 0x10B3D6: ascii_mget_format (mc-crusher.c:394)
==3243== by 0x10B461: ascii_write_flat_mget_to_client (mc-crusher.c:406)
==3243== by 0x10BB53: run_write (mc-crusher.c:543)
==3243== by 0x10BD33: client_handler (mc-crusher.c:583)
==3243== by 0x4875A10: ??? (in /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2)
==3243== by 0x487633E: event_base_loop (in /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2)
==3243== by 0x10D346: thread_runner (mc-crusher.c:1063)
==3243== by 0x4C00668: start_thread (pthread_create.c:479)
==3243== by 0x4D3C322: clone (clone.S:95)
==3243== Address 0x4f2fc7e is 6 bytes after a block of size 66,952 alloc'd
==3243== at 0x483A7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==3243== by 0x10BE9D: new_connection (mc-crusher.c:636)
==3243== by 0x10D29A: start_template (mc-crusher.c:1048)
==3243== by 0x10D1D4: parse_config_line (mc-crusher.c:1032)
==3243== by 0x10D9DB: main (mc-crusher.c:1181)
==3243==
==3243== Invalid write of size 1
==3243== at 0x10B3DF: ascii_mget_format (mc-crusher.c:395)
==3243== by 0x10B461: ascii_write_flat_mget_to_client (mc-crusher.c:406)
==3243== by 0x10BB53: run_write (mc-crusher.c:543)
==3243== by 0x10BD33: client_handler (mc-crusher.c:583)
==3243== by 0x4875A10: ??? (in /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2)
==3243== by 0x487633E: event_base_loop (in /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2)
==3243== by 0x10D346: thread_runner (mc-crusher.c:1063)
==3243== by 0x4C00668: start_thread (pthread_create.c:479)
==3243== by 0x4D3C322: clone (clone.S:95)
==3243== Address 0x4f2fc7e is 6 bytes after a block of size 66,952 alloc'd
==3243== at 0x483A7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==3243== by 0x10BE9D: new_connection (mc-crusher.c:636)
==3243== by 0x10D29A: start_template (mc-crusher.c:1048)
==3243== by 0x10D1D4: parse_config_line (mc-crusher.c:1032)
==3243== by 0x10D9DB: main (mc-crusher.c:1181)
==3243==
==3243== Invalid write of size 1
==3243== at 0x4841B63: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==3243== by 0x10B3AB: ascii_mget_format (mc-crusher.c:393)
==3243== by 0x10B461: ascii_write_flat_mget_to_client (mc-crusher.c:406)
==3243== by 0x10BB53: run_write (mc-crusher.c:543)
==3243== by 0x10BD33: client_handler (mc-crusher.c:583)
==3243== by 0x4875A10: ??? (in /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2)
==3243== by 0x487633E: event_base_loop (in /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2)
==3243== by 0x10D346: thread_runner (mc-crusher.c:1063)
==3243== by 0x4C00668: start_thread (pthread_create.c:479)
==3243== by 0x4D3C322: clone (clone.S:95)
==3243== Address 0x4f2fc7f is 7 bytes after a block of size 66,952 alloc'd
==3243== at 0x483A7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==3243== by 0x10BE9D: new_connection (mc-crusher.c:636)
==3243== by 0x10D29A: start_template (mc-crusher.c:1048)
==3243== by 0x10D1D4: parse_config_line (mc-crusher.c:1032)
==3243== by 0x10D9DB: main (mc-crusher.c:1181)
==3243==
==3243== Invalid write of size 1
==3243== at 0x4841B63: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==3243== by 0x10DC5B: out2 (itoa_ljust.c:74)
==3243== by 0x10DE02: itoa (itoa_ljust.c:100)
==3243== by 0x10DF40: itoa_u32 (itoa_ljust.c:116)
==3243== by 0x10DFCF: itoa_u64 (itoa_ljust.c:132)
==3243== by 0x10B3D6: ascii_mget_format (mc-crusher.c:394)
==3243== by 0x10B461: ascii_write_flat_mget_to_client (mc-crusher.c:406)
==3243== by 0x10BB53: run_write (mc-crusher.c:543)
==3243== by 0x10BD33: client_handler (mc-crusher.c:583)
==3243== by 0x4875A10: ??? (in /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2)
==3243== by 0x487633E: event_base_loop (in /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2)
==3243== by 0x10D346: thread_runner (mc-crusher.c:1063)
==3243== Address 0x4f2fc85 is 13 bytes after a block of size 66,952 alloc'd
==3243== at 0x483A7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==3243== by 0x10BE9D: new_connection (mc-crusher.c:636)
==3243== by 0x10D29A: start_template (mc-crusher.c:1048)
==3243== by 0x10D1D4: parse_config_line (mc-crusher.c:1032)
==3243== by 0x10D9DB: main (mc-crusher.c:1181)
==3243==
==3243== Invalid write of size 1
==3243== at 0x4841B63: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==3243== by 0x10DC5B: out2 (itoa_ljust.c:74)
==3243== by 0x10DE26: itoa (itoa_ljust.c:102)
==3243== by 0x10DF40: itoa_u32 (itoa_ljust.c:116)
==3243== by 0x10DFCF: itoa_u64 (itoa_ljust.c:132)
==3243== by 0x10B3D6: ascii_mget_format (mc-crusher.c:394)
==3243== by 0x10B461: ascii_write_flat_mget_to_client (mc-crusher.c:406)
==3243== by 0x10BB53: run_write (mc-crusher.c:543)
==3243== by 0x10BD33: client_handler (mc-crusher.c:583)
==3243== by 0x4875A10: ??? (in /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2)
==3243== by 0x487633E: event_base_loop (in /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2)
==3243== by 0x10D346: thread_runner (mc-crusher.c:1063)
==3243== Address 0x4f2fc87 is 15 bytes after a block of size 66,952 alloc'd
==3243== at 0x483A7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==3243== by 0x10BE9D: new_connection (mc-crusher.c:636)
==3243== by 0x10D29A: start_template (mc-crusher.c:1048)
==3243== by 0x10D1D4: parse_config_line (mc-crusher.c:1032)
==3243== by 0x10D9DB: main (mc-crusher.c:1181)
==3243==
==3243== Invalid write of size 2
==3243== at 0x4841B33: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==3243== by 0x10DC5B: out2 (itoa_ljust.c:74)
==3243== by 0x10DE26: itoa (itoa_ljust.c:102)
==3243== by 0x10DF40: itoa_u32 (itoa_ljust.c:116)
==3243== by 0x10DFCF: itoa_u64 (itoa_ljust.c:132)
==3243== by 0x10B3D6: ascii_mget_format (mc-crusher.c:394)
==3243== by 0x10B461: ascii_write_flat_mget_to_client (mc-crusher.c:406)
==3243== by 0x10BB53: run_write (mc-crusher.c:543)
==3243== by 0x10BD33: client_handler (mc-crusher.c:583)
==3243== by 0x4875A10: ??? (in /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2)
==3243== by 0x487633E: event_base_loop (in /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2)
==3243== by 0x10D346: thread_runner (mc-crusher.c:1063)
==3243== Address 0x4f2fc92 is 18 bytes after a block of size 66,960 in arena "client"
==3243==
==3243== Invalid write of size 1
==3243== at 0x4841A48: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==3243== by 0x10DC5B: out2 (itoa_ljust.c:74)
==3243== by 0x10DE02: itoa (itoa_ljust.c:100)
==3243== by 0x10DF40: itoa_u32 (itoa_ljust.c:116)
==3243== by 0x10DFCF: itoa_u64 (itoa_ljust.c:132)
==3243== by 0x10B3D6: ascii_mget_format (mc-crusher.c:394)
==3243== by 0x10B461: ascii_write_flat_mget_to_client (mc-crusher.c:406)
==3243== by 0x10BB53: run_write (mc-crusher.c:543)
==3243== by 0x10BD33: client_handler (mc-crusher.c:583)
==3243== by 0x4875A10: ??? (in /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2)
==3243== by 0x487633E: event_base_loop (in /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2)
==3243== by 0x10D346: thread_runner (mc-crusher.c:1063)
==3243== Address 0x4f2ff92 is 2 bytes after a block of size 16 alloc'd
==3243== at 0x483CD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==3243== by 0x4878F02: evmap_io_add_ (in /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2)
==3243== by 0x48740CD: event_add_nolock_ (in /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2)
==3243== by 0x48745A9: event_add (in /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6.0.2)
==3243== by 0x10C4E2: new_connection (mc-crusher.c:767)
==3243== by 0x10D29A: start_template (mc-crusher.c:1048)
==3243== by 0x10D1D4: parse_config_line (mc-crusher.c:1032)
==3243== by 0x10D9DB: main (mc-crusher.c:1181)
==3243==
The text was updated successfully, but these errors were encountered: