Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 16 Apr 2013 20:24:01 +0200
From: magnum <>
Subject: Re: Segfaults probably caused by DEBUG code in memory.c (was: Segfault for linux-x86-native with -DDEBUG added)

I can't recall now but to my defense, I may have been misled by the man page. The OSX one explicitly says "The allocated memory is aligned such that it can be used for any data type, including AltiVec- and SSE-related types". The Linux one states "...suitably aligned for any kind of variable" which apparently is not really true.


On 16 Apr, 2013, at 19:40 , magnum <> wrote:

> Yeah, this is it. My bad. The rationale was to make memory debugging a lot easier under -DDEBUG but it was really *supposed* to still maintain requested alignment. Sometimes I amaze myself :-(
> magnum
> On 16 Apr, 2013, at 18:34 , jfoug <> wrote:
>> From: Frank Dittrich [] 
>>> No segfaults.
>>> So I guess the -DDEBUG code in memory.c causes memory locations to be not aligned as expected.
>> void *mem_alloc_tiny(size_t size, size_t align)
>> {
>> #ifdef DEBUG
>> 	void *res;
>> +++	res = mem_alloc(size); 
>> 	add_memory_link(res);
>> 	return res;
>> #else
>> The line with +++.  There is there assurance of alignment?  Or do we need to allocate size+align, use that pointer in the add_memory_link, and then 'fix' the pointer?

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.