[BusyBox 0001226]: static busybox break tftp

bugs at busybox.net bugs at busybox.net
Mon Feb 19 15:46:42 UTC 2007


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=1226 
====================================================================== 
Reported By:                goutnet
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   1226
Category:                   Networking Support
Reproducibility:            always
Severity:                   block
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             02-16-2007 07:47 PST
Last Modified:              02-19-2007 07:46 PST
====================================================================== 
Summary:                    static busybox break tftp
Description: 
tftp can not download any file when compiled as static (with glibc), I have
not tried with uClibc :

client:

:/$ /bin/tftp -g -l /tmp/version.txt -r /rootfs/version.txt 10.0.0.1
using server "10.0.0.1:69", remotefile "/rootfs/version.txt", localfile
"/tmp/version.txt".
sending 28 bytes
00 01 2f 72 6f 6f 74 66 73 2f 76 65 72 73 69 6f 6e 2e 74 78 74 00 6f 63 74
65 74 00
tftp: timeout
sending 28 bytes
00 01 2f 72 6f 6f 74 66 73 2f 76 65 72 73 69 6f 6e 2e 74 78 74 00 6f 63 74
65 74 00
tftp: timeout
sending 28 bytes
00 01 2f 72 6f 6f 74 66 73 2f 76 65 72 73 69 6f 6e 2e 74 78 74 00 6f 63 74
65 74 00
tftp: timeout
sending 28 bytes
00 01 2f 72 6f 6f 74 66 73 2f 76 65 72 73 69 6f 6e 2e 74 78 74 00 6f 63 74
65 74 00
tftp: timeout
sending 28 bytes
00 01 2f 72 6f 6f 74 66 73 2f 76 65 72 73 69 6f 6e 2e 74 78 74 00 6f 63 74
65 74 00
tftp: timeout
tftp: last timeout


server log :

Feb 16 16:45:58 eikichi atftpd[14858]: Serving /rootfs/version.txt to
192.168.100.71:32925
Feb 16 16:45:58 eikichi atftpd[14858]: timeout: retrying...
Feb 16 16:46:23 eikichi last message repeated 8 times
Feb 16 16:46:28 eikichi atftpd[14858]: Serving /rootfs/version.txt to
192.168.100.71:32925
Feb 16 16:46:33 eikichi atftpd[14858]: timeout: retrying...
Feb 16 16:46:38 eikichi atftpd[14858]: timeout: retrying...
Feb 16 16:46:38 eikichi atftpd[14858]: Serving /rootfs/version.txt to
192.168.100.71:32925
Feb 16 16:46:43 eikichi atftpd[14858]: timeout: retrying...
Feb 16 16:47:03 eikichi last message repeated 7 times


looking to tcpdump, the answer is sent from the server, but the client
does not listen ... I tried several other clients, all works ...
====================================================================== 

---------------------------------------------------------------------- 
 vda - 02-17-07 08:10  
---------------------------------------------------------------------- 
I think your build produced the following warning:

#warning Static linking against glibc produces buggy executables
#warning (glibc does not cope well with ld --gc-sections).
#warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400
#warning Note that glibc is unsuitable for static linking anyway.
#warning If you still want to do it, remove -Wl,--gc-sections
#warning from top-level Makefile and remove this warning.

Did you try non-static build? Did you remove -Wl,--gc-sections?

Please show those tcpdumps you mention.

Also there were some fixes to tftp recently, consider testing current svn. 

---------------------------------------------------------------------- 
 goutnet - 02-19-07 07:46  
---------------------------------------------------------------------- 
I did remove the mentionned code, applying a selfmade patch :

Index: busybox/Makefile
===================================================================
--- busybox.orig/Makefile	2007-02-15 16:42:26.000000000 +0100
+++ busybox/Makefile	2007-02-15 16:42:29.000000000 +0100
@@ -563,7 +563,7 @@
 quiet_cmd_busybox__ ?= LINK    $@
       cmd_busybox__ ?= $(srctree)/scripts/trylink $(CC) $(LDFLAGS) \
       -o $@ \
-      -Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections \
+      -Wl,--warn-common -Wl,--sort-common \
       -Wl,--start-group $(busybox-all) -Wl,--end-group
 
 # Generate System.map
Index: busybox/applets/applets.c
===================================================================
--- busybox.orig/applets/applets.c	2007-02-15 16:43:00.000000000 +0100
+++ busybox/applets/applets.c	2007-02-15 16:43:07.000000000 +0100
@@ -15,16 +15,6 @@
 #include "busybox.h"
 #include <assert.h>
 
-/* Apparently uclibc defines __GLIBC__ (compat trick?). Oh well. */
-#if ENABLE_STATIC && defined(__GLIBC__) && !defined(__UCLIBC__)
-#warning Static linking against glibc produces buggy executables
-#warning (glibc does not cope well with ld --gc-sections).
-#warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400
-#warning Note that glibc is unsuitable for static linking anyway.
-#warning If you still want to do it, remove -Wl,--gc-sections
-#warning from top-level Makefile and remove this warning.
-#endif
-
 #if ENABLE_SHOW_USAGE && !ENABLE_FEATURE_COMPRESS_USAGE
 static const char usage_messages[] =
 #define MAKE_USAGE

a non static build work (as mentionned), only static build fails, I'll
redo the tcpdump thing when I can (and I will try the svn version as well) 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
02-16-07 07:47  goutnet        New Issue                                    
02-16-07 07:47  goutnet        Status                   new => assigned     
02-16-07 07:47  goutnet        Assigned To               => BusyBox         
02-16-07 07:47  goutnet        File Added: .config                          
02-17-07 08:10  vda            Note Added: 0002177                          
02-19-07 07:46  goutnet        Note Added: 0002181                          
======================================================================




More information about the busybox-cvs mailing list