RTEMS (+epics) on a mvme167: Problems with environ

Till Straumann strauman at slac.stanford.edu
Fri Jul 16 17:08:55 UTC 2010


On 07/16/2010 05:19 PM, Jan C. Bernauer wrote:
>  Hi,
>
>  I am struggling to get RTEMS+EPICS working on an mvme167 (m68k based
> vme cpu).
>
> Tools are installed, and the test programs I tried seem to work.
> However, trying to run rtemsTestHarness from EPICS fails when strncmp
> tries to access a null pointer.
> I traced it back to setenv: A test program with the rtems shell also
> fails on setenv.
> As far as I see, the environ pointer is 0.

You should try to find out where your 'environ' pointer comes from (use
  a linker map by adding -Wl,-Map,xxx.map).

It should never be NULL -- newlib (environ.c) sets it initially

/* Provide a definition of `environ' if crt0.o doesn't.  */

static char *initial_env[] = { 0 };

/* Posix says `environ' is a pointer to a null terminated list of pointers.
    Hence `environ' itself is never NULL.  */
char **environ = &initial_env[0];


-- Till
>
> How should the BSP set this up? Just malloc a block of memory at init 
> time?
>
> Best regards,
> Jan C. Bernauer
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-users




More information about the users mailing list