BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001394 [uClibc] Other minor always 06-16-07 18:22 09-15-07 01:49
Reporter ahoying View Status public  
Assigned To uClibc
Priority normal Resolution unable to reproduce  
Status closed   Product Version
Summary 0001394: strsep broken in 0.9.29, works fine in 0.9.28.3 and earlier
Description The changes made to the strsep code have caused it, in my application, to not return NULL after it hits the last token. For instance the following code will loop forever, continuously returning the last token (1 in the example) once it has walked through the string:

copyptr = "2:45:29:325:0:TEST:1"; // Just an example
while ( (token[i] = strsep(&copyptr, ":")) > 0 )
{
...
}
Additional Information Earlier versions did not have this problem. I compiled uClibc with gcc 4.1.2 for i486 AMD Elan with the following options enabled in .config:

TARGET_i386=y
TARGET_ARCH="i386"
FORCE_OPTIONS_FOR_ARCH=y
CONFIG_ELAN=y
TARGET_SUBARCH=""
ARCH_LITTLE_ENDIAN=y
ARCH_HAS_MMU=y
ARCH_USE_MMU=y
UCLIBC_HAS_FLOATS=y
UCLIBC_HAS_FPU=y
DO_C99_MATH=y
KERNEL_HEADERS="/devel/usr/src/buildroot/toolchain_build_i486/linux/include"
HAVE_DOT_CONFIG=y
DOPIC=y
HAVE_SHARED=y
LDSO_LDD_SUPPORT=y
LDSO_CACHE_SUPPORT=y
LDSO_BASE_FILENAME="ld.so"
UCLIBC_STATIC_LDCONFIG=y
LDSO_RUNPATH=y
UCLIBC_CTOR_DTOR=y
UCLIBC_HAS_THREADS=y
LINUXTHREADS_OLD=y
UCLIBC_HAS_LFS=y
MALLOC_STANDARD=y
MALLOC_GLIBC_COMPAT=y
UCLIBC_DYNAMIC_ATEXIT=y
UCLIBC_SUSV3_LEGACY=y
UCLIBC_SUSV3_LEGACY_MACROS=y
UCLIBC_HAS_SHADOW=y
UCLIBC_HAS___PROGNAME=y
UNIX98PTY_ONLY=y
ASSUME_DEVPTS=y
UCLIBC_HAS_TM_EXTENSIONS=y
UCLIBC_HAS_TZ_CACHING=y
UCLIBC_HAS_TZ_FILE=y
UCLIBC_HAS_TZ_FILE_READ_MANY=y
UCLIBC_TZ_FILE_PATH="/etc/TZ"
UCLIBC_PWD_BUFFER_SIZE=256
UCLIBC_GRP_BUFFER_SIZE=256
UCLIBC_HAS_STRING_GENERIC_OPT=y
UCLIBC_HAS_STRING_ARCH_OPT=y
UCLIBC_HAS_CTYPE_TABLES=y
UCLIBC_HAS_CTYPE_SIGNED=y
UCLIBC_HAS_CTYPE_CHECKED=y
UCLIBC_HAS_WCHAR=y
UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
UCLIBC_HAS_STDIO_BUFSIZ_4096=y
UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
UCLIBC_HAS_STDIO_GETC_MACRO=y
UCLIBC_HAS_STDIO_PUTC_MACRO=y
UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
UCLIBC_HAS_ERRNO_MESSAGES=y
UCLIBC_HAS_SIGNUM_MESSAGES=y
UCLIBC_HAS_GNU_GETOPT=y
UCLIBC_HAS_GNU_GETSUBOPT=y
UCLIBC_HAS_REGEX=y
UCLIBC_HAS_REGEX_OLD=y
UCLIBC_HAS_FNMATCH=y
UCLIBC_HAS_FNMATCH_OLD=y
UCLIBC_HAS_FTW=y
UCLIBC_HAS_GLOB=y
SHARED_LIB_LOADER_PREFIX="/lib"
RUNTIME_PREFIX="/"
DEVEL_PREFIX="/usr/"
UCLIBC_HAS_ARC4RANDOM=y
UCLIBC_BUILD_RELRO=y
UCLIBC_BUILD_NOEXECSTACK=y
CROSS_COMPILER_PREFIX=""
UCLIBC_EXTRA_CFLAGS=""
DOSTRIP=y
WARNINGS="-Wall"
Attached Files

- Relationships

- Notes
(0002744)
vapier
09-15-07 01:49

i'm unable to reproduce this on x86_64 or i386 (tried both arch-optimized and generic ones)

test case is simple:
  char one[50];
  char *cp, *ptr;
  cp = strcpy(one, "2:45:29:325:0:TEST:1");
  while ((ptr = strsep(&cp, ":")) > 0)
    printf("ptr = %s\n", ptr);

and i get:
ptr = 2
ptr = 45
ptr = 29
ptr = 325
ptr = 0
ptr = TEST
ptr = 1

you'll have to build with debug enabled and throw it through gdb ...
 

- Issue History
Date Modified Username Field Change
06-16-07 18:22 ahoying New Issue
06-16-07 18:22 ahoying Status new => assigned
06-16-07 18:22 ahoying Assigned To  => uClibc
09-15-07 01:49 vapier Note Added: 0002744
09-15-07 01:49 vapier Status assigned => closed
09-15-07 01:49 vapier Resolution open => unable to reproduce
09-15-07 01:49 vapier Description Updated
09-15-07 01:49 vapier Additional Information Updated


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker