| Summary: | BB making easily-fixed non-portable assumptions | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | bugdal |
| Component: | Standard Compliance | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | busybox-cvs |
| Priority: | P5 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Host: | Target: | ||
| Build: | |||
| Attachments: |
Patch
config file for which COMMON_BUFSIZE is too small. |
||
|
Description
bugdal
2011-01-15 23:19:29 UTC
Created attachment 2851 [details]
Patch
> 2. COMMON_BUFSIZE is insufficient for inetd unless libc BUFSIZ is >= ~2k. Patch
> fixes it, but some tweaking may be desired to find the minimal value that will
> work.
Please attach the .config where it happens.
I can if you like, but it happens whenever inetd is enabled (even with no internal services) and BUFSIZ==1024. Created attachment 2857 [details]
config file for which COMMON_BUFSIZE is too small.
(In reply to comment #4) > Created attachment 2857 [details] > config file for which COMMON_BUFSIZE is too small. I added this test printouts to networking/inetd.c: int inetd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int inetd_main(int argc UNUSED_PARAM, char **argv) { struct sigaction sa, saved_pipe_handler; servtab_t *sep, *sep2; struct passwd *pwd; struct group *grp = grp; /* for compiler */ int opt; pid_t pid; sigset_t omask; INIT_G(); bb_error_msg("sizeof(G):%ld", (long)sizeof(G)); bb_error_msg("COMMON_BUFSIZE:%ld", (long)COMMON_BUFSIZE); exit(0); With your .config, building against 64-bit glibc I see: $ ./busybox inetd inetd: sizeof(G):464 inetd: COMMON_BUFSIZE:8193 when I additionally enable all inetd options, I see: inetd: sizeof(G):608 inetd: COMMON_BUFSIZE:8193 And finally, building this .config against 32-bit uclibc configured for BUFSIZ=1024, I see: inetd: sizeof(G):584 inetd: COMMON_BUFSIZE:1025 I don't see the problem. Please explain where is it. Indeed, after further investigation, the COMMON_BUFSIZE issue was coming from a bug in my build environment which was bloating the size of inetd's globals, and not from BB. The other issues in this bug report still stand. I incorporated sys/sysmacros.h and fdprintf fixes. Thanks! |