[procps] Re: newlib, ps fix

  • From: Jim Warner <james.warner@xxxxxxxxxxx>
  • To: Procps-ng Mail list <procps@xxxxxxxxxxxxx>
  • Date: Sun, 30 Aug 2015 12:25:20 -0500

On 08/30/2015 08:17 AM, Craig Small wrote:

On Sun, Aug 30, 2015 at 10:05:23PM +1000, Craig Small wrote:
I'll attach my test program. I'm probably doing something wrong but it
means the library should be saying what and not crashing about it
either.
Hmm, not sure how we can actually test for this, library was expecting
an array, I sent an int. I now have the reap part of the library
working ok as a test and getting sensible results too. Excuse the
hard-coded positions in the printf, I'll fix them later.

Hi Craig,

Boy was I suprised to learn of that silent gcc conversion of an enum into a pointer. Only clang (which I'm using henceforth) offers any sort of warning.

Anyway, to protect newlib against you/us I have beefed up the 'items' parameter checking. It even eliminates the SEGV in your version #1 of
test.c. I'll be looking at possibly strengthening other parameter checks too.

The attached contains that fix and 5 other patches. Among them is a conversion of pmap to newlib. I still don't have the courage to tackle ps as of yet.

Regards,
Jim

p.s. And congratulations on your first successful 'reap'. Remember, top uses both 'reap' and 'fill' so can serve as an example.

Attachment: newlib-grab-bag.tgz
Description: application/compressed-tar

Other related posts: