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.
Porting GCC 6.4.0: Null pointeur dereference in et_forest.c
-
- Posts: 3
- Joined: Mon Mar 25, 2019 8:08 pm
Re: Porting GCC 6.4.0: Null pointeur dereference in et_fores
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.
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.
Re: Porting GCC 6.4.0: Null pointeur dereference in et_fores
It was indeed exactly that