Linux gnu m4 help

Joel Sherrill <joel@OARcorp.com> joel.sherrill at OARcorp.com
Tue Feb 22 15:43:41 UTC 2005


It appears to run and not dump core as best I can tell.

  m4  gm4_gdbinit.txt

The paths in the script are not valid for me though.

--joel

Peter Dufault wrote:
> 
> On Feb 18, 2005, at 10:10 AM, Peter Dufault wrote:
> 
>> It is a bug in m4.  I tried the latest. On line 734, src/format.c of 
>> GNU m4 1.4.2 it is doing:
>>
>> sprint(str, fstart, ...
> 
> 
> While waiting and hoping that rtem 4.7 now builds for me, I'm trying to 
> figure out why I'm seeing the stack overflow in M4 on FreeBSD during 
> "bootstrap" and others are not on Linux and Cygwin.
> 
> Looking at m4 1.4.2 I see that the corruption is being detected by gm4's 
> "src/stackovf.c", which is conditionally included during configuration, 
> so maybe it isn't in use on Linux.
> 
> Could someone with Linux build GNU m4 1.4.2 with debugging and run the 
> following GDB script against it in their rtems 4.7 source directory to 
> see if the stack is corrupted but that it isn't being noticed?  I've 
> attached it as a ".txt" file to get past the censors.
> 
> Run as:
> gdb gm4 -x gm4_gdbinit.txt
> (or whatever GNU m4 1.4.2 with debugging is on your system)
> 
> On FreeBSD I get:
> 
> 536       fmt = ARG_STR (argc, argv);
> format (obs=0x80637e0, argc=1, argv=0x8124010) at format.c:727
> 727               if (width != -1 && prec != -1)
> sizeof(str) is 256 and the format is "%-349s"
> (gdb)
> 
> showing that the sprintf into str will corrupt the stack.
> 
> 
> Thanks,
> 
> Peter
> 
> Peter Dufault
> HD Associates, Inc.
> 
> 
> ------------------------------------------------------------------------
> 
> cd rtems-4.7/c/src/lib/libbsp/powerpc/dmv177
> set args --nesting-limit=1024 --include=/usr/local/share/autoconf259 --debug=aflq --fatal-warning --error-output=autom4te.cache/traces.2t --trace=AC_CANONICAL_HOST --trace=AC_CANONICAL_SYSTEM --trace=AC_CHECK_FUNCS --trace=AC_CHECK_HEADERS --trace=AC_CHECK_LIB --trace=AC_CHECK_MEMBERS --trace=AC_CHECK_TYPES --trace=AC_CONFIG_AUX_DIR --trace=AC_CONFIG_FILES --trace=AC_CONFIG_HEADERS --trace=AC_CONFIG_LIBOBJ_DIR --trace=AC_CONFIG_LINKS --trace=AC_CONFIG_SUBDIRS --trace=AC_C_CONST --trace=AC_C_INLINE --trace=AC_C_VOLATILE --trace=AC_DECL_SYS_SIGLIST --trace=AC_DEFINE_TRACE_LITERAL --trace=AC_DEFUN --trace=AC_DEFUN_ONCE --trace=AC_FUNC_ALLOCA --trace=AC_FUNC_CHOWN --trace=AC_FUNC_CLOSEDIR_VOID --trace=AC_FUNC_ERROR_AT_LINE --trace=AC_FUNC_FORK --trace=AC_FUNC_FSEEKO --trace=AC_FUNC_GETGROUPS --trace=AC_FUNC_GETLOADAVG --trace=AC_FUNC_GETMNTENT --trace=AC_FUNC_GETPGRP --trace=AC_FUNC_LSTAT --trace=AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK --trace=AC_FUNC_MALLOC --trace=AC_FUNC_MBRTO
WC --trace=AC_FUNC_MEMCMP --trace=AC_FUNC_MKTIME --trace=AC_FUNC_MMAP --trace=AC_FUNC_OBSTACK --trace=AC_FUNC_REALLOC --trace=AC_FUNC_SELECT_ARGTYPES --trace=AC_FUNC_SETPGRP --trace=AC_FUNC_SETVBUF_REVERSED --trace=AC_FUNC_STAT --trace=AC_FUNC_STRCOLL --trace=AC_FUNC_STRERROR_R --trace=AC_FUNC_STRFTIME --trace=AC_FUNC_STRNLEN --trace=AC_FUNC_STRTOD --trace=AC_FUNC_UTIME_NULL --trace=AC_FUNC_VPRINTF --trace=AC_FUNC_WAIT3 --trace=AC_HEADER_DIRENT --trace=AC_HEADER_MAJOR --trace=AC_HEADER_STAT --trace=AC_HEADER_STDC --trace=AC_HEADER_SYS_WAIT --trace=AC_HEADER_TIME --trace=AC_INIT --trace=AC_LIBSOURCE --trace=AC_PATH_X --trace=AC_PROG_AWK --trace=AC_PROG_CC --trace=AC_PROG_CPP --trace=AC_PROG_CXX --trace=AC_PROG_GCC_TRADITIONAL --trace=AC_PROG_INSTALL --trace=AC_PROG_LEX --trace=AC_PROG_LIBTOOL --trace=AC_PROG_LN_S --trace=AC_PROG_MAKE_SET --trace=AC_PROG_RANLIB --trace=AC_PROG_YACC --trace=AC_REPLACE_FNMATCH --trace=AC_STRUCT_ST_BLOCKS --trace=AC_STRUCT_TIMEZONE --trace=AC_STRU
CT_TM --trace=AC_SUBST --trace=AC_TYPE_MODE_T --trace=AC_TYPE_OFF_T --trace=AC_TYPE_PID_T --trace=AC_TYPE_SIGNAL --trace=AC_TYPE_SIZE_T --trace=AC_TYPE_UID_T --trace=AH_OUTPUT --trace=AM_AUTOMAKE_VERSION --trace=AM_AUX_DIR_EXPAND --trace=AM_CONDITIONAL --trace=AM_DEP_TRACK --trace=AM_GNU_GETTEXT --trace=AM_INIT_AUTOMAKE --trace=AM_MAINTAINER_MODE --trace=AM_MAKE_INCLUDE --trace=AM_MISSING_HAS_RUN --trace=AM_MISSING_PROG --trace=AM_OUTPUT_DEPENDENCY_COMMANDS --trace=AM_PROG_CC_C_O --trace=AM_PROG_INSTALL_SH --trace=AM_PROG_INSTALL_STRIP --trace=AM_PROG_MKDIR_P --trace=AM_RUN_LOG --trace=AM_SANITY_CHECK --trace=AM_SET_CURRENT_AUTOMAKE_VERSION --trace=AM_SET_DEPDIR --trace=AM_SET_LEADING_DOT --trace=AU_DEFUN --trace=RTEMS_ARG_VAR --trace=RTEMS_BSPOPTS_HELP --trace=RTEMS_BSPOPTS_SET --trace=RTEMS_BSP_CONFIGURE --trace=RTEMS_CANONICALIZE_TOOLS --trace=RTEMS_CANONICAL_TARGET_CPU --trace=RTEMS_CHECK_CUSTOM_BSP --trace=RTEMS_CHECK_MULTIPROCESSING --trace=RTEMS_CHECK_NETWORKING --trac
e=RTEMS_CHECK_TOOL --trace=RTEMS_ENABLE_MULTILIB --trace=RTEMS_ENABLE_MULTIPROCESSING --trace=RTEMS_ENABLE_NETWORKING --trace=RTEMS_ENABLE_RTEMSBSP --trace=RTEMS_ENV_RTEMSBSP --trace=RTEMS_GCC_ISYSTEM --trace=RTEMS_GCC_PIPE --trace=RTEMS_GCC_SPECS --trace=RTEMS_PPC_EXCEPTIONS --trace=RTEMS_PROG_CC --trace=RTEMS_PROG_CCAS --trace=RTEMS_PROG_CC_FOR_TARGET --trace=RTEMS_PROJECT_ROOT --trace=RTEMS_TOP --trace=RTEMS_VERSIONING --trace=_AC_AM_CONFIG_HEADER_HOOK --trace=_AM_DEPENDENCIES --trace=_AM_IF_OPTION --trace=_AM_MANGLE_OPTION --trace=_AM_OUTPUT_DEPENDENCY_COMMANDS --trace=_AM_PROG_TAR --trace=_AM_SET_OPTION --trace=_AM_SET_OPTIONS --trace=_RTEMS_CHECK_CUSTOM_BSP --trace=_m4_warn --trace=include --trace=jm_MAINTAINER_MODE --trace=m4_include --trace=m4_pattern_allow --trace=m4_pattern_forbid --trace=m4_sinclude --reload-state=/usr/local/share/autoconf259/autoconf/autoconf.m4f /usr/local/share/aclocal19/amversion.m4 /usr/local/share/aclocal19/auxdir.m4 /usr/local/share/aclocal1
9/cond.m4 /usr/local/share/aclocal19/depend.m4 /usr/local/share/aclocal19/depout.m4 /usr/local/share/aclocal19/init.m4 /usr/local/share/aclocal19/install-sh.m4 /usr/local/share/aclocal19/lead-dot.m4 /usr/local/share/aclocal19/maintainer.m4 /usr/local/share/aclocal19/make.m4 /usr/local/share/aclocal19/missing.m4 /usr/local/share/aclocal19/mkdirp.m4 /usr/local/share/aclocal19/options.m4 /usr/local/share/aclocal19/runlog.m4 /usr/local/share/aclocal19/sanity.m4 /usr/local/share/aclocal19/strip.m4 /usr/local/share/aclocal19/tar.m4 ../../../../aclocal/bsp-configure.m4 ../../../../aclocal/bspopts.m4 ../../../../aclocal/canonical-target-name.m4 ../../../../aclocal/canonicalize-tools.m4 ../../../../aclocal/check-custom-bsp.m4 ../../../../aclocal/check-multiprocessing.m4 ../../../../aclocal/check-networking.m4 ../../../../aclocal/check-tool.m4 ../../../../aclocal/enable-multiprocessing.m4 ../../../../aclocal/enable-networking.m4 ../../../../aclocal/enable-rtemsbsp.m4 ../../../../acloca
l/env-rtemsbsp.m4 ../../../../aclocal/gcc-isystem.m4 ../../../../aclocal/gcc-pipe.m4 ../../../../aclocal/gcc-specs.m4 ../../../../aclocal/multilib.m4 ../../../../aclocal/ppc.m4 ../../../../aclocal/prog-cc.m4 ../../../../aclocal/prog-ccas.m4 ../../../../aclocal/project-root.m4 ../../../../aclocal/rtems-top.m4 ../../../../aclocal/version.m4 configure.ac
> break format
> ignore 1 13
> run
> until 727
> printf "sizeof(str) is %d and the format is \"%s\"\n", sizeof(str), fstart
> 
> 
> ------------------------------------------------------------------------
> 
> 


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985




More information about the users mailing list