Skip to content

Instantly share code, notes, and snippets.

@T-X
Created February 12, 2018 13:01
Show Gist options
  • Save T-X/ec13091742f832a5def3ee838e342dd9 to your computer and use it in GitHub Desktop.
Save T-X/ec13091742f832a5def3ee838e342dd9 to your computer and use it in GitHub Desktop.
#!/bin/sh
valgrind ~/install/bin/seaf-server "$@" 2>&1 | tee /tmp/seaf-server-$$-`date +%s`.log
==22392== Memcheck, a memory error detector
==22392== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==22392== Using Valgrind-3.12.0.SVN and LibVEX; rerun with -h for copyright info
==22392== Command: /home/seafile/install/bin/seaf-server -F /home/seafile/build/conf -c /home/seafile/build/ccnet -d /home/seafile/seafile-data -l /home/seafile/build/logs/seafile.log -P /home/pids/seaf-server.pid
==22392==
** (process:22392): WARNING **: seaf-server.c(937): ~~~ Starting.
** (process:22392): WARNING **: seaf-server.c(992): ~~~ Got arguments.
==22392==
==22392== HEAP SUMMARY:
==22392== in use at exit: 132,226 bytes in 929 blocks
==22392== total heap usage: 1,631 allocs, 702 frees, 296,730 bytes allocated
==22392==
==22392== LEAK SUMMARY:
==22392== definitely lost: 0 bytes in 0 blocks
==22392== indirectly lost: 0 bytes in 0 blocks
==22392== possibly lost: 1,352 bytes in 18 blocks
==22392== still reachable: 130,874 bytes in 911 blocks
==22392== of which reachable via heuristic:
==22392== newarray : 1,536 bytes in 16 blocks
==22392== suppressed: 0 bytes in 0 blocks
==22392== Rerun with --leak-check=full to see details of leaked memory
==22392==
==22392== For counts of detected and suppressed errors, rerun with: -v
==22392== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==22401== Thread 2:
==22401== Invalid write of size 8
==22401== at 0x5624E50: regcomp (regcomp.c:479)
==22401== by 0x4890707: evhtp_callback_new (evhtp.c:3344)
==22401== by 0x4890E57: evhtp_set_regex_cb (evhtp.c:3659)
==22401== by 0x1351D3: http_request_init (http-server.c:1968)
==22401== by 0x1351D3: http_server_run (http-server.c:2127)
==22401== by 0x542D09F: start_thread (pthread_create.c:335)
==22401== by 0x563AEDB: thread_start (clone.S:77)
==22401== Address 0x842e690 is 8 bytes after a block of size 24 alloc'd
==22401== at 0x4844CC8: malloc (vg_replace_malloc.c:299)
==22401== by 0x48906F7: evhtp_callback_new (evhtp.c:3342)
==22401== by 0x4890E57: evhtp_set_regex_cb (evhtp.c:3659)
==22401== by 0x1351D3: http_request_init (http-server.c:1968)
==22401== by 0x1351D3: http_server_run (http-server.c:2127)
==22401== by 0x542D09F: start_thread (pthread_create.c:335)
==22401== by 0x563AEDB: thread_start (clone.S:77)
==22401==
==22401== Invalid read of size 1
==22401== at 0x5624E5C: regcomp (regcomp.c:491)
==22401== by 0x4890707: evhtp_callback_new (evhtp.c:3344)
==22401== by 0x4890E57: evhtp_set_regex_cb (evhtp.c:3659)
==22401== by 0x1351D3: http_request_init (http-server.c:1968)
==22401== by 0x1351D3: http_server_run (http-server.c:2127)
==22401== by 0x542D09F: start_thread (pthread_create.c:335)
==22401== by 0x563AEDB: thread_start (clone.S:77)
==22401== Address 0x842e6a8 is 24 bytes after a block of size 32 in arena "client"
==22401==
==22401== Invalid write of size 1
==22401== at 0x5624E6C: regcomp (regcomp.c:494)
==22401== by 0x4890707: evhtp_callback_new (evhtp.c:3344)
==22401== by 0x4890E57: evhtp_set_regex_cb (evhtp.c:3659)
==22401== by 0x1351D3: http_request_init (http-server.c:1968)
==22401== by 0x1351D3: http_server_run (http-server.c:2127)
==22401== by 0x542D09F: start_thread (pthread_create.c:335)
==22401== by 0x563AEDB: thread_start (clone.S:77)
==22401== Address 0x842e6a8 is 24 bytes after a block of size 32 in arena "client"
==22401==
==22401== Invalid read of size 1
==22401== at 0x5624E70: regcomp (regcomp.c:495)
==22401== by 0x4890707: evhtp_callback_new (evhtp.c:3344)
==22401== by 0x4890E57: evhtp_set_regex_cb (evhtp.c:3659)
==22401== by 0x1351D3: http_request_init (http-server.c:1968)
==22401== by 0x1351D3: http_server_run (http-server.c:2127)
==22401== by 0x542D09F: start_thread (pthread_create.c:335)
==22401== by 0x563AEDB: thread_start (clone.S:77)
==22401== Address 0x842e6a8 is 24 bytes after a block of size 32 in arena "client"
==22401==
==22401== Invalid write of size 8
==22401== at 0x5624E7C: regcomp (regcomp.c:496)
==22401== by 0x4890707: evhtp_callback_new (evhtp.c:3344)
==22401== by 0x4890E57: evhtp_set_regex_cb (evhtp.c:3659)
==22401== by 0x1351D3: http_request_init (http-server.c:1968)
==22401== by 0x1351D3: http_server_run (http-server.c:2127)
==22401== by 0x542D09F: start_thread (pthread_create.c:335)
==22401== by 0x563AEDB: thread_start (clone.S:77)
==22401== Address 0x842e698 is 16 bytes after a block of size 24 alloc'd
==22401== at 0x4844CC8: malloc (vg_replace_malloc.c:299)
==22401== by 0x48906F7: evhtp_callback_new (evhtp.c:3342)
==22401== by 0x4890E57: evhtp_set_regex_cb (evhtp.c:3659)
==22401== by 0x1351D3: http_request_init (http-server.c:1968)
==22401== by 0x1351D3: http_server_run (http-server.c:2127)
==22401== by 0x542D09F: start_thread (pthread_create.c:335)
==22401== by 0x563AEDB: thread_start (clone.S:77)
==22401==
==22401== Invalid write of size 1
==22401== at 0x5624E84: regcomp (regcomp.c:495)
==22401== by 0x4890707: evhtp_callback_new (evhtp.c:3344)
==22401== by 0x4890E57: evhtp_set_regex_cb (evhtp.c:3659)
==22401== by 0x1351D3: http_request_init (http-server.c:1968)
==22401== by 0x1351D3: http_server_run (http-server.c:2127)
==22401== by 0x542D09F: start_thread (pthread_create.c:335)
==22401== by 0x563AEDB: thread_start (clone.S:77)
==22401== Address 0x842e6a8 is 24 bytes after a block of size 32 in arena "client"
==22401==
==22401== Invalid read of size 1
==22401== at 0x5623984: re_compile_internal (regcomp.c:731)
==22401== by 0x5624E9F: regcomp (regcomp.c:498)
==22401== by 0x4890707: evhtp_callback_new (evhtp.c:3344)
==22401== by 0x4890E57: evhtp_set_regex_cb (evhtp.c:3659)
==22401== by 0x1351D3: http_request_init (http-server.c:1968)
==22401== by 0x1351D3: http_server_run (http-server.c:2127)
==22401== by 0x542D09F: start_thread (pthread_create.c:335)
==22401== by 0x563AEDB: thread_start (clone.S:77)
==22401== Address 0x842e6a8 is 24 bytes after a block of size 32 in arena "client"
==22401==
==22401== Invalid write of size 1
==22401== at 0x56239A4: re_compile_internal (regcomp.c:737)
==22401== by 0x5624E9F: regcomp (regcomp.c:498)
==22401== by 0x4890707: evhtp_callback_new (evhtp.c:3344)
==22401== by 0x4890E57: evhtp_set_regex_cb (evhtp.c:3659)
==22401== by 0x1351D3: http_request_init (http-server.c:1968)
==22401== by 0x1351D3: http_server_run (http-server.c:2127)
==22401== by 0x542D09F: start_thread (pthread_create.c:335)
==22401== by 0x563AEDB: thread_start (clone.S:77)
==22401== Address 0x842e6a8 is 24 bytes after a block of size 32 in arena "client"
==22401==
==22401== Invalid write of size 8
==22401== at 0x56239A8: re_compile_internal (regcomp.c:732)
==22401== by 0x5624E9F: regcomp (regcomp.c:498)
==22401== by 0x4890707: evhtp_callback_new (evhtp.c:3344)
==22401== by 0x4890E57: evhtp_set_regex_cb (evhtp.c:3659)
==22401== by 0x1351D3: http_request_init (http-server.c:1968)
==22401== by 0x1351D3: http_server_run (http-server.c:2127)
==22401== by 0x542D09F: start_thread (pthread_create.c:335)
==22401== by 0x563AEDB: thread_start (clone.S:77)
==22401== Address 0x842e688 is 0 bytes after a block of size 24 alloc'd
==22401== at 0x4844CC8: malloc (vg_replace_malloc.c:299)
==22401== by 0x48906F7: evhtp_callback_new (evhtp.c:3342)
==22401== by 0x4890E57: evhtp_set_regex_cb (evhtp.c:3659)
==22401== by 0x1351D3: http_request_init (http-server.c:1968)
==22401== by 0x1351D3: http_server_run (http-server.c:2127)
==22401== by 0x542D09F: start_thread (pthread_create.c:335)
==22401== by 0x563AEDB: thread_start (clone.S:77)
==22401==
valgrind: m_mallocfree.c:303 (get_bszB_as_is): Assertion 'bszB_lo == bszB_hi' failed.
valgrind: Heap block lo/hi size mismatch: lo = 96, hi = 0.
This is probably caused by your program erroneously writing past the
end of a heap block and corrupting heap metadata. If you fix any
invalid writes reported by Memcheck, this assertion failure will
probably go away. Please try that before reporting this as a bug.
host stacktrace:
==22401== at 0x3803A50C: show_sched_status_wrk (m_libcassert.c:343)
==22401== by 0x3803A64B: report_and_quit (m_libcassert.c:419)
==22401== by 0x3803A7B3: vgPlain_assert_fail (m_libcassert.c:485)
==22401== by 0x38048FD7: get_bszB_as_is (m_mallocfree.c:301)
==22401== by 0x38048FD7: vgPlain_describe_arena_addr (m_mallocfree.c:1522)
==22401== by 0x3803337B: vgPlain_describe_addr (m_addrinfo.c:186)
==22401== by 0x38031A9F: vgMemCheck_update_Error_extra (mc_errors.c:1141)
==22401== by 0x3803622F: vgPlain_maybe_record_error (m_errormgr.c:813)
==22401== by 0x38030F4B: vgMemCheck_record_address_error (mc_errors.c:760)
==22401== by 0x803C53FAF: ???
sched status:
running_tid=2
Thread 1: status = VgTs_WaitSys (lwpid 22401)
==22401== at 0x562EE3C: write (syscall-template.S:86)
==22401== by 0x55DE2E7: _IO_file_write@@GLIBC_2.17 (fileops.c:1271)
==22401== by 0x55DD71F: new_do_write (fileops.c:526)
==22401== by 0x55DF403: _IO_do_write@@GLIBC_2.17 (fileops.c:502)
==22401== by 0x55DD51F: _IO_file_sync@@GLIBC_2.17 (fileops.c:882)
==22401== by 0x55D2507: fflush (iofflush.c:40)
==22401== by 0x14F123: seafile_log (log.c:69)
==22401== by 0x4EBAB47: g_logv (in /lib/aarch64-linux-gnu/libglib-2.0.so.0.5000.3)
Thread 2: status = VgTs_Runnable (lwpid 22413)
==22401== at 0x56239B0: re_compile_internal (regcomp.c:735)
==22401== by 0x5624E9F: regcomp (regcomp.c:498)
==22401== by 0x4890707: evhtp_callback_new (evhtp.c:3344)
==22401== by 0x4890E57: evhtp_set_regex_cb (evhtp.c:3659)
==22401== by 0x1351D3: http_request_init (http-server.c:1968)
==22401== by 0x1351D3: http_server_run (http-server.c:2127)
==22401== by 0x542D09F: start_thread (pthread_create.c:335)
==22401== by 0x563AEDB: thread_start (clone.S:77)
Note: see also the FAQ in the source distribution.
It contains workarounds to several common problems.
In particular, if Valgrind aborted or crashed after
identifying problems in your program, there's a good chance
that fixing those problems will prevent Valgrind aborting or
crashing, especially if it happened in m_mallocfree.c.
If that doesn't help, please report this bug to: www.valgrind.org
In the bug report, send all the above text, the valgrind
version, and what OS and version you are using. Thanks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment