Bug 416779

Summary: valgrind: m_debuginfo/debuginfo.c:454 (discard_or_archive_DebugInfo): Assertion '!di->have_dinfo || is_DebugInfo_active(di)' failed.
Product: [Developer tools] valgrind Reporter: Austin English <austinenglish>
Component: generalAssignee: Julian Seward <jseward>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version: 3.15 SVN   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Austin English 2020-01-26 08:16:00 UTC
Tested with VALGRIND_3_15_0-193-gfe6805efc

1. build wine, with https://github.com/mstorsjo/llvm-mingw/ and enable pdb symbols
2. cd ./dlls/crypt32/tests
3. make cert.ok

../../../tools/runtest -q -P wine -T ../../.. -M crypt32.dll -p crypt32_test.exe cert && touch cert.ok

valgrind: m_debuginfo/debuginfo.c:454 (discard_or_archive_DebugInfo): Assertion '!di->have_dinfo || is_DebugInfo_active(di)' failed.

host stacktrace:
==27633==    at 0x58041809: show_sched_status_wrk (m_libcassert.c:406)
==27633==    by 0x58041930: report_and_quit (m_libcassert.c:477)
==27633==    by 0x58041A24: vgPlain_assert_fail (m_libcassert.c:543)
==27633==    by 0x58072C1B: discard_or_archive_DebugInfo (debuginfo.c:454)
==27633==    by 0x58072E24: discard_syms_in_range (debuginfo.c:526)
==27633==    by 0x580751C8: vgPlain_di_notify_munmap (debuginfo.c:1336)
==27633==    by 0x580AEE96: vgModuleLocal_notify_core_and_tool_of_munmap (syswrap-generic.c:246)
==27633==    by 0x580AEE96: vgSysWrap_generic_sys_munmap_after (syswrap-generic.c:3949)
==27633==    by 0x580A2829: vgPlain_post_syscall (syswrap-main.c:2172)
==27633==    by 0x580A2E42: vgPlain_client_syscall (syswrap-main.c:2093)
==27633==    by 0x5809EFFC: handle_syscall (scheduler.c:1208)
==27633==    by 0x580A0B5F: vgPlain_scheduler (scheduler.c:1526)
==27633==    by 0x580F58F2: thread_wrapper (syswrap-linux.c:101)
==27633==    by 0x580F58F2: run_a_thread_NORETURN (syswrap-linux.c:154)

sched status:

Thread 1: status = VgTs_Runnable syscall 91 (lwpid 27633)
==27633==    at 0x437A2C6: munmap (syscall-template.S:78)
==27633==    by 0x7BCA7BF1: unmap_area (virtual.c:799)
==27633==    by 0x7BCA7C3F: delete_view (virtual.c:836)
==27633==    by 0x7BCAC4F1: NtUnmapViewOfSection (virtual.c:3409)
==27633==    by 0x7BC68D7C: free_modref (loader.c:3586)
==27633==    by 0x7BC68E66: MODULE_FlushModrefs (loader.c:3613)
==27633==    by 0x7BC6AB0B: LdrUnloadDll (loader.c:3687)
==27633==    by 0x7B013D20: ???
==27633==    by 0x4BD0B9F: CryptFreeOIDFunctionAddress (oid.c:481)
==27633==    by 0x4B9E51B: CertVerifyRevocation (cert.c:2024)
==27633==    by 0x40AC79: ???
==27633==    by 0x4035BF: ???
==27633==    by 0x445332: ???
==27633==    by 0x4451EC: ???
==27633==    by 0x401394: ???
==27633==    by 0x7B449E31: ??? (in /home/austin/wine-valgrind-mingw/dlls/kernel32/kernel32.dll.so)
==27633==    by 0x7B44A262: start_process (process.c:153)
==27633==    by 0x7B449E3D: ??? (in /home/austin/wine-valgrind-mingw/dlls/kernel32/kernel32.dll.so)
client stack range: [0x4A52000 0x4B4FFFF] client SP: 0x4B4FA58
valgrind stack range: [0x8815E000 0x8825DFFF] top usage: 16748 of 1048576

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.

make[1]: *** [Makefile:234: cert.ok] Error 1

Expected result:
Assertion doesn't fail

austin@laptop ~/wine-valgrind/dlls/crypt32/tests (master) $ file *pdb
crypt32_test.pdb:          MSVC program database ver 7.00, 4096*194 bytes

Note that this occurs for many, but not all, tests. Out of the first 176 tests (I had to stop for unrelated reasons), 41 tests showed this failure.