Re: [maemo-developers] Re: Tinymail using mmap() gets killed by the kernel of the device

2006-07-18 Thread Guillem Jover
On Sun, 2006-07-16 at 14:52:41 +0300, ext Tomi Ollila wrote:
 Also, maybe better (or worse!) is (char *)(((int)address + 3)  ~3),
 assumed that sizeof (char *) == sizeof (int).

 This latter version seems to compile...

And runs... on this architecture, but not on others. ;)
If you have to use something like this, use intptr_t instead of int.

regards,
guillem
___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers


Re: [maemo-developers] Re: Tinymail using mmap() gets killed by the kernel of the device

2006-07-16 Thread Philip Van Hoof
On Sat, 2006-07-15 at 23:19 +0300, Tomi Ollila wrote:
 Philip Van Hoof [EMAIL PROTECTED] writes:
 
 
  If somebody feels brave, feel free to assist me in getting it 4 byte
  aligned ;-). I don't have a lot experience here.
 
 (((char *)address + 3)  ~3)

I simply use this on each char* pointer? That's it?


-- 
Philip Van Hoof, software developer at x-tend 
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
work: vanhoof at x-tend dot be 
http://www.pvanhoof.be - http://www.x-tend.be

___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers


Re: [maemo-developers] Re: Tinymail using mmap() gets killed by the kernel of the device

2006-07-16 Thread Tomi Ollila
Philip Van Hoof [EMAIL PROTECTED] writes:

 On Sat, 2006-07-15 at 23:19 +0300, Tomi Ollila wrote:
 Philip Van Hoof [EMAIL PROTECTED] writes:
 
 
  If somebody feels brave, feel free to assist me in getting it 4 byte
  aligned ;-). I don't have a lot experience here.
 
 (((char *)address + 3)  ~3)

 I simply use this on each char* pointer? That's it?

Something like it... you just have to ensure there is enough space at the
end (i.e aligning requires that there is 1-3 bytes more space for the data).

Also, maybe better (or worse!) is (char *)(((int)address + 3)  ~3),
assumed that sizeof (char *) == sizeof (int).

This latter version seems to compile...

... this too: (char *)((int)((char *)address + 3)  ~3));, but that is not
any better (in sizeof comparisons...).

 Philip Van Hoof, software developer at x-tend 

Tomi
___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers


[maemo-developers] Re: Tinymail using mmap() gets killed by the kernel of the device

2006-07-15 Thread Philip Van Hoof
On Fri, 2006-07-14 at 11:41 +0200, Philip Van Hoof wrote:
 When I run tinymail behind a camel with the mmap() patch, on the device,
 it will get killed by the kernel (it's not a Segfault, it's a kill by
 the kernel).
 
 When I run tinymail (behind a camel with the mmap..) on my desktop or in
 scratchbox, everything works perfectly.
 
 The OOM killer?
 
It turns out that the data of the summary file isn't 4 byte aligned.
This is probably the reason (as I didn't care about alignment when
writing the patch).

If somebody feels brave, feel free to assist me in getting it 4 byte
aligned ;-). I don't have a lot experience here.

-- 
Philip Van Hoof, software developer at x-tend 
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
work: vanhoof at x-tend dot be 
http://www.pvanhoof.be - http://www.x-tend.be

___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers


[maemo-developers] Re: Tinymail using mmap() gets killed by the kernel of the device

2006-07-14 Thread Philip Van Hoof
On Fri, 2006-07-14 at 11:41 +0200, Philip Van Hoof wrote:
 When I run tinymail behind a camel with the mmap() patch, on the device,
 it will get killed by the kernel (it's not a Segfault, it's a kill by
 the kernel).
 
 When I run tinymail (behind a camel with the mmap..) on my desktop or in
 scratchbox, everything works perfectly.
 
 The OOM killer?

In this blog entry I describe how you can compile tinymail with this
mmap() patch. There's also binaries.

http://pvanhoof.be/blog/index.php/2006/07/13/its-not-a-release-but-its-available-for-your-nokia-770


-- 
Philip Van Hoof, software developer at x-tend 
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
work: vanhoof at x-tend dot be 
http://www.pvanhoof.be - http://www.x-tend.be

___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers


[maemo-developers] Re: Tinymail using mmap() gets killed by the kernel of the device

2006-07-14 Thread Ross Burton
On Fri, 2006-07-14 at 11:41 +0200, Philip Van Hoof wrote:
 When I run tinymail behind a camel with the mmap() patch, on the device,
 it will get killed by the kernel (it's not a Segfault, it's a kill by
 the kernel).
 
 When I run tinymail (behind a camel with the mmap..) on my desktop or in
 scratchbox, everything works perfectly.
 
 The OOM killer?

Check dmesg, the kernel logs when it OOMs.

Ross
-- 
Ross Burton mail: [EMAIL PROTECTED]
  jabber: [EMAIL PROTECTED]
 www: http://www.burtonini.com./
 PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF



___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers


Re: [maemo-developers] Re: Tinymail using mmap() gets killed by the kernel of the device

2006-07-14 Thread Philip Van Hoof
On Fri, 2006-07-14 at 11:15 +0100, Ross Burton wrote:
 On Fri, 2006-07-14 at 11:41 +0200, Philip Van Hoof wrote:
  When I run tinymail behind a camel with the mmap() patch, on the device,
  it will get killed by the kernel (it's not a Segfault, it's a kill by
  the kernel).
  
  When I run tinymail (behind a camel with the mmap..) on my desktop or in
  scratchbox, everything works perfectly.
  
  The OOM killer?
 
 Check dmesg, the kernel logs when it OOMs.

I don't remember a OOM message in dmesg. But at the terminal it prints
Killed (if it would have been a segfault, it would have printed
Segmentation fault).

I'm not at a location where I can get Internet access over wifi and I've
been using tinymail using the non-mmap patch (causing it to overwrite my
summary files with ones that can't be opened with the mmap code). So I
can't test at this moment. I will probably recheck the dmesg logs
tomorrow or this evening.

I do know that the mmap() and munmap() syscalls don't make the kill
happen. I know this because I mmap() before I know whether the summary
file has the right version or not. It's also detecting an incorrect
version, so it can at least read the first bytes (for sure). So it must
be something that happens while parsing the memory block.

I know I had to use some guint32's, maybe those are differently written
to the file on ARM?

Regretfully I don't have a debugger for the device (afaik) so I can't
check where or what's happening.

Running tinymail with gdb on SDK_ARMEL also isn't working :-(


-- 
Philip Van Hoof, software developer at x-tend 
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
work: vanhoof at x-tend dot be 
http://www.pvanhoof.be - http://www.x-tend.be

___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers


Re: [maemo-developers] Re: Tinymail using mmap() gets killed by the kernel of the device

2006-07-14 Thread Eero Tamminen
Hi,

 I know I had to use some guint32's, maybe those are differently written
 to the file on ARM?

On ARM memory accesses have to be aligned (e.g. long = 4 bytes,
so long accesses have to be aligned to 4 bytes).

AFAIK ANSI-C standard guarantees that structure members are always in
the same order (needed for NFS/RPC from the 80's I think :)), but
compiler will align the structure sizes.


- Eero

___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers