Go to the FreeLists Home Page Home Signup Help Login
 



[haiku-development] || [Date Prev] [11-2007 Date Index] [Date Next] || [Thread Prev] [11-2007 Thread Index] [Thread Next]

[haiku-development] The Haiku stack end is not aligned

  • From: "Ryan Leavengood" <leavengood@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sat, 17 Nov 2007 19:30:25 -0500
Back when I was first testing JavaScriptCore on Haiku I was getting
some segfaults when the garbage collector would run. I eventually
figured out that the problem was a loop whose termination condition
was p != e. Apparently the two pointers were not aligned perfectly so
the loop would keep running, eventually hitting invalid memory.

My temporary fix was to change the loop condition to p < e. This
worked, and I even tried to send this as a patch to WebKit. But they
pointed out that this should not happen and this "fix" just hides
problems.

I turned on a DEBUG build and it turns out the pointer that is not
aligned is e, which is the stack base (which is called stack end in
Haiku.) Here is the code I use to get this:

    thread_info threadInfo;
    get_thread_info(find_thread(NULL), &threadInfo);
    return threadInfo.stack_end;

Is there something wrong with this? Is there some reason the stack_end
is not aligned? Should I just add a byte or two to the pointer?

Thanks,
Ryan





[ Home | Signup | Help | Login | Archives | Lists ]

All trademarks and copyrights within the FreeLists archives are owned by their respective owners.
Everything else ©2007 Avenir Technologies, LLC.