[Bug 231] sysctl -p [file] doesn't work

bugzilla at busybox.net bugzilla at busybox.net
Sat May 9 02:09:57 UTC 2009


https://bugs.busybox.net/show_bug.cgi?id=231


Denys Fedoryshchenko <denys at visp.net.lb> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |




--- Comment #3 from Denys Fedoryshchenko <denys at visp.net.lb>  2009-05-09 02:09:57 UTC ---
Sorry for long time, i just worked a bit on bug to find out whats wrong.
I added few debug lines

               /* parser->line is big enough for sprintf */
                printf("Len of line is %d, current value is %s, token[0] data
%s len %d and token[1] data %s len
%d\n",strlen(parser->line),parser->line,token[0],strlen(token[0]),token[1],strlen(token[1
                sprintf(parser->line, "%s=%s", token[0], token[1]);
                printf("!!! %s=%s / %s \n",token[0],token[1],parser->line);


Len of line is 19, current value is net/ipv4/ip_forward, token[0] data
net/ipv4/ip_forward len 19 and token[1] data 1 len 1
!!! =1=1 / =1

If i disable compiler optimizations (CONFIG_DEBUG_PESSIMIZE) - everything
becoming fine.
It seems compiler optimizing something and on sprintf he is screwing idea of
reusing parser->line.

I test on multiple computers to make sure, that it is not my gcc fault.

Also i modify source a bit:
                /* parser->line is big enough for sprintf */
                printf("token[0]:'%s'
parser->line:'%s'\n",token[0],parser->line);
                sprintf(parser->line,"testtest");
                printf("token[0]:'%s'
parser->line:'%s'\n",token[0],parser->line);
                sprintf(parser->line, "%s=%s", token[0], token[1]);

and got:
token[0]:'net/ipv4/ip_forward' parser->line:'net/ipv4/ip_forward'
token[0]:'testtest' parser->line:'testtest'


and seems that token[0] have same address as parser->line?

Let me know if i should close this bug, but i think people who use gcc 4.3.3
will hit same bug.


-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the busybox-cvs mailing list