This is the mail archive of the gdb-patches@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]

RE: [PATCH v2] Remove duplicated include in gdb directory


Hi,

I have faced a problem, when I try to debug a simple hello world program.
I think it's a free error from your patch "PR binutils/11983" whose hash is "1be5090bcaf4bcab333cf03f4157b16d33881222".
That is merged on Jan 2 this year.

--- a/bfd/opncls.c
+++ b/bfd/opncls.c
@@ -123,6 +123,8 @@ _bfd_delete_bfd (bfd *abfd)
       objalloc_free ((struct objalloc *) abfd->memory);
     }

+  if (abfd->filename)
+    free ((char *) abfd->filename);
   free (abfd->arelt_data);
   free (abfd);
 }

It seems to be a double free error.
If I remove the newly added free statement above, the problem disappeared. ( free ((char *) abfd->filename) )
Please have a look at the execution error message that I posted on the previous mail or correct me if I'm wrong.
I have tested this on x86_64 machine.
Thank you.

Honggyu Kim


-----Original Message-----
From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourceware.org] On Behalf Of Honggyu Kim
Sent: Monday, January 06, 2014 2:13 PM
To: 'Sergio Durigan Junior'
Cc: gdb-patches@sourceware.org
Subject: RE: [PATCH v2] Remove duplicated include in gdb directory

Thank you for your kind feedback.
I thought it's just a minor code cleanup so I didn't expect any copyright issues.

I have tried to build as below.
  $ ./configure --prefix=`pwd`/build
  $ make
and
  $ make distclean
  $ ./configure --prefix=`pwd`/build --enable-targets=all
  $ make

In both cases, build were fine and gdb binary is generated without problems.

However, when I tried to run gdb to debug just a simple hello world program, it fails.
But I found that the current HEAD also fails by showing the following message.
It seems to be very strange for me since it's not from the patch that I submitted.
I have tested the same thing after checkout a tag "gdb_7_6_2-2013-12-08-release" and it worked fine.
Please consider this issue separately or please correct me if I'm wrong.


$ cd build/bin/
$ ./gdb ./a.out
GNU gdb (GDB) 7.6.50.20140106-cvs
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./a.out...(no debugging symbols found)...done.
(gdb) r
Starting program: /home/hong.gyu.kim/src/gdb/binutils-gdb/build/bin/a.out
*** glibc detected *** ./gdb: double free or corruption (out): 0x0000000003435860 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7eb96)[0x7fc88175db96]
./gdb[0x86b8a1]
./gdb(bfd_close+0x82)[0x86be52]
	...
Aborted (core dumped)
Hello, World



-----Original Message-----
From: Sergio Durigan Junior [mailto:sergiodj@redhat.com] 
Sent: Monday, January 06, 2014 12:47 PM
To: Honggyu Kim
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2] Remove duplicated include in gdb directory

On Sunday, January 05 2014, Honggyu Kim wrote:

> This patch simply removes duplicated include statements in gdb directory.
> If there are two duplicated include statements, this patch keeps the first
> include and removes the second include.
> Those are found by checkincludes.pl tool in linux kernel and double checked
> manually once again if the include statements are affected by ifdef macro.

Thanks for the patch, Honggyu.  I believe you have tested it by building
GDB with --enable-targets=all, right?

It needs a ChangeLog (mechanical), and it seems to be simple enough to
be committed without needing a copyright assignment (I don't see your
name in the MAINTAINERS file).

Other than that, let's wait for some maintainer to give the green
light.  BTW, if you want to get started on the process to obtain the
copyright assignment, mail me offlist and I can send you the
instructions.

Thanks,

-- 
Sergio


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