Re: problem with gdb

From: Brian O'Shea (b_oshea_at_yahoo.com)
Date: 04/27/04

  • Next message: Mike Hunter: "Re: Core dump with tip (ucom0 -> external modem)"
    Date: Mon, 26 Apr 2004 18:40:52 -0700 (PDT)
    To: GiZmen <gizmen@blurp.one.pl>, freebsd-hackers@freebsd.org
    
    

    --- GiZmen <gizmen@blurp.one.pl> wrote:
    > > On Sunday, 25 April 2004 at 20:42:07 +0200, GiZmen wrote:
    > > > Hello,
    > > >
    > > > I have problem with gdb. When i start gdb as a regular user or even user
    > > > i wheel group, i cant debug program that i want. I start gdb with my
    > program
    > > > and i set breakpoint and i run this program. And i do not stop i this
    > > > breakpoint. gdb prints output and this message:
    > > >
    > > > Program exited normally.
    > > > You can't do that without a process to debug.
    > > >
    > > > and it return to gdb prompt.
    > > >
    > > > When i do the the same as root it works perfectly. I dont have any
    > > > idea what is the cause of this problem.

    When you run the program in a debugger as root, the program also runs as
    root. Is it possible that there are some other permission problems (such
    as file permissions that the program relies upon) that change the logic
    of your program when it is run by root, vs. by another user?

    For example, if the breakpoint is set in code that is only executed when
    a file open succeeds, it might not reach the code where the breakpoint
    is set (but it would reach the breakpoint if run by a priveleged user
    such as root).

    if ((fd = open("/etc/passwd", O_RDWT) != -1) {
        ...
        /* your breakpoint set in here somewhere */
        ...
    }

    Cheers,
    -brian

            
                    
    __________________________________
    Do you Yahoo!?
    Win a $20,000 Career Makeover at Yahoo! HotJobs
    http://hotjobs.sweepstakes.yahoo.com/careermakeover
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  • Next message: Mike Hunter: "Re: Core dump with tip (ucom0 -> external modem)"

    Relevant Pages

    • RE: Does Scandisk MSG indicate Hardware, Application, or OS Issue? - R
      ... it is hard to find the root cause since the problem disappeared ... Based on my research, there are several reasons why the tab is missing, ... permission on the registry key ...
      (microsoft.public.windows.file_system)
    • Re: [SLE] Mozilla.Desktop permission on KDE 3.3 SuSE 9.2
      ... >> a popup message saying that I did not have ... >> to root. ... Even when I change the link permission as ... Do you Yahoo!? ...
      (SuSE)
    • Re: Of mice and men
      ... However, being able to change the permission of a file does depend on who owns the file, and what permissions they have given to others over that file. ... You may have installed something as "root" that enables the program to "execute" as root. ... A server is part of the OS, not an standard application run by a user. ... admin account....but this could also be done in Windows etc etc....people just view windows as a "home" OS and most "home" users just don't want to deal with the fact that there are more than one way to protect yourself. ...
      (comp.lang.cobol)
    • Re: user permission problems
      ... Subject: user permission problems ... set them up in the tcb and copied the kill command to their home dir. ... Here's my handy dandy asroot cookbook - see if you missed some steps: ... If you have special purpose logins to do things requiring root ...
      (comp.unix.sco.misc)
    • Re: user permission problems
      ... Subject: user permission problems ... Note you should put any commands in a shell script so asroot can execute it with root perms, and you can add sanity tests to prevent things like ... add root and the special scripts like "kill_it' to the users that will use the scripts. ... I would assume the symlink is done from another restricted dir, such as a support dir owned by the support login, and only RW perms for the owner. ...
      (comp.unix.sco.misc)