-1

I am debugging memory corruption issue and I want to check whether SF is accessing invalid memory or not but I don't know how to launch SF using command line. Please help.

1 Answers1

0

SurfaceFlinger is started by the system fairly early on, and isn't usually launched by the user from the command line.

One approach would be to insert the valgrind command into the initd control script, modifying init.rc. This is harder than it sounds because of the way the rootdir is mounted.

Replacing the surfaceflinger binary with one that launches SurfaceFlinger running under valgrind should work; just make sure you wait() for it to finish or initd will assume it died when the launcher exits.

Of course, the best way to tell whether or not SurfaceFlinger is accessing invalid memory is to see if it crashes, though perhaps your definition of "invalid" extends beyond "unmapped or mapped incompatibly".

You'll get some complaints out of valgrind from various ioctl()s, particularly where the Hardware Composer is concerned.

fadden
  • 51,356
  • 5
  • 116
  • 166