<div>Hey Professor,</div><br><div>NetBSD:</div><div>So I'm running into an issue where somewhere in libc.so.12, there's a segfault relating to what appears to be (based on errno) the system running out of memory.</div><br><div>What's happening is that when I call fts_children(my_FTS_ptr, 0) after calling fts_read(my_FTS_ptr), it's segfaulting. If I print strerror(errno) right before calling fts_children(...), it says that it failed to allocate memory. When I run $gdb ./ls ./ls.core, it just says there's an error at ?? (literally prints ??) at libc.so.12.</div><br><div>Linux:</div><div>So when I realized where I was having issues, I thought I'd try valgrind to help analyze my memory management. It doesn't appear valgrind is available for BSD, so I made the necessary alterations to my code and makefile to run on Linux and.... it runs beautifully. No more segfault. I mean I have some memory leaks to hunt down and take care of, but the code runs and finishes.</div><br><div>ANYWAY</div><div>I'm not using any exorbitant amounts of memory anywhere, I don't do any memory allocation within recursive calls, and my NetBSD system seems to be running on &lt;100MB of ram (I have 4GB allocated for NetBSD in VirtualBox).</div><br><div>My question, therefore, is if you know of any serious differences between NetBSD's fts.c and Linux's fts.c, if there even are any, and why I might be running into such a strange issue?</div><br><div>If not, I'll keep plugging away til I figure this one out.</div><br><div>Thanks,</div><br><div><signature id="local-d4f4314a-a661"><table cellpadding="0" cellspacing="0"><tbody><tr><td style="vertical-align:top"><img alt="" src="https://user-generated.getmailspring.com/asset/NmY5Mjg2ODgtZWMyNy00YjMzLWFmNGItYTlmMDQ1OTAxNzZlL3NpZy1pbml0aWFsLnBuZw.png?t=1565960265401&amp;msw=246&amp;msh=249" width="59" height="60" style="max-width:60px;max-height:60px;margin-right:10px"></td><td><div>Elliot Wasem</div><div style="font-size:0.9em;border-top:1px solid gray;min-width:250px;max-width:300px;margin-top:4px;padding-top:4px"><div><div></div><div><a href="https://elliotwasem.xyz">https://elliotwasem.xyz</a></div><div><a href="https://www.linkedin.com/in/elliot-wasem/" title="LinkedIn" style="margin-right:8px"><img src="https://www.getmailspring.com/signature-assets/linkedin.gif" width="13" height="13" alt="LinkedIn"></a></div></div></div></td></tr></tbody></table></signature></div>