Bug 509278

Summary: double free or memory corruption in aslink
Product: [Fedora] Fedora Reporter: Jacek Radzikowski <jacek.radzikowski>
Component: sdccAssignee: Conrad Meyer <cse.cem+redhatbugz>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: borut.razem, cse.cem+redhatbugz, hdegoede
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: 2.9.0-3.fc11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-07-23 19:01:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jacek Radzikowski 2009-07-02 01:49:03 UTC
Description of problem:
aslink crashes when linking program for 8051 architecture

Version-Release number of selected component (if applicable):
sdcc-2.9.0-1.fc11

How reproducible:
Create the test file and run compile/link command


Steps to Reproduce:
1. Create test program:
void main()
{
}


2. Run the following command:
sdcc -mmcs51  test.c

  
Actual results:
*** glibc detected *** /usr/libexec/sdcc/aslink: double free or corruption (fasttop): 0x08f72148 ***
======= Backtrace: =========
/lib/libc.so.6[0xb53231]
/usr/libexec/sdcc/aslink[0x80540e4]
/usr/libexec/sdcc/aslink[0x804a68d]
/lib/libc.so.6(__libc_start_main+0xe6)[0xaf9a66]
/usr/libexec/sdcc/aslink[0x8048cf1]
======= Memory map: ========
00abb000-00adb000 r-xp 00000000 fd:00 4235286    /lib/ld-2.10.1.so
00adb000-00adc000 r--p 0001f000 fd:00 4235286    /lib/ld-2.10.1.so
00adc000-00add000 rw-p 00020000 fd:00 4235286    /lib/ld-2.10.1.so
00ae3000-00c4e000 r-xp 00000000 fd:00 4235300    /lib/libc-2.10.1.so
00c4e000-00c4f000 ---p 0016b000 fd:00 4235300    /lib/libc-2.10.1.so
00c4f000-00c51000 r--p 0016b000 fd:00 4235300    /lib/libc-2.10.1.so
00c51000-00c52000 rw-p 0016d000 fd:00 4235300    /lib/libc-2.10.1.so
00c52000-00c55000 rw-p 00c52000 00:00 0
00cc4000-00cc5000 r-xp 00cc4000 00:00 0          [vdso]
05252000-0527c000 r-xp 00000000 fd:00 4235353    /lib/libgcc_s-4.4.0-20090506.so.1
0527c000-0527d000 rw-p 00029000 fd:00 4235353    /lib/libgcc_s-4.4.0-20090506.so.1
08047000-0805b000 r-xp 00000000 fd:00 4063296    /usr/libexec/sdcc/aslink
0805b000-0805f000 rw-p 00013000 fd:00 4063296    /usr/libexec/sdcc/aslink
0805f000-082e3000 rw-p 0805f000 00:00 0
08f70000-08f91000 rw-p 08f70000 00:00 0          [heap]
b8038000-b803a000 rw-p b8038000 00:00 0
b805a000-b805b000 rw-p b805a000 00:00 0
b805e000-b805f000 rw-p b805e000 00:00 0
bfe03000-bfe18000 rw-p bffeb000 00:00 0          [stack]



Expected results:
Successful execution of linker.


Additional info:
The resulting hex file seems to be created properly

Comment 1 Conrad Meyer 2009-07-05 20:09:12 UTC
I'm sure upstream would appreciate this report :). Have you submitted it there?

Comment 2 Jacek Radzikowski 2009-07-06 16:13:29 UTC
Submitted.

Comment 3 Conrad Meyer 2009-07-06 19:21:55 UTC
Thanks!

Comment 4 Borut Ražem 2009-07-18 09:46:19 UTC
Fixed in sdcc svn repository, revision #5476.

Borut

Comment 5 Conrad Meyer 2009-07-18 09:51:14 UTC
Borut,

Do you think we should grab the changeset of #5476 and apply that to our package?

Thanks

Comment 6 Borut Ražem 2009-07-18 11:18:31 UTC
Conrad,

yes, I think so since the bug is quite annoying. There is also a workaround to set MALLOC_CHECK_=0, but it is only a workaround...

The change is trivial, just remove line
           free (obj_name);
in file lkar.c, function buildlibraryindex_ar() at line 457.

Thanks,
Borut

Comment 7 Fedora Update System 2009-07-21 01:15:45 UTC
sdcc-2.9.0-3.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/sdcc-2.9.0-3.fc11

Comment 8 Conrad Meyer 2009-07-21 01:21:34 UTC
Want to try that, Jacek?

Comment 9 Jacek Radzikowski 2009-07-21 04:01:56 UTC
Can I update packages with yum or only with rpm?

Comment 10 Jacek Radzikowski 2009-07-21 04:17:19 UTC
ok, installed from downloaded packages. Aslink works properly, generates working hex file. Any other tests I can run?

Comment 11 Conrad Meyer 2009-07-21 04:19:22 UTC
I don't know of any others; but that indicates to me that this particular bug is fixed. I'll submit the update for F-11 stable. Thanks!

Comment 12 Jacek Radzikowski 2009-07-21 04:24:09 UTC
Thanks!(In reply to comment #11)
> I don't know of any others; but that indicates to me that this particular bug
> is fixed. I'll submit the update for F-11 stable. Thanks!  

Thanks!

Comment 13 Fedora Update System 2009-07-23 19:01:22 UTC
sdcc-2.9.0-3.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.