<div dir="ltr"><div>Hello all,</div><div></div><div>Hope this finds you well.</div><div><br></div><div>Trying to run config2help it segfaults.</div><div><br></div><div>Pulling the source from Toybox and building with <br></div><div>  gcc -0 -g -Wall</div><div><br></div><div>That too segfaults so I think I have the latest version (the source seems to be mostly contained in a single file scripts/config2help.c).</div><div><br></div><div>Google(ing) turned up many hits of fairly recent (circa 2018+) conversations on or about this same complaint.  <br></div><div><br></div><div>Digging into the logic of the code, it seems there may be some cruft/age to the logic and some mishandling of pointer use AFTER free (as shown by valgrind).  In "some" aforementioned Google(ing) complaints seemed so stem from an update of their glibc.  I can attest to the same as my builds were going  smoothly until I did an apt update; apt upgrade .</div><div><br></div><div>My point.</div><div><br></div><div>1.)</div><div>Is the latest source (hopefully) with a fix for the "use after free" segfault in "<a href="https://github.com/landley/toybox/blob/master/scripts/config2help.c">https://github.com/landley/toybox/blob/master/scripts/config2help.c</a>"</div><div><br></div><div>2.)</div><div>Following the code in 1.) it seems that some of the logic may be more complex than the input would suggest.</div><div><br></div><div>The code inspecting the generated "sym" list while looping through the entries in ".config" and setting sym->enabled ... indicates to me that ".config" controls which "processed" "symbols" get spit-out as "#defined HELPXXX".  <br></div><div><br></div><div>Is that true and or intended?<br></div><div><br></div><div>The flow seems to indicate that multiple "symbols" of the same "name" may/do exist over multiple Config.in (and "sourced") files; and "duplicates" need/should to be "collated".  In practice; I haven't seen "duplicate" "symbols" and wonder if mashing "duplicates" together wouldn't lead to probable error/nonsense.<br> </div><div></div><div><br></div><div>3.)</div><div>If the above are/is true; would a rewrite with less "dependencies" and a "clean" valgrind run be at-all welcome?</div><div><br></div><div>In closing, am I just lost in the woods?  If so, could someone spin me around and nudge me in the correct direction?</div><div> <br></div><div>Thanks for your attention,</div><div><br></div><div><br></div><div>James</div></div>