[comp.unix.microport] Pcomm

sjb@dalek.UUCP (Seth J. Bradley) (05/22/88)

A program called Pcomm was just posted on comp.sources.unix.
I tried compiling it under System V/AT, that went OK, but I
got a segmentation fault-core dump when I tried to run it.
I've tried it both with and without -O, same results.  Has
anyone hacked the source to run under V/AT?  If so, will it
support a 9600 baud session, or is this an imposibility with 
the current driver?  Any help would be appreciated!
Thanks,
Seth Bradley

-- 
Seth J. Bradley     UUCP: uunet!lll-winken!dalek!sjb
		Internet: lll-winken.llnl.gov!dalek!sjb

jmb@patton.SGI.COM (Jim Barton) (05/24/88)

I've gotten pcomm to work allright, but had to fix a series of glaring
errors.  They all have to do with the author passing NULL for null
string arguments in many places.  THIS IS NOT PORTABLE CODE.  Aside from
the fact that NULL is 2 bytes (on the 286) versus 4 bytes for a
character pointer, it also forces you to de-reference 0
(hence the memory fault).  Some primitive architectures (such as the VAX)
allow you to de-reference 0 and get 0 back - most modern systems disallow this. 
Check out calls to 'str_prompt', 'menu_prompt', and the call to 'init'
out of main as a first pass at fixing things up.

Oh, I just remembered.  In a few places (notably s_tty, I think) he sets
up a menu array and initializes the last element to NULL to end the
list, but of course the code reads something like:

	if (*menu[i] == NULL) ...


-- Jim Barton
Silicon Graphics Computing Systems    "UNIX: Live Free Or Die!"
jmb@sgi.sgi.com, sgi!jmb@decwrl.dec.com, ...{decwrl,sun}!sgi!jmb
--

mjy@sdti.UUCP (Michael J. Young) (05/25/88)

In article <387@dalek.UUCP> sjb@dalek.UUCP (Seth J. Bradley) writes:
>A program called Pcomm was just posted on comp.sources.unix.
>I tried compiling it under System V/AT, that went OK, but I
>got a segmentation fault-core dump when I tried to run it.
>I've tried it both with and without -O, same results.  Has
>anyone hacked the source to run under V/AT?  If so, will it
>support a 9600 baud session, or is this an imposibility with 
>the current driver?  Any help would be appreciated!

I've been working on getting pcomm working under System V/AT.  Unfortunately,
the code is riddled with dereferenced NULL pointers and assumptions about
sizeof (char *) == sizeof (int).  So far I've gotten the basic stuff working,
like auto-dialing and xmodem transfers.

So far I've only tried downloads at 1200 baud, and even at that speed I have
seen block timeouts if there is any significant system activity.
Fortunately, the program seems to handle them gracefully.  I intend to try
2400 baud as soon as I get some other minor things working, but I think 9600
baud is out of the question.

The initial sweat of getting it to work is significant, but it's kind of
neat once you get it going.  I'll post more details once I wring it out
some more.
-- 
Mike Young - Software Development Technologies, Inc., Sudbury MA 01776
UUCP     : {decvax,harvard,linus,mit-eddie}!necntc!necis!mrst!sdti!mjy
Internet : mjy%sdti.uucp@harvard.harvard.edu      Tel: +1 617 443 5779
"Bill & Opus in '88" -- Consider the alternatives!

corbet@boulder.Colorado.EDU (Jon Corbet) (05/25/88)

A minor quibble:

jmb@patton.SGI.COM (Jim Barton):
>  Some primitive architectures (such as the VAX)
>allow you to de-reference 0 and get 0 back - most modern systems disallow this. 
The VAX, like any reasonable virtual-memory machine, has individual page
protection.  VMS sets page zero (which, obviously, contains the address zero)
to be no-read-no-write, thus causing an exception when a zero pointer is
dereferenced.  BSD, as I recall, will do this only if you pass a special
flag to ld.