This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
strtok and default _REENT structure
- From: Dakota Boin <dakotaboin at gmail dot com>
- To: "newlib at sourceware dot org" <newlib at sourceware dot org>
- Date: Tue, 5 Jul 2016 18:27:22 -0700
- Subject: strtok and default _REENT structure
- Authentication-results: sourceware.org; auth=none
Hi all,
Looking for some assistance with the strtok function in newlib. The
function crashes at line strtok.c:102 in a nested macro _REENT_CHECK
called from _REENT_CHECK_MISC. The problem seems to be that the
pointer to the default structure for _REENT is defined as an invalid
memory address and the _REENT_CHECK function attempts to dereference
this invalid pointer and crashes. Incase the address of the pointer is
relevant, it is '0x4001fefe'.
For reference I am targeting a bare metal arm M0+ and my compilation
options were:
--target=arm-none-eabi \
--disable-newlib-supplied-syscalls \
--disable-nls \
--enable-newlib-reent-small \
--disable-newlib-fvwrite-in-streamio \
--disable-newlib-fseek-optimization \
--disable-newlib-wide-orient \
--enable-newlib-nano-malloc \
--disable-newlib-unbuf-stream-opt \
--enable-lite-exit \
--enable-newlib-global-atexit \
--enable-newlib-nano-formatted-io
Happy to provide more information. Any help would be appreciated.
Best,
Dakota