Operating System - HP-UX
1748069 Members
5520 Online
108758 Solutions
New Discussion

Re: sudo received a SIGSEGV for stack growth failure

 
SOLVED
Go to solution
Mauro Livi
Valued Contributor

Re: sudo received a SIGSEGV for stack growth failure

Dennis,

This will definitely show how "green" I am on core debugging, but I'll give it a try. The core file generated by sudo is in / so I ran the gdb command:

 

gdb -c core (running it from /).

 

The output is below. Anything useful there? If not, what would be a more appropriate way to run gdb?

 

Thanks

 

 

warning: Unknown symbols for 'core'; use the 'symbol-file' command.
Core was generated by `hagent'.
Program terminated with signal 11, Segmentation fault.
SEGV_MAPERR - Address not mapped to object
#0  0x400a7f0 in <unknown_procedure> ()
(gdb) bt
#0  0x400a7f0 in <unknown_procedure> ()
warning: Attempting to unwind past bad PC 0x400a7f0
#1  0x400a700 in <unknown_procedure> ()
(gdb)

Dennis Handly
Acclaimed Contributor

Re: sudo received a SIGSEGV for stack growth failure

>gdb -c core (running it from /).

 

You need to pass in the path to the sudo executable:

gdb path-to-sudo -c core

 

>Core was generated by `hagent'.

 

This says that hagent aborted.

Mauro Livi
Valued Contributor

Re: sudo received a SIGSEGV for stack growth failure

Dennis,

My apologies, but I'm more confused now. I re-ran gdb per your suggested syntax

 

gdb path-to-sudo -c core

 

However, gdb seems to be expecting a core file in the directory where gdb resides (/opt/langtools/bin).  There is a core file in the sudo directory (/usr/local/bin), so I'm obvioulsy confused as to why it would be looking for it elsewhere.

 

 

# ./gdb /usr/local/bin/sudo -c core


HP gdb 6.5 for HP Itanium (32 or 64 bit) and target HP-UX 11iv2 and 11iv3.
Copyright 1986 - 2011 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 6.5 (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for warranty/support.
..
/opt/langtools/bin/core: No such file or directory.
(gdb)

 

 

Mauro Livi
Valued Contributor

Re: sudo received a SIGSEGV for stack growth failure

Well more than  one way to skin a cat :)

I just copied the core file from /usr/local/bin and re-ran gdb. Output is below

 

 

 

# ./gdb /usr/local/bin/sudo -c core
HP gdb 6.5 for HP Itanium (32 or 64 bit) and target HP-UX 11iv2 and 11iv3.
Copyright 1986 - 2011 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 6.5 (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for warranty/support.
..
Core was generated by `sudo'.
Program terminated with signal 11, Segmentation fault.
SEGV_MAPERR - Address not mapped to object
#0  0x60000000c007db20:0 in LE_sym_name+0 () from /usr/lib/hpux32/dld.so
(gdb) bt
#0  0x60000000c007db20:0 in LE_sym_name+0 () from /usr/lib/hpux32/dld.so
#1  0x60000000c007de10:0 in LL_best_fit+0x130 () from /usr/lib/hpux32/dld.so
#2  0x60000000c007b4a0:0 in LL_sym_search+0x3e0 () from /usr/lib/hpux32/dld.so
#3  0x60000000c00c68a0:0 in _shl_findsym+0x400 () from /usr/lib/hpux32/dld.so
#4  0x60000000c0007680:0 in shl_findsym+0xd0 () from /usr/lib/hpux32/libdl.so.1
#5  0x404bb40:0 in sudo_dso_findsym () at ./sudo_dso.c:137
#6  0x40125b0:0 in getenv () at ./env_hooks.c:86
#7  0x40125f0:0 in getenv () at ./env_hooks.c:76
#8  0x40125f0:0 in getenv () at ./env_hooks.c:76
#9  0x40125f0:0 in getenv () at ./env_hooks.c:76
#10 0x40125f0:0 in getenv () at ./env_hooks.c:76
#11 0x40125f0:0 in getenv () at ./env_hooks.c:76
#12 0x40125f0:0 in getenv () at ./env_hooks.c:76
#13 0x40125f0:0 in getenv () at ./env_hooks.c:76
#14 0x40125f0:0 in getenv () at ./env_hooks.c:76
#15 0x40125f0:0 in getenv () at ./env_hooks.c:76
#16 0x40125f0:0 in getenv () at ./env_hooks.c:76
#17 0x40125f0:0 in getenv () at ./env_hooks.c:76
#18 0x40125f0:0 in getenv () at ./env_hooks.c:76
#19 0x40125f0:0 in getenv () at ./env_hooks.c:76
#20 0x40125f0:0 in getenv () at ./env_hooks.c:76
#21 0x40125f0:0 in getenv () at ./env_hooks.c:76
#22 0x40125f0:0 in getenv () at ./env_hooks.c:76
---Type <return> to continue, or q <return> to quit---
#23 0x40125f0:0 in getenv () at ./env_hooks.c:76

Dennis Handly
Acclaimed Contributor

Re: sudo received a SIGSEGV for stack growth failure

>I just copied the core file from /usr/local/bin and re-ran gdb.

 

(You are suppose to provide the absolute path to each file.)

 

It looks like sudo has illegally defined its own copy of getenv and when it tries to get the address of the real getenv(3), it finds itself and is recursive!

 

If it's going to look for libc symbols, it should pass shl_findsym something to tell it to look only in libc.so.

 

sudo shouldn't be using the obsolete shl_findsym(3) but use the standard dlsym(3).

Mauro Livi
Valued Contributor

Re: sudo received a SIGSEGV for stack growth failure

Thanks Dennis,

 

So it sounds as though it may be something related with sudo as opposed to any more kernel tunables. At this juncture I think I might remove the current sudo install and apply the more current one from the HP-UX porting Archive center (maybe a later version will work)

 

http://hpux.connect.org.uk/

 

If that doesn't work, I might get the one from the HP depot...which I was trying to avoid since it has more things included in its package (I wanted to install sudo by itself). 

 

https://h20392.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=HPUXIEXP1131

 

Dennis Handly
Acclaimed Contributor

Re: sudo received a SIGSEGV for stack growth failure

>it sounds as though it may be something related with sudo as opposed to any more kernel tunables.

 

Exactly.  But I'm surprised it works for anyone on HP-UX?  Or it only fails with a certain configuration in sudoers?

Perhaps something to do with ignoring env vars?

Mauro Livi
Valued Contributor
Solution

Re: sudo received a SIGSEGV for stack growth failure

Well I don't know, but I just removed the 1.8.9p1 and installed the newer version of sudo (1.8.13) and it worked.

 

I simply installed with the downloadhelper script as before, created my sudoers file (make sure sudoers is  in both /etc and /usr/local/etc). I ran the sudo command and that worked.

 

So in my particular environment, I was able to run 1.8.13 without any additional changes to the kernel tunables. Hope this helps  someone else down the line if they run into similar problems.

 

Thanks again (Dennis) for all your input.

 

Mauro