This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/14808] New: vfork, follow-fork child, detach-on-fork on,child execs, parent changes executable too (but should not)


http://sourceware.org/bugzilla/show_bug.cgi?id=14808

             Bug #: 14808
           Summary: vfork, follow-fork child, detach-on-fork on, child
                    execs, parent changes executable too (but should not)
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned@sourceware.org
        ReportedBy: palves@redhat.com
    Classification: Unclassified


$ ./gdb -q ./testsuite/gdb.base/foll-vfork -ex "cd testsuite" -ex "set
follow-fork child" -ex "set detach-on-fork on"

(gdb) r
Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.base/foll-vfork 
[New process 2497]
I'm the child!
I'm the proud parent of child #2497!
process 2497 is executing new program:
/home/pedro/gdb/mygit/build/gdb/testsuite/gdb.base/vforked-prog
Hello from vforked-prog...
[Inferior 2 (process 2497) exited normally]
(gdb) info inferiors 
  Num  Description       Executable        
* 2    <null>           
/home/pedro/gdb/mygit/build/gdb/testsuite/gdb.base/vforked-prog 
  1    <null>           
/home/pedro/gdb/mygit/build/gdb/testsuite/gdb.base/vforked-prog 
                                                                           
^^^^^^^^^^^^
(gdb) 

Note how inferior 1 (the parent)'s executable changed to "vforked-prog" too... 
Only the child's executable should have changed in reaction to the exec.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]