[Tinyos Core WG] proposal for some (small) changes in the core

Vlado Handziski handzisk at tkn.tu-berlin.de
Wed May 28 07:17:25 PDT 2008


On Tue, May 27, 2008 at 6:57 PM, Jan Hauer <jan.hauer at gmail.com> wrote:

> (1) fix tos/lib/timer/VirtualizeAlarmC.nc to work with uint32_t on
> msp430 platforms like proposed in my email to tinyos-devel on Mar 4
> (and re-printed below (*)).

(*) There is problem with tos/lib/timer/VirtualizeAlarmC.nc on msp430:
> with mspgcc-3.2.3 I get a "Segmentation fault" during compilation if I
> use uint32_t as "size_type", e.g. "VirtualizeAlarmC(T32khz, uint32_t,
> uniqueCount(UQ_ALARM_32KHZ32));". The probelm is in line 135 of
> VirtualizeAlarmC. Currently lines 134-136 read:
>
> if( m.isset[id] ) {
>  size_type elapsed = call AlarmFrom.getNow() - m.alarm[id].t0;
>  if( m.alarm[id].dt <= elapsed ) {
>
> I don't understand the actual cause, but when I replace this with the
> following code it compiles:
>
>  if( m.isset[id] ) {
>  size_type t0 = m.alarm[id].t0;
>  size_type elapsed = call AlarmFrom.getNow() - t0;
>   if( m.alarm[id].dt <= elapsed ) {
>


A short update on the bug:

The bug is known to the mspgcc developers:

http://www.msp430.ubi.pt/forum/viewtopic.php?p=29525

Dimitry has promised to fix it, but the bug is not fixed in the latest CVS
or he just fixed the pointer dereferencing case.

The segmentation fault occurs only when using -O1 level of optimization.

Our current make setup  is overloading the default -Os flag with -O which is
not a very happy solution:

mkdir -p build/telosb
    compiling BlinkC to a telosb binary
ncc -o build/telosb/main.exe  -Os -O .....

I think we should leave -Os to be the default optimization level, although
-Os has its own problems sometimes.

Vlado
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-2.0wg/attachments/20080528/e002863e/attachment.htm 


More information about the Tinyos-2.0wg mailing list