This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

pstree -a gives SEGV

    Hi all,

  Dunno about everyone else, but on my system "pstree -a" crashes with a SEGV
everytime.  On looking into it, it turns out to be because the process object
it creates for pid 1 (we don't have a real init process on cygwin) isn't fully
initialised (it works by lazy initialisation, creating the object for a given
pid when it first finds a reference to that pid as ppid of another process,
but it doesn't fill in the details until that pid is subsequently enumerated,
and we don't have a psuedo-entry in /proc/1, even though we use it as the ppid
of top-level cygwin processes, so the entry for pid 1 gets created but never
filled in and we crash when we try and print out its command line, since the
supposed argc is some uninitialised and generally huge/negative hex number).

  Anyway if anyone else wants "pstree -a" to work, I found the attached patch
solved the problem for me.  The first hunk fixes a minor build error, the
second ensures a sane default (i.e. empty) command line if there's no real
/proc entry for the pid.  You also may need to take care of config options and
adding -lintl, as described in the original announcement[*].

dk@rainbow /artimi/chips/tulla> /usr/build/install/bin/cygcheck.exe -c psmisc
Cygwin Package Information
Package              Version        Status
psmisc               21.5-1         OK
dk@rainbow /artimi/chips/tulla>


[*] -
Can't think of a witty .sigline today....

Attachment: pstree-segv-fix.diff
Description: Binary data

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]