<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px">Intr-adevar, am folosit acea optiune si acum nu mai apare stack smashing.<br><div id="yui_3_16_0_ym19_1_1489515811127_39519"><span></span></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489515811127_39674">Vreo sugestie in vederea repararii problemei?<br>Multumesc anticipat!<br><span></span></div><div class="qtdSeparateBR"><br><br></div><div style="display: block;" id="yui_3_16_0_ym19_1_1489515811127_39538" class="yahoo_quoted"> <div id="yui_3_16_0_ym19_1_1489515811127_39537" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div id="yui_3_16_0_ym19_1_1489515811127_39536" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div id="yui_3_16_0_ym19_1_1489515811127_39535" dir="ltr"> <font id="yui_3_16_0_ym19_1_1489515811127_39534" face="Arial" size="2"> <hr id="yui_3_16_0_ym19_1_1489515811127_39658" size="1"> <b><span style="font-weight:bold;">From:</span></b> Mihai Barbulescu <b12mihai@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> Sisteme de Operare <so@cursuri.cs.pub.ro>; Ionutz Sc <ionut_sc94@yahoo.com> <br> <b><span style="font-weight: bold;">Sent:</span></b> Tuesday, March 14, 2017 9:04 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [so] [Tema1][Linux] stack smash detected<br> </font> </div> <div id="yui_3_16_0_ym19_1_1489515811127_39539" class="y_msg_container"><br><div id="yiv8117045356"><div id="yui_3_16_0_ym19_1_1489515811127_39546"><div id="yui_3_16_0_ym19_1_1489515811127_39545">Problema e ca ai buffer overflow și nu memory leaks. Undeva faci un acces peste dimensiunea stivei <div id="yui_3_16_0_ym19_1_1489515811127_39586"><br clear="none"></div><div id="yui_3_16_0_ym19_1_1489515811127_39548">Poti dezactiva temporar mecanismul din gcc folosind opțiunea nepermisa -fno-stack-protector și sa vezi dacă dispare </div><div id="yui_3_16_0_ym19_1_1489515811127_39600"><br clear="none"></div><div id="yui_3_16_0_ym19_1_1489515811127_39601">Valgrind nu e capabil sa detecteze asa ceva. Baga cu gdb pe acel print problema după ce ai compilat fără opțiunea de care zic </div></div><div id="yui_3_16_0_ym19_1_1489515811127_39737" class="yiv8117045356gmail_extra"><br clear="none"><div id="yui_3_16_0_ym19_1_1489515811127_39743" class="yiv8117045356gmail_quote">On 14 Mar 2017 20:44, "Ionutz Sc via so" <<a rel="nofollow" shape="rect" ymailto="mailto:so@cursuri.cs.pub.ro" target="_blank" href="mailto:so@cursuri.cs.pub.ro">so@cursuri.cs.pub.ro</a>> wrote:<br clear="none"><blockquote id="yui_3_16_0_ym19_1_1489515811127_39742" class="yiv8117045356gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="yiv8117045356yqt1603177401" id="yiv8117045356yqt41978"><div id="yui_3_16_0_ym19_1_1489515811127_39741"><div id="yui_3_16_0_ym19_1_1489515811127_39740" style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"><div id="yiv8117045356m_4834285692806189688yui_3_16_0_ym19_1_1489515811127_19572">Buna seara,</div><div id="yiv8117045356m_4834285692806189688yui_3_16_0_ym19_1_1489515811127_19622"><br clear="none"></div><div dir="ltr" id="yiv8117045356m_4834285692806189688yui_3_16_0_ym19_1_1489515811127_19604">Pe linux, cand testez tema cu comanda "valgrind ./tema1 256 < <a rel="nofollow" shape="rect" target="_blank" href="http://date.in/">date.in</a>" (<a rel="nofollow" shape="rect" target="_blank" href="http://date.in/">date.in</a> contine primele 3 linii din testul 22), valgrind nu seziseaza niciun leak de memorie:<br clear="none">All heap blocks were freed -- no leaks are possible<br clear="none">ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)<br clear="none">insa la output apare si *** stack smashing detected ***: ./tema1 terminated</div><div dir="ltr" id="yiv8117045356m_4834285692806189688yui_3_16_0_ym19_1_1489515811127_19985">Nu reusesc sa-mi dau seama ce anume provoaca stack smashing-ul.</div><div dir="ltr" id="yiv8117045356m_4834285692806189688yui_3_16_0_ym19_1_1489515811127_20015">Am testat in loc de linia cu print_bucket si cu un sir de caractere random de genul:<br clear="none">asdadfasda asdasdasdasd asdasdasdasd</div><div dir="ltr" id="yiv8117045356m_4834285692806189688yui_3_16_0_ym19_1_1489515811127_20282">Am observat ca daca las doar 2 cuvinte random pe acea linie, nu face stack smashing, doar cu 3 face.<br clear="none">Multumesc anticipat!<br clear="none"><br clear="none">Cu stima,</div><div dir="ltr" id="yiv8117045356m_4834285692806189688yui_3_16_0_ym19_1_1489515811127_20432">Ionut Niculici<br clear="none"></div></div></div></div><br clear="none">______________________________ _________________<br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="http://ocw.cs.pub.ro/courses/so/info/lista-discutii">http://ocw.cs.pub.ro/courses/ so/info/lista-discutii</a><br clear="none"></blockquote></div></div></div></div><br><br></div> </div> </div> </div></div></body></html>