all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* QNX subprocess bug
@ 2006-03-25  5:34 Bob Bramwell
  2006-03-26  0:22 ` Richard Stallman
  0 siblings, 1 reply; 13+ messages in thread
From: Bob Bramwell @ 2006-03-25  5:34 UTC (permalink / raw)


I submitted an article about this a month or so ago but never saw it come 
around, so my apologies if this is old news to you.

The bug is showing up in emacs 21.2.1 on QNX 6.3.0.  It appears that process IDs 
  on QNX really occupy 32-bits.  Some of them are quite large.  This causes a 
problem in the subprocess package which uses an elisp integer (28 bits + type 
info - I think) to try to store the PID.  An added complication is that there is 
a cheap-and-cheerful "just stuff this value into this elisp int" macro which (in 
this case) has the effect of clobbering the type bits, ultimately resulting in 
what appears to be a garbage collector infinite recursion crash.

Obvious this problem could, in principle, arise on any system that uses 32-bit 
process IDs, and it seems to me rather sloppy programming to use such a 
shortcut, especially in such comparatively rarely executed code.

It looks as though there ought to be some way to rewrite the code with the 
integer represented as a kind of indirect object, but I don't feel qualified to 
do this without consulting The Experts.  Anyone wish to provide some guidance? 
I will gladly fix the problem given a few pointers.

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: QNX subprocess bug
@ 2006-04-03 18:00 bob
  2006-04-04 22:55 ` Stefan Monnier
  0 siblings, 1 reply; 13+ messages in thread
From: bob @ 2006-04-03 18:00 UTC (permalink / raw)
  Cc: emacs-devel

I have observed PIDs very high in the 32-bit space (most user processes) and 
quite low (most system processes) and very little in between.  Right now I don't 
have access to my QNX system so I can't give you any real examples.  QNX is not 
open source so there is no obvious way to tell how the PIDs get generated.

The float (I take it we're talking "double" here) sounds like the best solution. 
I'll hack it into the code and see what happens.

Thanks!

>Date: Thu, 30 Mar 2006 22:11:02 -0500
>From: Richard Stallman <rms@gnu.org>
>Subject: Re: QNX subprocess bug
>To: storm@cua.dk (Kim F. Storm)
>Cc: bbramwel@shaw.ca, emacs-devel@gnu.org
>X-BadHeader: plain; charset=ISO-8859-15
>Original-recipient: rfc822;bbramwel@shaw.ca
>
>    I don't know if it is true, but someone recently told me that even the
>    Linux kernel will use 32-bit pids if you happen to create more than
>    32000 processes at the same time.
>
>Does that really mean all 32 bits get used?
>
>There are not a gigantic number of places in the code that call
>process-id.  But at least one prints the pid in decimal, so using a
>cons cell would not work well.
>
>Using a float would work.

                 | 
Bob Bramwell     | Many people would sooner die than think; 
ProntoLogical    | in fact, they do so.
+1 403/861-8827  |  - Bertrand Russell
                 | 

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2006-04-05 19:06 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-25  5:34 QNX subprocess bug Bob Bramwell
2006-03-26  0:22 ` Richard Stallman
2006-03-26  4:26   ` Eli Zaretskii
2006-03-27  8:35     ` Richard Stallman
2006-03-27 22:26       ` Kim F. Storm
2006-03-31  3:11         ` Richard Stallman
2006-03-26  4:33   ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2006-04-03 18:00 bob
2006-04-04 22:55 ` Stefan Monnier
2006-04-05  3:47   ` Richard Stallman
2006-04-05  9:01   ` Kim F. Storm
2006-04-05 13:03     ` Stefan Monnier
2006-04-05 19:06     ` Richard Stallman

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.