Segfaults as root.

Kenichi Okuyama okuyamak at dd.iij4u.or.jp
Wed May 23 10:24:24 GMT 2001


>>>>> "RVD" == Ray Van Dolson <rayvd at bludgeon.org> writes:
RVD> http://www.bludgeon.org/~rayvd/pysmb/c/pysmb.c
RVD> The above program works perfectly when run as an ordinary user.  However,
RVD> as soon as I su to root and run it (or login as root) it Segmentation
RVD> Faults.  Any idea why this is?  According to gdb it dies as soon as a call
RVD> to anything from libsmbclient.so is called.

1) can you tell us which OS you're using?
2) I think gdb have command 'backtrace'. Can you see the result of
   it?
3) can you 'list'?
4) can you 'info all-registers'?
5) did you gdb against core file? or did you use 'run' on gdb?

First thing you should do is to see which register is becoming
illegal. If Instruction Pointer, then somebody is mistaking about
pointer to where they should jump ( or, somebody is stamping on
stack and pointing to illegal point ).


Then, if you could 'run' on gdb, you should take a careful look at
'backtrace'. Make sure that backtrace result of when you entered the
function and when you are about to call any function, when you exit
function are same. If something wrong happens, this backtrace should
give you information.
#Usually, you're stepping on the stack, somehow.


I usually get good enough hint by here. So, I don't know more about
gdb.

Hope this'll help.
---- 
Kenichi Okuyama




More information about the samba-technical mailing list