home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!enterpoop.mit.edu!eru.mt.luth.se!lunic!sunic!dkuug!daimi!datpete
- From: datpete@daimi.aau.dk (Peter Andersen)
- Newsgroups: comp.sys.hp
- Subject: Problem with getenv
- Message-ID: <1993Jan4.110229.20959@daimi.aau.dk>
- Date: 4 Jan 93 11:02:29 GMT
- Sender: datpete@daimi.aau.dk (Peter Andersen)
- Reply-To: datpete@mjolner.dk (Peter Andersen)
- Organization: DAIMI: Computer Science Department, Aarhus University, Denmark
- Lines: 78
-
- Hi.
-
- I have got a problem with getenv on a hp9000s400.
- I have a program called HPbeta, that needs to read some environment
- variables. The problem is that it fails to read the *last* variable
- in the environment.
-
- Please study this output ( "beta louise>" is my prompt ):
-
- First a simple printenv in the shell:
-
- beta louise> printenv
- TERM=xterm
- TZ=MET-1METDST
- LINES=30
- COLUMNS=80
- HOME=/users/beta
- PATH=.:/usr/ucb:/bin:/usr/bin:/usr/bin/X11:/usr/local/bin:/usr/lib/tex:/usr/loca
- l/lib/beta/bin
- SHELL=/bin/csh
- MAIL=/usr/mail/beta
- LOGNAME=beta
- DesignPrintDirectory=/tmp
- DesignPrintCommand=echo
- CVSROOT=/users/beta/CVSHOME
- XAPPLRESDIR=/usr/local/lib/X11R4
- PAGER=/usr/local/bin/less
- EDITOR=/usr/ucb/vi
- LESS=mqei
- TEXNORMAL=:/usr/local/lib/tex/inputs
- MIASTYLES=:/users/beta/miadoc/inputs/styles/v1.3
- MIAMACROS=:/users/beta/miadoc/inputs/docmacro/v1.2
- TEXINPUTS=:.:/usr/local/lib/tex/inputs:/users/beta/miadoc/inputs/styles/v1.3:/us
- ers/beta/miadoc/inputs/docmacro/v1.2
- MANPATH=/usr/share/man/daimi:/usr/local/stdman:/usr/share/man/X11R4//usr/share/m
- an/pbmplus
- BETALIB=/usr/local/lib/beta/
- XLIBDIR=/usr/lib
- XLIBEXT=sl
- beta louise>
-
- Notice the last one "XLIBEXT".
-
- Then I run my program under adb. I know from a previous run, that the
- "XLIBDIR" variable (the one just before XLIBEXT) is at address 0xFFEFFFE4.
- I stop immediately at the "start" entry:
-
- beta louise> adb /usr/local/lib/beta/system/v4.4.1/HPbeta
- executable file = /usr/local/lib/beta/system/v4.4.1/HPbeta
- cannot open core
- ready
- start:b
-
- Now notice the dump from 0xFFEFFFE4, after the program is started with
- argument "draw.bet":
-
- :r draw.bet
- process 11514 created
- /usr/local/lib/beta/system/v4.4.1/HPbeta: running
- breakpoint start: ori.b &0x0,%d0
- 0xFFEFFFE4,20?c
- 0xFFEFFFE4: XLIBDIR=/usr/libXLIBEXT=
- address not found in subprocess
-
- The XLIBEXT variable have no value, despite the fact that "printenv" in
- the shell told that it had the value "sl" !
-
- If I do a getenv("XLIBEXT") I get back the address just after "XLIBEXT=",
- which is the address, that adb cannot access. Thus when I use the returned
- value, I get a segmentation fault.
-
- Have anyone seen this behaviour before?
-
- The only special thing about the program "HPbeta" is that it was compiled and
- linked on a HP9000s300 running HPUX7, and the problem only arises when run
- on a HP9000s400 with HPUX8.0. Is this the reason?
-
- Peter Andersen
-