Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bfac987a63cdc9ab0baed4235d832b2a@smtp.hushmail.com>
Date: Tue, 16 Apr 2013 20:24:01 +0200
From: magnum <john.magnum@...hmail.com>
To: john-dev@...ts.openwall.com
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.

magnum


On 16 Apr, 2013, at 19:40 , magnum <john.magnum@...hmail.com> 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 <jfoug@....net> wrote:
> 
>> From: Frank Dittrich [mailto:frank_dittrich@...mail.com] 
>>> 
>>> 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.