bugAVR C Runtime Library - Bugs: bug #22415, malloc and realloc not using SPH...

 
 

bug #22415: malloc and realloc not using SPH in winavr20071221

Submitted by:  CurtVM <curtvm>
Submitted on:  Mon 25 Feb 2008 05:26:27 PM UTC  
 
Category: LibrarySeverity: 3 - Normal
Priority: 5 - NormalItem Group: libc code
Status: FixedPercent Complete: 0%
Assigned to: Joerg Wunsch <joerg_wunsch>Open/Closed: Closed
Release: NoneFixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 25 Feb 2008 08:10:34 PM UTC, comment #2:

Yes, the subject sounded familar to me.

I just verified a fresh build of avr-libc-1.6:

fa: 01 f4 brne .+0 ; 0xfc <malloc+0xfc>
fa: R_AVR_7_PCREL .text+0x10c
fc: 2d b7 in r18, 0x3d ; 61
fe: 3e b7 in r19, 0x3e ; 62
100: 80 91 00 00 lds r24, 0x0000
102: R_AVR_16 .data
104: 90 91 00 00 lds r25, 0x0000
106: R_AVR_16 .data+0x1
108: 28 1b sub r18, r24
10a: 39 0b sbc r19, r25
10c: a0 91 00 00 lds r26, 0x0000
10e: R_AVR_16 __brkval
110: b0 91 00 00 lds r27, 0x0000
112: R_AVR_16 __brkval+0x1

So everything looks fine now.

Joerg Wunsch <joerg_wunsch>
Project AdministratorIn charge of this item.
Mon 25 Feb 2008 06:50:53 PM UTC, comment #1:

Joerg may have already fixed this bug with this diff:
<http://cvs.savannah.nongnu.org/viewvc/avr-libc/include/avr/common.h?root=avr-libc&r1=1.3.2.2&r2=1.3.2.3>

Joerg fixed the conditional compilation on the definition of SP in common.h, which was for a problem in setjmp. This may also fix the problem in malloc/realloc, but it needs to be tested with the latest cvs on the 1.6 branch.

Eric Weddington <arcanum>
Project Administrator
Mon 25 Feb 2008 05:26:27 PM UTC, original submission:

WinAVR20071221-
malloc.o and realloc.o in every libc.a is missing the use of SPH when getting the stack pointer.

This line from malloc.c, which should be getting the SP-
cp = STACK_POINTER() - __malloc_margin;

ends up only getting SPL-
114: 8d b7 in r24, 0x3d ; 61
116: 28 2f mov r18, r24
118: 30 e0 ldi r19, 0x00 ; 0

SPH is not being used.

avr freaks thread-
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=60233&start=20&postdays=0&postorder=asc&highlight=

CurtVM <curtvm>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by joerg_wunsch (Posted a comment)
  • -unavailable- added by arcanum (Posted a comment)
  • -unavailable- added by curtvm (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 25 Feb 2008 08:10:34 PM UTCjoerg_wunschStatusNone=>Fixed
      Assigned toNone=>joerg_wunsch
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1