home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / hp / 14482 < prev    next >
Encoding:
Internet Message Format  |  1993-01-04  |  2.7 KB

  1. Path: sparky!uunet!spool.mu.edu!enterpoop.mit.edu!eru.mt.luth.se!lunic!sunic!dkuug!daimi!datpete
  2. From: datpete@daimi.aau.dk (Peter Andersen)
  3. Newsgroups: comp.sys.hp
  4. Subject: Problem with getenv
  5. Message-ID: <1993Jan4.110229.20959@daimi.aau.dk>
  6. Date: 4 Jan 93 11:02:29 GMT
  7. Sender: datpete@daimi.aau.dk (Peter Andersen)
  8. Reply-To: datpete@mjolner.dk (Peter Andersen)
  9. Organization: DAIMI: Computer Science Department, Aarhus University, Denmark
  10. Lines: 78
  11.  
  12. Hi.
  13.  
  14. I have got a problem with getenv on a hp9000s400.
  15. I have a program called HPbeta, that needs to read some environment
  16. variables. The problem is that it fails to read the *last* variable
  17. in the environment.
  18.  
  19. Please study this output ( "beta louise>" is my prompt ):
  20.  
  21. First a simple printenv in the shell:
  22.  
  23. beta louise> printenv
  24. TERM=xterm
  25. TZ=MET-1METDST
  26. LINES=30
  27. COLUMNS=80
  28. HOME=/users/beta
  29. PATH=.:/usr/ucb:/bin:/usr/bin:/usr/bin/X11:/usr/local/bin:/usr/lib/tex:/usr/loca
  30. l/lib/beta/bin
  31. SHELL=/bin/csh
  32. MAIL=/usr/mail/beta
  33. LOGNAME=beta
  34. DesignPrintDirectory=/tmp
  35. DesignPrintCommand=echo
  36. CVSROOT=/users/beta/CVSHOME
  37. XAPPLRESDIR=/usr/local/lib/X11R4
  38. PAGER=/usr/local/bin/less
  39. EDITOR=/usr/ucb/vi
  40. LESS=mqei
  41. TEXNORMAL=:/usr/local/lib/tex/inputs
  42. MIASTYLES=:/users/beta/miadoc/inputs/styles/v1.3
  43. MIAMACROS=:/users/beta/miadoc/inputs/docmacro/v1.2
  44. TEXINPUTS=:.:/usr/local/lib/tex/inputs:/users/beta/miadoc/inputs/styles/v1.3:/us
  45. ers/beta/miadoc/inputs/docmacro/v1.2
  46. MANPATH=/usr/share/man/daimi:/usr/local/stdman:/usr/share/man/X11R4//usr/share/m
  47. an/pbmplus
  48. BETALIB=/usr/local/lib/beta/
  49. XLIBDIR=/usr/lib
  50. XLIBEXT=sl
  51. beta louise>
  52.  
  53. Notice the last one "XLIBEXT".
  54.  
  55. Then I run my program under adb. I know from a previous run, that the
  56. "XLIBDIR" variable (the one just before XLIBEXT) is at address 0xFFEFFFE4. 
  57. I stop immediately at the "start" entry:
  58.  
  59. beta louise> adb /usr/local/lib/beta/system/v4.4.1/HPbeta
  60. executable file = /usr/local/lib/beta/system/v4.4.1/HPbeta
  61. cannot open core
  62. ready
  63. start:b
  64.  
  65. Now notice the dump from 0xFFEFFFE4, after the program is started with 
  66. argument "draw.bet":
  67.  
  68. :r draw.bet
  69. process 11514 created
  70. /usr/local/lib/beta/system/v4.4.1/HPbeta: running
  71. breakpoint      start:  ori.b   &0x0,%d0
  72. 0xFFEFFFE4,20?c
  73. 0xFFEFFFE4:     XLIBDIR=/usr/libXLIBEXT=
  74. address not found in subprocess
  75.  
  76. The XLIBEXT variable have no value, despite the fact that "printenv" in 
  77. the shell told that it had the value "sl" !
  78.  
  79. If I do a getenv("XLIBEXT") I get back the address just after "XLIBEXT=",
  80. which is the address, that adb cannot access. Thus when I use the returned
  81. value, I get a segmentation fault.
  82.  
  83. Have anyone seen this behaviour before?
  84.  
  85. The only special thing about the program "HPbeta" is that it was compiled and
  86. linked on a HP9000s300 running HPUX7, and the problem only arises when run
  87. on a HP9000s400 with HPUX8.0. Is this the reason?
  88.  
  89. Peter Andersen
  90.