<div dir="ltr"><div>So I'm attempting to run individual tests now. What exactly should I do after I "make service.ok"? I tried just running valgrind the way I would expect to use it i.e.<br><br>valgrind --trace-children=yes --track-origins=yes --leak-check=full --num-callers=20 --workaround-gcc296-bugs=yes --log-file="filename.log" ./wine /home/kduggan15/Documents/Wine/wine-valgrind/dlls/atl100/tests/<a href="http://atl100_test-stripped.exe.so">atl100_test-stripped.exe.so</a><br><br></div>I get <br><div><br>64 bytes in 1 blocks are definitely lost in loss record 1,250 of 2,380<br>==11711==    at 0x7BC46859: notify_alloc (heap.c:260)<br>==11711==    by 0x7BC49D56: RtlAllocateHeap (heap.c:1726)<br>==11711==    by 0x4D16D40: IOCS_Create (atl_ax.c:952)<br>==11711==    by 0x4D17572: AtlAxAttachControl (atl_ax.c:1156)<br>==11711==    by 0x4804025: ??? (in /home/kduggan15/Documents/Wine/wine-valgrind/dlls/atl100/tests/<a href="http://atl100_test-stripped.exe.so">atl100_test-stripped.exe.so</a>)<br><br></div><div>The issue being that the <a href="http://atl100_test-stripped.exe.so">atl100_test-stripped.exe.so</a> doesn't have any debug symbols<br></div><div>Also I initially tried make service.ok and I just get something likemake service is up to date or it just builds the tests without running valgrind. If it does run valgrind, then I don't know where the log is going (and I checked wine-valgrind/logs of course)<br><br></div><div>That's basically all I got. Sorry if these questions are a bit basic. I'm just running into a few roadblocks and could use the assistance. I really appreciate the help<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 22, 2018 at 2:15 AM, Austin English <span dir="ltr"><<a href="mailto:austinenglish@gmail.com" target="_blank">austinenglish@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 03/21/2018 08:58 PM, Kieran Duggan wrote:<br>
> I think the output I attached was misleading. Really I'm just not<br>
> understanding the output that I'm getting from valgrind. Namely is seems<br>
> like the memory leaks are happening outside of wine.<br>
> Should I even care if a memory leak happens in libfontconfig? Does a memory<br>
> leak there imply that there is an error in Wine?<br>
><br>
> Also now that I'm playing with it more, I'm not even sure if valgrind is<br>
> actually testing anything. I'll attach the log in case anyone can point me<br>
> in the right direction<br>
><br>
> On Wed, Mar 21, 2018 at 9:10 PM, Josh DuBois <<a href="mailto:duboisj@codeweavers.com">duboisj@codeweavers.com</a>><br>
> wrote:<br>
><br>
>> Hi Kieran,<br>
>><br>
>>   Someone else on the list is likely to be better help, but in case you're<br>
>> in a hurry and don't get a quick response: it looks to me like<br>
>> libfontconfig lacks debug symbols (which makes sense, as I'd not expect<br>
>> your copy in /usr/lib to have those).  Do you have debug symbols for the<br>
>> wine functions (and if not, are you sure your wine object files include<br>
>> them)?<br>
>><br>
>>   I don't use Valgrind often, but I would guess you might be able to 1.)<br>
>> build fontconfig yourself, with debug symbols; and then 2.) cause wine to<br>
>> use your debug version instead of the system one by setting LD_LIBRARY_PATH<br>
>> or somesuch.  However, I'd also expect that the traces you most want to see<br>
>> are those from wine.<br>
>>   Again, a wine hacker and more regular Valgrind user from the list may<br>
>> easily have better advice.<br>
>><br>
>> On 3/21/18 7:27 PM, Kieran Duggan wrote:<br>
>><br>
>> So I'm trying to run the tests with valgrind to find memory leaks but when<br>
>> I use valgrind I end up getting output looking something like this<br>
>> ==14135== 288 (256 direct, 32 indirect) bytes in 1 blocks are definitely<br>
>> lost in loss record 166 of 278<br>
>> ==14135==    at 0x442EB8F: malloc (in /usr/lib/valgrind/vgpreload_<br>
>> memcheck-amd64-linux.so)<br>
>> ==14135==    by 0x96B50B9: ??? (in /usr/lib/x86_64-linux-gnu/<br>
>> libfontconfig.so.1.9.0)<br>
>> ==14135==    by 0x96B5829: ??? (in /usr/lib/x86_64-linux-gnu/<br>
>> libfontconfig.so.1.9.0)<br>
>> ==14135==    by 0x96B6D4A: ??? (in /usr/lib/x86_64-linux-gnu/<br>
>> libfontconfig.so.1.9.0)<br>
>> ==14135==    by 0x96BC19B: ??? (in /usr/lib/x86_64-linux-gnu/<br>
>> libfontconfig.so.1.9.0)<br>
>> ==14135==    by 0x98E3A9B: ??? (in /lib/x86_64-linux-gnu/<br>
>> libexpat.so.1.6.0)<br>
>><br>
>> but this isn't nearly as useful as the output I see on bugzilla, which<br>
>> includes function calls and such<br>
>> I tried recompiling my build with valgrind installed on my computer<br>
>> and checked to be sure that the make config was detected it with<br>
>> grep VALGRIND include/config.h and I get<br>
>><br>
>> #define HAVE_VALGRIND_MEMCHECK_H 1<br>
>> #define HAVE_VALGRIND_VALGRIND_H 1<br>
>><br>
>> so I don't think that is the problem.<br>
>><br>
>> It seems to me like valgrind is expecting there to be some flags or<br>
>> something for it to find but they aren't there.<br>
>> Can anyone offer some assistance?<br>
>><br>
>> On Mon, Mar 19, 2018 at 5:51 AM, Henri Verbeet <<a href="mailto:hverbeet@gmail.com">hverbeet@gmail.com</a>> wrote:<br>
>><br>
>>> On 19 March 2018 at 10:01, Kieran Duggan <<a href="mailto:kieranduggan15@gmail.com">kieranduggan15@gmail.com</a>><br>
>>> wrote:<br>
>>>> Yes that is very useful!<br>
>>>> I took a look at the first one I saw on the list. It goes:<br>
>>>><br>
>>>> ==3551== 8 bytes in 1 blocks are definitely lost in loss record 63 of<br>
>>> 766<br>
>>>> ==3551==    at 0x7BC51061: notify_alloc (heap.c:254)<br>
>>>> ==3551==    by 0x7BC5554F: RtlAllocateHeap (heap.c:1716)<br>
>>>> ==3551==    by 0x5C85281: XAudio2Create (xaudio_dll.c:2159)<br>
>>>> ==3551==    by 0x4A1B741: func_xaudio2 (xaudio2.c:1150)<br>
>>>> ==3551==    by 0x4A1C74F: run_test (test.h:603)<br>
>>>> ==3551==    by 0x4A1CBAD: main (test.h:687)<br>
>>>> ==3551==<br>
>>>><br>
>>>> To fix it I looked at the XAudio2Create function and noticed that<br>
>>>> IClassFactory *cf was assigned in the call<br>
>>>> make_xaudio2_factory(&IID_<wbr>IClassFactory, (void**)&cf);<br>
>>>> which contains<br>
>>>> struct xaudio2_cf *ret = HeapAlloc(GetProcessHeap(), 0, sizeof(struct<br>
>>>> xaudio2_cf));<br>
>>>><br>
>>>> Later in the code IClassFactory_Release(cf); is used, but this wouldn't<br>
>>> free<br>
>>>> up the space on the heap because of how that function is implemented.<br>
>>>><br>
>>> I believe it does. Commit 45babd780f586eb8d0a93205d0998d<wbr>6ce3f8396d<br>
>>> (which was committed after the bug report), changed<br>
>>> make_xaudio2_factory() to no longer return class factories with a zero<br>
>>> reference count. That happens sometimes.<br>
>>><br>
>>> Unfortunately, looking over the first couple of entries in the list,<br>
>>> it seems likely most of them are similarly already fixed. If you have<br>
>>> the time and inclination it would certainly be useful to go over that<br>
>>> list to figure out which ones are already fixed and which ones aren't,<br>
>>> but that would make this a bit more of a challenge than I had<br>
>>> intended. Sorry about that.<br>
>>><br>
>>> Still, bugzilla is not a bad place to look for things to fix. The<br>
>>> "download" keyword should limit searches to bugs that can be<br>
>>> reproduced with free downloads. We also have various small cleanup<br>
>>> tasks like e.g. replacing HeapAlloc() usage with the heap_alloc()<br>
>>> helper, or introducing usage of the ARRAY_SIZE macro. The "patches"<br>
>>> page [1] and git log may have other examples.<br>
>>><br>
>>> [1] <a href="https://source.winehq.org/patches/" rel="noreferrer" target="_blank">https://source.winehq.org/<wbr>patches/</a><br>
<br>
</div></div>Hi Kieran,<br>
<br>
If you haven't already, have a look at<br>
<a href="https://github.com/austin987/wine-valgrind-scripts" rel="noreferrer" target="_blank">https://github.com/austin987/<wbr>wine-valgrind-scripts</a> and<br>
<a href="https://wiki.winehq.org/WineAndValgrind" rel="noreferrer" target="_blank">https://wiki.winehq.org/<wbr>WineAndValgrind</a>.<br>
<br>
To run the full test suite, I use valgrind-full.sh. To just run a single<br>
test, I do:<br>
# terminal 1:<br>
$ ~/wine-valgrind/wine start /min notepad<br>
<br>
# terminal 2<br>
. ~/src/wine-valgrind-scripts/<wbr>vg-wrapper.sh<br>
cd ~/wine-valgrind/dlls/advapi32/<wbr>tests<br>
make service.ok<br>
<br>
The wine-valgrind-scripts repo has suppressions for fontconfig, etc.<br>
Note that you can ignore known wine issues, so if you do that, make sure<br>
to comment out its suppression!<br>
<span class="HOEnZb"><font color="#888888">--<br>
-Austin<br>
GPG: 267B CC1F 053F 0749 (expires 2021/02/18)<br>
</font></span></blockquote></div><br></div>