OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 2:08 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Porting GCC 6.4.0: Null pointeur dereference in et_forest.c
PostPosted: Sun Nov 26, 2017 5:18 am 
Offline
Member
Member

Joined: Wed Aug 10, 2016 3:07 am
Posts: 31
Hello everyone, I'm trying to port GCC since 1 month to my operating system right now. The binary I compiled is running correctly under my operating system (gcc - version works) but when I try to run a real compilation, gcc crash with a page error (0x0000000004) in the function et_splay: the passed argument (struct et_occ *) is a NULL pointer.
I'm using Newlib as a C library and sbrk seems to function correctly.

Thank you in advance for your help
If you need more information, don't hesitate to ask me.


Top
 Profile  
 
 Post subject: Re: Porting GCC 6.4.0: Null pointeur dereference in et_fores
PostPosted: Mon Mar 25, 2019 8:14 pm 
Offline

Joined: Mon Mar 25, 2019 8:08 pm
Posts: 3
Maybe you already figured this out, but I thought I would respond since I found this thread after running into the exact same problem.

The problem was that I wasn't invoking global constructors on process start. This caused the pool_allocator used in GCC's et-forest.c to be initialized with garbage values, which in turn led to et_new_tree() allocating too little memory for new et_nodes, causing them to overlap.


Top
 Profile  
 
 Post subject: Re: Porting GCC 6.4.0: Null pointeur dereference in et_fores
PostPosted: Sat Mar 21, 2020 4:20 pm 
Offline
Member
Member

Joined: Wed Aug 10, 2016 3:07 am
Posts: 31
It was indeed exactly that


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 77 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group