From: terry <gliumailenator@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Hanging in kmalloc of nand_scan_tail() function
Date: Sun, 14 Nov 2010 21:18:57 +0800 [thread overview]
Message-ID: <1289740737.1726.13.camel@terry> (raw)
In-Reply-To: <9E4225D4-6015-472E-AAEA-3ACEE4198476@kernel.crashing.org>
? 2010-11-13?? 10:24 -0600?Kumar Gala???
> On Nov 12, 2010, at 9:43 PM, terry wrote:
>
> >>>
> >>> by the way,I cann't find the prototype of malloc in the whole project,it
> >>> seems that it is encapsulated in some libs.
> >>
> >> It's in common/malloc.c. There's weird preprocessor renaming going on,
> >> so it's called mALLOc in that file, but it shows up as malloc in the
> >> binary.
> > Thanks very much for your carefully instruction.
> >
> >>
> >> -Scott
> >>
> >
>
> I haven't been following this thread, but just debugging a malloc/nand "corruption" issue myself. I'm going to start a new thread on the subject since its more related to malloc. However can you try the following and see what happens:
>
> diff --git a/include/malloc.h b/include/malloc.h
I'm sorry, but I cann't understand you clearly. what do you mean by
writting this? compare two different versions? if so, which two version?
> index 3e145ad..19f0f0b 100644
> --- a/include/malloc.h
> +++ b/include/malloc.h
> @@ -850,7 +850,7 @@ extern Void_t* sbrk();
> #endif
>
> #ifndef MORECORE_CLEARS
> -#define MORECORE_CLEARS 1
> +#define MORECORE_CLEARS 0
> #endif
>
> #endif /* INTERNAL_LINUX_C_LIB */
I read the malloc.h file in u-boot-2010.09. it's content like below:
#ifdef INTERNAL_LINUX_C_LIB
819
820 #if __STD_C
821
822 Void_t * __default_morecore_init (ptrdiff_t);
823 Void_t *(*__morecore)(ptrdiff_t) = __default_morecore_init;
824
825 #else
826
827 Void_t * __default_morecore_init ();
828 Void_t *(*__morecore)() = __default_morecore_init;
829
830 #endif /* __STD_C */
831
832 #define MORECORE (*__morecore)
833 #define MORECORE_FAILURE 0
834 #define MORECORE_CLEARS 1
#else /* INTERNAL_LINUX_C_LIB */
837
838 #if __STD_C
839 extern Void_t* sbrk(ptrdiff_t);
840 #else
841 extern Void_t* sbrk();
842 #endif
843
844 #ifndef MORECORE
845 #define MORECORE sbrk
846 #endif
847
848 #ifndef MORECORE_FAILURE
849 #define MORECORE_FAILURE -1
850 #endif
851
852 #ifndef MORECORE_CLEARS
853 #define MORECORE_CLEARS 1
854 #endif
855
856 #endif /* INTERNAL_LINUX_C_LIB */
Do you mean that I should change MORECORE_CLEARS from 1 to 0?
--
Best regards,
terry
next prev parent reply other threads:[~2010-11-14 13:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-11 15:06 [U-Boot] Hanging in kmalloc of nand_scan_tail() function terry
2010-11-11 19:49 ` Scott Wood
2010-11-12 12:45 ` terry
2010-11-12 17:19 ` Scott Wood
2010-11-13 3:43 ` terry
2010-11-13 16:24 ` Kumar Gala
2010-11-14 13:18 ` terry [this message]
2010-11-15 15:05 ` Kumar Gala
2010-11-15 17:42 ` Scott Wood
-- strict thread matches above, loose matches on Subject: below --
2009-09-18 4:17 J.Hwan.Kim
2009-09-18 17:52 ` Scott Wood
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1289740737.1726.13.camel@terry \
--to=gliumailenator@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox