HDTenEightyP/NetNews huggingface dataset:
From: mn87504@cs.tut.fi (Naatula Mika)
Subject: Re: malloc causes a segmentation violation!?
Organization: Tampere University of Technology
Date: Wed, 19 Aug 1992 15:56:48 GMT

As a responce to my article (Bill Maniatty) writes:
>Possibility - Bug is yours (very small I'm sure, but still possible)

Yes that is true. People generally tend to think that they make no
errors...

>Can you compile and link with a debugging version of malloc?
>	(Some environments provide for one).
>
>You might want to count number of mallocs/frees and trap on a free when
>number malloced < number freed.

I made my own Smalloc and and Sfree functions which call the standard
malloc and free. I save in a table the allocated pointers and compare them
before free is called. This is an easy way to catch many possible errors.

>Verify that no access is made beyond the end of malloced structures.  Typically
>malloc creates a linked list looking like the following:
>
>	--------------------------------------------
>	| malloc info a | user data | malloc info b|
>	--------------------------------------------
>
>The malloc info contains ptrs to other blocks in free/use chain, size information,
>etc...  Please note that malloc info may be found at one end or the other of
>the structure, and writing beyond the end of structure would trash it and corrupt
>the heap.

Yes. That was the kind of information I was looking for. After my own
Smalloc and Sfree functions writing beyond allocated space is the only
possible cause of segmentation faults.

I thought that OS/2 could detect writes to non-allocated areas and
give me a segmentation fault right away.  Like it usually does. 

But back to the problem. I still have not found the actual spot of
the error, but I know what the reason is. (My program is a large one) 
In my own Smalloc when I call malloc I allocate the requested space
plus one and the segmentation fault is gone! ( p=malloc(size+1) )

Like many times before, the error was made by user! 

Thanks to all of you who have helped me with this.

>|	maniattb@cs.rpi.edu - in real life Bill Maniatty
-- 
             __   | Mika Naatula            Email: mic@cc.tut.fi
|\ //| ||  //  \  | Lindfrosinkatu 8 A 11          mn87504@cs.tut.fi
| \/ | || ||      | 33720 Tampere, FINLAND
|    | ||  \\__/  | 931-185 993
-- 
Newsgroups: comp.os.os2.programmer
From: rommel@Informatik.TU-Muenchen.DE (Kai-Uwe Rommel)
Subject: Re: DosExecPgm Args Question
Organization: Technische Universitaet Muenchen, Germany
Date: Thu, 13 Aug 1992 16:51:22 GMT

In article <19920813.054753.507@almaden.ibm.com> fattire@vnet.ibm.com (BJ Hargrave) writes:
>PSZ buff = "C:\\OS2\\CMD.EXE\0/C Echo Hello!";
>
>rc = DosExecPgm ( NULL,                 /* Object name buffer         */
>                  0,                    /* len of object name buffer  */
>                  EXEC_SYNC,            /* execute synchronously      */
>                  buff,                 /* arguments                  */
>                  NULL,                 /* environment                */
>                  (PRESULTCODES)&exec_rc,       /* return codes       */
>                  buff );               /* program to execute         */

Actually, you can even call a program like:

rc = DosExecPgm(NULL, 0, EXEC_SYNC, "uncompress\0-v\0file.Z", NULL,
		&exec_rc, "c:\\bin\\compress.exe");

i.e. pass a different name than the executable file has as the argv[0]
value to the program. This is similar to what usually is done under
Unix, where some programs act differently when called with a different
name.

If you port such a program to OS/2, you can't make hard or soft links in
the file system to call the same executable with different names.
However, you can make a small dummy program which in turn just calls the
desired one with a different argv[0] value. This may help to save disk
space if the app is rather large.

Kai Uwe Rommel

/* Kai Uwe Rommel --- rommel@informatik.tu-muenchen.de */

DOS ... is still a real mode only non-reentrant interrupt
handler, and always will be.                -Russell Williams

Newsgroups: comp.os.os2.programmer
From: linville@garfield.catt.ncsu.edu (John W. Linville)
Subject: Legal to distribute C Set/2 .MSGs?
Organization: Computer and Technologies Theme Program, NCSU, Raleigh
Date: Fri, 21 Aug 1992 13:21:30 GMT

I recently ported (mostly just recompiled) POVRay to OS/2.  For those who don't
know, POVRay is a ray-tracer (the successor to DKBTrace) that is available on 
several different platforms.  It seemed to work fine on my machine, but now 
someone else is trying to use it and he is getting 'Message file not found' 
messages when he tries to run it.  I figure that he needs the .MSG files (or at
least one of them) out of /ibmc/help.  Is it legal to distribute these files?
I would think that it is, but I'm not sure.  Does anyone know 'for sure'?

Thanks!

John W. Linville

----------------------------------------------------------------------------
|  John W. Linville                Amateur radio:  KD4KHC                  |
|  #include "std_disclaimer.h"     E-mail:  linville@catt.ncsu.edu         |
----------------------------------------------------------------------------
Newsgroups: comp.os.os2.programmer
From: monty@blackhole.lerc.nasa.gov (Monty Andro)
Subject: REXX question
Organization: NASA Lewis Research Center
Distribution: comp
Date: 21 Aug 92 12:23:01


Hello,

I'm rather new to using REXX and can't seem to find what I need in the
online documentation.  I would like to start an application from REXX
and be able to send it characters as if they came from the keyboard.
Is this possible with REXX ?  Normally a program after it has started
waits for keyboard or mouse input.  I want to simulate this keyboard
I/O from REXX.  Any suggestions or hints on the feasibility of my need
would be greatly appreciated.

Monty

From: dbs@hprnd.rose.hp.com (Dave Sheehy)
Date: Thu, 20 Aug 1992 17:45:39 GMT
Subject: Calling EISA BIOS from OS/2?
Organization: HP Roseville Networks Division
Newsgroups: comp.os.os2.programmer


   Has anybody had any luck accessing the EISA BIOS routines from OS/2? I've
been trying to fabricate a descriptor to them using PhysToUVirt with no luck
as yet. I've tried from both Ring 3 and Ring 0 and it fails at both levels.
The documentation to PhysToUVirt says that that call can be used to gain 
access to BIOS code. This code needs to work under OS/2 1.x and 2.0.

    While I'm writing does anybody know how to query for the OS/2 rev
programmatically, preferably from Ring 3? I've perused the DevHlp calls and
haven't found anything that will accomplish this.

Dave Sheehy
dbs@hprnd.rose.hp.com
From: x91clifton1@gw.wmich.edu
Newsgroups: comp.os.os2.programmer
Subject: Re: Problem with EMX-0.8d
Date: 16 Aug 92 20:07:15 EST
Organization: Western Michigan University

In article <Bt0F2I.M6r@bunyip.cc.uq.oz.au>, coates@newton.physics.uq.oz.au (Tony Coates) writes:
> I have just installed emx-0.8d (i.e. g++ for OS/2 v2.0), and tried to
> make the files in the directory "\emx\test" using "make".  Everything
> was O.K. until the compilation of the file "hexdump.c".  The compilation
> terminated with the error "`optswchar' undeclared".  This "char"
> variable is used without declaration in "hexdump.c".  A look at the code
> suggested that "optswchar" should be declared in "getopts.h", but isn't.
> A search of all files on the disk only found the string "optswchar" in
> the files "hexdump.c" and "libc.a", which suggest that a declaration of
> "optswchar" has been omitted somewhere.  Can anyone help me with this?
> Thanks in advance for any help/advice.
> 								Tony.

The declaration should be in _getopt.h_ not getopts.h:

extern char *optswchar;  /* character introducing options; default="-" */ 

As you can see defining it as "-" is rather (hexdump.c) redundant. Check 
your sources from emx-08d and make sure you have the correct include for
getopt(). Also note that defining optind=0 is also redundant while opterr
defaults to TRUE (display error message on unknown switch).

/Doug
--
Douglas Clifton [99clifto@lab.cc.wmich.edu]
From: eletanjm@nuscc.nus.sg (TAN JIN MENG)
Newsgroups: comp.os.os2.programmer
Subject: DISKLESS WORKSTATIONS
Date: 15 Aug 92 02:34:25 GMT
Organization: National University of Singapore

I'm guessing which group to put this in (so I chose .programming and
.networking)...


Is there any way I can operate with OS/2 booting and running off the network? 
ie have OS/2 on a diskless workstation.

Given the above, can I junk the windows and dos support? 

I read - sometime before - that OS/2 is used to run a network of ATMs (can't
remember which bank). Do they do it this way?

I am investigating if I can use OS/2 as the OS for a computational server node.
ie I put together a bunch of single board computers ([34]86 AT or EISA of course)
with networking cards with one of the single board computers acting as the file
server.

Thanks

jin meng
Newsgroups: comp.os.os2.programmer
From: apas611@chpc.utexas.edu (David Boles)
Subject: C Set/2, what is included?
Organization: The University of Texas System - CHPC
Date: Thu, 20 Aug 92 16:16:23 GMT

What exactly (well, relatively exactly) is included  in the $295
C Set/2 package?  Basically, I would like to write some simple
programs for OS/2 2.0 and would like to get a package that had
a compiler, debugger, dev. environment, libraries, utilities,
and, very important, documentation on OS/2 and PM programming
that is current (i.e. not 1.x).

Thanks,

David Boles
From: patrice@cs.concordia.ca (SCATTOLIN patrice)
Newsgroups: comp.os.os2.programmer
Subject: Hardware interrupt service routine
Date: 16 Aug 92 02:34:01 GMT
Organization: Computer Science, Concordia University, Montreal, Quebec


I have an I/O card ( a 100Mhz digitiser) hooked onto a PC. It operates
by giving hardware interrupts at about (1000 to 4000 per seconds (in dos ). Is
it possible to write an hardware interrupt service routine that will get
called that frequently. If OS/2 has not time to do nothing else is not 
an issue. The interrupt service routine must get immediate CPU service and
not be preempted by anything even though interrupts (from the board) are
allowed to come through.

My question is: Is this possible with OS/2? It now works with DOS but the
rest of the software is becoming painful.

Thanks
-- 
Patrice Scattolin
					patrice@cs.concordia.ca
Concordia University			Montreal, Canada
"I am so far north that Santa lives two blocks from me"
From: KENKAHN@PKSMRVM.VNET.IBM.COM ("Kenneth A. Kahn")
Newsgroups: comp.os.os2.programmer
Subject: Re: I/O Redirection
Date: 18 Aug 92 00:03:46 GMT

Organization: Staff of IBM Fellow - NetWork Computing
Disclaimer: This posting represents the poster's views, not those of IBM
News-Software: UReply 3.0
X-X-From: KENKAHN@PKSMRVM.VNET.IBM.COM (Ken Kahn)
            <1992Aug17.220541.11379@elroy.jpl.nasa.gov>

In <1992Aug17.220541.11379@elroy.jpl.nasa.gov> Les Hartzman writes:
>Can a session redirect all output to stdout to another process?  In other
>words, if a program writes to stdout, can the output be intercepted for
>placement in a particular window on the screen?
>

I don't have an example off hand, but what you could do something like the
following scenerio.  If you want to send Process A's output to Process B,
have process A create a Named Pipe (DosMakeNmPipe).  You then redirect StdOut
to the pipe using the Pipe's Write Handle (DosDupHandle).  In process B you
then access the same named pipe and use it's Read Handle to access all the
StdOut from Process A.
Newsgroups: comp.os.os2.programmer
From: bergstro@src.honeywell.com (Pete Bergstrom)
Subject: Can't get gcc2.1 to work
To: comp.os.os2.programmer
Posted-Date: Tue, 18 Aug 92 10: 52:57 CDT
Organization: Honeywell Systems & Research Center
Date: Tue, 18 Aug 1992 15:52:57 GMT
Received-Date: Tue, 18 Aug 92 10: 52:59 CDT

figueroa@SPUNKY.CS.NYU.EDU (Samuel A. Figueroa) wrote:

>I recently downloaded the gcc2.1 binaries (the one that uses the native
>OS/2 linker), and while I am able to compile the "Hello world" sample
>program without any problems, I can't figure out how to link it.  The
>result of the two commands:
>
>   GCC -c SAMPLE1.C
                  ^^^

Try recompiling with sample1.c as the parameter.  My recollection is
that case matters in sources and .C means c++ while .c means c.

>   LINK386 SAMPLE1;
>
>is as follows:
>
>
>Operating System/2 LX (Linear Executable) Linker
>Version 2.00.000 Feb 25 1992
>Copyright (C) IBM Corporation 1988-1992.
>Copyright (C) Microsoft Corp. 1988-1992.
>All rights reserved.
>
>
>D:\GNU\LIB\LIBC.lib(gnulib3.obj) : error L2029: '___CTOR_LIST__' : unresolved external
>D:\GNU\LIB\LIBC.lib(gnulib3.obj) : error L2029: '___DTOR_LIST__' : unresolved external

The ___CTOR_LIST__ and ___DTO... are c++ thingies (sorry for being so
technical :-).


>LINK386 : warning L4071: application type not specified; assuming WINDOWCOMPAT
>
>There were 2 errors detected
>
>
>Could someone please tell me what I am doing wrong?  As far as I know, I
>installed gcc correctly according to the installation instructions (except
>that I installed it on the D: drive instead of the C: drive; I copied the
>SAMPLE1.C program to the C: drive and compiled it from there).


Note that the specification of the file's extension to the compiler is
the important thing here - it doesn't necessarily matter that the file
system (FAT) doesn't keep case.

Pete
Newsgroups: comp.os.os2.programmer
From: grumpy@jpradley.jpr.com (Jeff Markel)
Subject: Re: TCP/IP Socket library for OS/2?
Reply-To: grumpy@jpradley.UUCP (Jeff Markel)
Organization: Unix in NYC
Date: Mon, 17 Aug 1992 12:09:12 GMT

In article <1992Aug12.054918.20154@tamsun.tamu.edu> mss2696@tamsun.tamu.edu (Mark Saum) writes:
>In article <GHENNIGA.92Aug11153538@ampere.ampere> ghenniga@NMSU.Edu writes:
>>
>>I remember someone mentioning that they were writing a PD socket library for
>>OS/2 2.0 and IBM's TCP/IP 1.2(1). Any new news on a release date for this?
>>I really hate having to log in to a Unix machine to use gnus to read news
>>and I think the tcp.c file gnus uses is very simple and a socket library for
>>OS/2 would allow me to port it to the OS/2 port of GNU Emacs!
>>
>>Thanks for any info,
>>Gary
>>(ghenniga@NMSU.Edu)
>
>I've got IBM TCP/IP v1.1 and it comes with socket libraries in the base 
>package.  What more were you looking for? 
>Also, TCP/IP v1.2 comes with a newsreader application.
>
>Mark
>
>-- 
>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>Mark Saum                             |                    Texas A&M University 
>Senior BANA/MIS Major                 |                  College Station, Texas
>mss2696@tamsun.tamu.edu               |       Programmer, Department of Physics 

Well, I've got IBM TCP/IP for OS/2 1.2.1 and it does NOT come with socket
libraries - they cost an extra $500.


                        Jeff Markel

Jeffrey Markel | uucp:     jpradley!argos!markel   | Argos Computer Systems Inc
KD2HN          | internet: grumpy@jpradley.jpr.com | 110 W. 32nd Street 
(212)594-5400  | amprnet:  kd2hn@kd2hn.ampr.org    | New York, NY 10001
===============================================================================
	The New World Order is ... "Shoot to kill!"
===============================================================================
From: pgleason@ncratl.AtlantaGA.NCR.COM (Pat Gleason)
Newsgroups: comp.os.os2.programmer
Subject: Re: Threads & PM
Date: 18 Aug 92 00:31:45 GMT
Organization: NCR Engineering and Manufacturing Atlanta -- Atlanta, GA

In <1992Aug17.094307.24775@wsl.ie> jja@wsl.ie (John J. Allen) writes:

>I'm having a problem with a PM app that I can't figure out.

>I'm using a thread to collect Disk Usage Info and appending it to a
>listbox in the dialog box but all the calls fail. If I call the
>function normally it all works fine.

>So the question is how can you update a dialog box from a thread.

Unless the thread has a message queue (which you did not state),
the thread must use WinPostMsg() and NOT WinSendMsg(). I hope
this helps.
-- 
============================================================================
Pat Gleason                       | "Cubs fans are 90 percent scar tissue"
pgleason@ncratl.atlantaga.ncr.com |  George Will
Organization: European Academic Research Network (EARN)
Date: Tuesday, 18 Aug 1992 14:21:41 GMT
From: Turgut Kalfaoglu <TURGUT@FRMOP11.BITNET>
Newsgroups: comp.os.os2.programmer
Subject: Re: Idle dos box/giveup time slice, how?

I think OS/2 'counts' the number of keyboard scans per second. If it
exceeds a certain number, the program is suspected to be polling.
I think there are some things that zero the counter, like I/O..

About giving up time to other threads - try a DosSleep(0);

Regards, -turgut
Newsgroups: comp.os.os2.programmer
From: d9mikael@dtek.chalmers.se (Mikael Wahlgren)
Newsgroups: comp.os.os2.programmer,comp.os.os2.networking,comp.os.os2.misc
Subject: Re: Communication between DOS windows
Date: 18 Aug 92 08:29:19 GMT
Organization: Chalmers University of Technology

In article <92230.152601U55870@uicvm.uic.edu> U55870@uicvm.uic.edu (David James Alexander Hanley) writes:

>so I have a problem.  I would like to use os2( I'm using it now anyways ) and
>run the term program in one window, and the bbs program in another.  I can
>develop the software this way, and worry about adding the serial/phone routin
>when the bbs software is completely written/debugged.  Does anyone know of a
>practical way to communicate between DOS windows in os2?  I need to send
>information bolth ways, obviously, just like a bbs and term.  Thank you

Why not just connect a NULL modem between COM1 and COM2, configure the 
terminal program for COM1 and the BBS-program for COM2 and run it over
the serial port?

That's the way I have developed and tested all my BBS and other communication
softwares.  They are OS/2 programs so there were no performance problems, but
I assume the DOS-boxes could keep up with it, if you select a baudrate low
enough.

Mikael Wahlgren      d9mikael@dtek.chalmers.se
Xref: sparky comp.os.os2.programmer:4306 comp.os.os2.misc:27629
From: wjb5106@rigel.tamu.edu (Walter Barnett)
Newsgroups: comp.os.os2.programmer,comp.os.os2.misc
Subject: Re: GNU Plot (faster version ....)
Date: 18 Aug 1992 17:07:00 GMT
Distribution: comp.os.os2.programmer
Organization: Texas A&M University
News-Software: VAX/VMS VNEWS 1.41

In article <1992Aug18.040607.28429@regina.cs.uregina.ca>, skagos@hercules.uregina.ca (panagiotis skagos (187802923)) writes...
>Hi,
> 
>  A couple of days ago a message was posted that mentioned that a faster
>version of GNU Plot for PM was uploaded to hobbes.  I took a look on
>hobbes and the only version I could find was the same as the first, slow
>version.  Where is the faster version supposed to be?  Any help would
>be most greatly appreciated!  Thanks!
> 

The new version is in pub/downloads, for now.  Did you actually download
it and look at it?  I did and it is many times faster than what was
there before. 

_______________________________________________________________________
Walter Barnett        Aerospace Engineering        Texas A&M University 
Newsgroups: comp.os.os2.programmer
From: cjensen@ampex.com (Colin Jensen)
Subject: Re: Re: EMX/GCC library support
Organization: Ampex Corporation, Redwood City CA
Date: Wed, 12 Aug 1992 16:54:51 GMT

In article <1992Aug11.195534.3249@njitgw.njit.edu> dic5340@hertz.njit.edu (David Charlap) writes:
>Rather than edit the .h files (which gets messy if the headers are
>updated in the future - you'd have to re-update them), it's easier to
>define them as "C" in your application like this:
>
>extern "C" {
>  #define ....
>  #include <os2.h>
>}

Actually, if you are using gcc/2 as your C++ compiler, it is unneccesary
to use extern "C" {} since the header files already solve this problem
for both C and C++ by explicit use of the asm directive.

[All extern "C" does is remove the type-safe linkage (i.e. name mangling)
 from the functions listed within the curly brackets.  But since gcc
 expects there to be no underscores in front of symbols, and DLLs have no
 underscore, gcc comes with header files that explicitly name (via the
 asm directive) the symbols that represent each function.

 For example for DosOpen you will see a line in the header file that looks
 something like:
	ULONG DosOpen(woof, woof) asm("DosOpen");
 This line tells gcc C that DosOpen is represented by the symbol "DosOpen"
 rather than the normal "_DosOpen".

 For gcc C++, it tells the compiler to use the symbol "DosOpen" instead of
 the crazy name-mangled C++ name that would be used by default.
]

Disclaimer: This probably is not true for EMX/GCC, but since I don't use EMX,
except for Emacs :-), I can't say for sure.
-- 
Colin Jensen (cjensen@ampex.com)
From: kevinl@tisdec.tis.tandy.com
Date: 17 Aug 92 07:54 CDT
Newsgroups: comp.os.os2.programmer
Subject: Enhanced Editor & Rexx
Message-ID: <13100001@tisdec.tis.tandy.com>
Nf-ID: #N:tisdec.tis.tandy.com:13100001:000:638
Nf-From: tisdec.tis.tandy.com!kevinl    Aug 17 07:54:00 1992


	Is there any way to get the Enhanced editory to stop changing
the keys and tabs on me when it finds out that the file I'm editing is
a Rexx program (.cmd file)?  I really hate the way it messes up the enter
key.  I don't mind it adding the 'else', or 'then' key words, but I hate
the keys!
	Also, is there any way I can get my options/preferences stuff
to take effect?  Right now I have my tabs set up for 4 spaces.  It doesn't
seem to care.  It inserts tabs, but they are eight space tabs.
	I'm sort of frustrated, and it makes me not want to bother learning
Rexx (though, I must admit, rexx seems pretty powerful, if terribly awkward.

Newsgroups: comp.os.os2.programmer
From: opheys@kirk.fmi.uni-passau.de (Thomas "Sledge" Opheys)
Subject: GCC 2.2.2 problems (missing /sys, /machine, MAN pages defect)
Organization: University of Passau, Germany
Date: Fri, 21 Aug 1992 09:49:21 GMT

Hello, OS/2 world!

I have downloaded the GCC 2.2.2 files from ftp-os2.nmsu.edu two days ago.
Is it possible that the archive gcchdr.zoo (259273 bytes) lacks the
subdirectories gcc/gcc-include/sys and gcc/gcc-include/machine completely?
Ok, that's just a minor glitch because the Readme says you can keep the
header files from the 2.1 version. But is it possible to correct this
Archive to avoid frustrated new-installers?

Another thing strikes me - some of the manual pages seem to be garbage.
I used groff (EMX Port, posted some days ago), the man01.cmd (from the MAN
package also posted to c.b.o). Instead of less, I used more. I could page
through groff's own MAN pages correctly, but most GCC 2.2.2 mans were
garbage. I also tried nroff and other tools that can format MAN pages.
Yes, I tried all macros - and yes, the zoo archive tested without errors.

Does anyone here know what I did wrong - or did anyone experience the same
problems? Where can I contact the person that compiles the GCC 2.2.2 package?
Thanks,

Thomas Opheys




-- 
Thomas S. Opheys
opheys@eva.fmi.uni-passau.de      "Dachse? Dachse?
Franz-Stockbauer-Weg 1/88          Wir brauchen keine stinkenden Dachse!"
W-8390 Passau, Germany
Newsgroups: comp.os.os2.programmer,comp.os.os2.apps,comp.text.tex