Forum Stats

  • 3,826,035 Users
  • 2,260,587 Discussions
  • 7,896,770 Comments

Discussions

discover doesn't like aslr=enable executables

RaiderOfTheLostSPARC
RaiderOfTheLostSPARC Member Posts: 259 Blue Ribbon

Known bug? Solaris 11.2 SRU 6.5, x86, Studio 12.4

Caution: I just killed my server running a.out a few times, prstat showed:

   PID USERNAME  SIZE   RSS STATE   PRI NICE      TIME  CPU PROCESS/NLWP
 25332 raider       64G   58G cpu2      1    0   0:04:48 1.4% a.out/1

$ cat ascii.c

#include <ctype.h>

#include <locale.h>

#include <stdio.h>

int main(void)

{

        int i = 0;

        (void)setlocale(LC_ALL, "");

        for (; i<128; i++) {

                if (isprint(i))

                        (void)printf("%c", i);

                else

                        (void)printf("?");

                if (i % 32 == 31)

                        (void)printf("\n");

        }

        return 0;

}

$ cc -m64 -g -z aslr=enable ascii.c

$ discover -w - a.out

$ ./a.out

DISCOVER: Out of memory.  Aborting...

Abort(coredump)

Answers

  • Rajp-Oracle
    Rajp-Oracle Member Posts: 20
    edited Mar 3, 2015 11:00AM

    Yes, it is a know problem but thank you for reporting it. We have fixed it in the development version. The problem is because the heap allocations are not as "straightforward" was they are without ASLR.The workaround for now is to not use ASLR for binaries that you are going to Discover.

This discussion has been closed.