Strange behaviour of member addresses

Steffen Liebergeld steffen at ...37...
Tue Jun 1 14:38:32 CEST 2010

Am 01.06.2010 12:53, schrieb Norman Feske:
> Hi Steffen,
> Heap::Heap...
>> This prints the following:
>> quota_limit=-1 this=0x1851d8 &_quota_limit=0x185630
> Heap::alloc...
>> And this prints the following:
>> _quota_limit=0 *this=0x1851d8 &_quota_limit=0x18563c
> I added both debug outputs to the current Genode version and
> both values of &_quota_limit are equal here (tested on Linux).
> Which Genode version are you using? Have you upgraded the Genode version
> in the process of your work? If yes, you should definitedly start with a
> new build directory. Are you using a copy of the 'heap.h' header file?
> In the past, we stumbled over a similar problem that occurred when
> having multiple header files with the same name in the include search
> path.

Thank you Norman. I have to admit that it was me, who was shooting into
my foot. I had two different versions of the Lock-Class, and both were
used. That is why the addresses differed. The problem was triggered
because the Heap constructor is implemented in the header file, as
opposed to the Heap methods, which reside in their own .cc file. I guess
the compile inlined the constructor and used a different version of the
Lock class than I intended. Coincidentally the file was also named the
same in my $(REP_DIR)/include/base/ as in $(BASE_DIR)/include/base.

I guess now I can get productive again;-)

Dipl.-Inf. Steffen Liebergeld <steffen at ...37...>
Security in Telecommunications
TU Berlin/ Deutsche Telekom Laboratories
Ernst-Reuter-Platz 7, 10587 Berlin
Phone: +30 8353 58 263

More information about the users mailing list