Yes I'm working with m3 ramdisk and data and system images (manually
extracted from emulator).
I have as well the m5 environment ready for testing, but have worked
on m3 the last days because of the fb problems.
Anyway I got the same bus error problem on m5.
BTW I'm working with a multi boot manager and boot Maemo from MMC,
then I open a ssh session to get a terminal even when UI on target is
gone, then I stop Maemo's UI (hildon, x-server, etc) and start android
(which resides on the same mmc).
This is the strace output of the runtime forked process which seems to
be responsible for the closing of the runtime process. Runtime is
looping through the proc folders of all running processes and seems to
be searching for certain process and probably doesn't find it and
closes.
(.... read on for the promised m3 diff ....)
....
23:05:10.421783 open("/proc/1653/stat", O_RDONLY|O_LARGEFILE) = 25
23:05:10.422576 read(25, "1653 (strace) S 1646 1646 1443 34817 1657
4194304 143 0 7 0 0 2 0 0 24 0 1 0 22327 950272 107 4294967295 32768
708220
3196593616 3196588344 253660 0 0 3166215 0 3221610804 0 0 17 0
0 0 0\n", 255) = 187
23:05:10.425201 close(25) = 0
23:05:10.426818 open("/proc/1654/stat", O_RDONLY|O_LARGEFILE) = 25
23:05:10.427612 read(25, "1654 (strace) S 1646 1646 1443 34817 1657
4194304 140 0 5 0 8 26 0 0 15 0 1 0 22330 950272 109 4294967295 32768
708220
3198956960 3198951688 253660 0 0 3166215 0 3221610804 0 0 17 0
0 0 0\n", 255) = 188
23:05:10.430450 close(25) = 0
23:05:10.431854 open("/proc/1655/stat", O_RDONLY|O_LARGEFILE) = 25
23:05:10.432647 read(25, "1655 (strace) S 1646 1646 1443 34817 1657
4194304 141 0 5 0 3 7 0 0 24 0 1 0 22333 950272 110 4294967295 32768
708220
3203679664 3203674392 253660 0 0 3166215 0 3221610804 0 0 17 0
0 0 0\n", 255) = 187
23:05:10.435272 close(25) = 0
23:05:10.437286 --- SIGBUS (Bus error) @ 0 (0) ---
23:05:10.438507 sigaction(SIGUSR1, {SIG_IGN}, {SIG_DFL}, 0x41052220) =
0
23:05:10.440399 gettid() = 1671
23:05:10.442626 socket(PF_FILE, SOCK_STREAM, 0) = 25
23:05:10.444732 connect(25, {sa_family=AF_FILE,
path=@android:debuggerd}, 20) = 0
23:05:10.446014 write(25, "\207\6\0\0", 4) = 4
23:05:10.446563 read(25, 0x107ffa64, 1) = ? ERESTARTSYS (To be
restarted)
23:05:10.476989 +++ killed by SIGKILL +++
Here is my diff for m3. Adopting it to m5 should be a minor issue as I
started with m5 and went then on to m3. The m5 kernel lies on a
another PC which I couldn't reach today. If necessary I can add the
diff later this week.
Please keep in mind that my patches are not cleaned up and may contain
lots of commented code. Most of it is marked with a "ses" or "SES". If
you find any bug feel free to report asap ... it might help me with
the problems I have.
################## START OF DIFF ###############################
diff -r kernel-source-rx-34-2.6.21.0/arch/arm/Kconfig kernel-source-
rx-34-2.6.21.0_android/arch/arm/Kconfig
1007a1008,1009
> source "drivers/android/Kconfig"
>
diff -r kernel-source-rx-34-2.6.21.0/arch/arm/configs/
nokia_2420_defconfig kernel-source-rx-34-2.6.21.0_android/arch/arm/
configs/nokia_2420_defconfig
781c781
< CONFIG_TOUCHSCREEN_TSC2005=y
---
> # CONFIG_TOUCHSCREEN_TSC2005 is not set
1052,1054c1052,1054
< # CONFIG_FB_CFB_FILLRECT is not set
< # CONFIG_FB_CFB_COPYAREA is not set
< # CONFIG_FB_CFB_IMAGEBLIT is not set
---
> CONFIG_FB_CFB_FILLRECT=y
> CONFIG_FB_CFB_COPYAREA=y
> CONFIG_FB_CFB_IMAGEBLIT=y
1058,1059c1058,1059
< # CONFIG_FB_MODE_HELPERS is not set
< # CONFIG_FB_TILEBLITTING is not set
---
> CONFIG_FB_MODE_HELPERS=y
> CONFIG_FB_TILEBLITTING=y
1069c1069
< CONFIG_FB_OMAP_MANUAL_UPDATE=y
---
> #SES CONFIG_FB_OMAP_MANUAL_UPDATE=y
1337c1337,1338
< # CONFIG_RTC_CLASS is not set
---
> #SES CONFIG_RTC_CLASS is not set
> CONFIG_RTC_CLASS=y
1353a1355,1374
> # Android
> #
> # CONFIG_ANDROID_GADGET is not set
> # CONFIG_ANDROID_RAM_CONSOLE is not set
> CONFIG_ANDROID_POWER=y
> CONFIG_ANDROID_LOGGER=y
>
>
> #
> # SES Android
> #
> # CONFIG_ANDROID_GADGET is not set
> # CONFIG_ANDROID_RAM_CONSOLE is not set
> # CONFIG_ANDROID_POWER=y
> # CONFIG_ANDROID_POWER_STAT=y
> # CONFIG_ANDROID_LOGGER=y
> # CONFIG_ANDROID_TIMED_GPIO is not set
> # CONFIG_ANDROID_BINDER_IPC=y
>
> #
1356c1377
< CONFIG_EXT2_FS=m
---
> CONFIG_EXT2_FS=y
1368c1389
< CONFIG_FS_MBCACHE=m
---
> CONFIG_FS_MBCACHE=y
1422a1444,1456
>
> #SES yaffs
> CONFIG_YAFFS_FS=y
> CONFIG_YAFFS_YAFFS1=y
> # CONFIG_YAFFS_DOES_ECC is not set
> CONFIG_YAFFS_YAFFS2=y
> CONFIG_YAFFS_AUTO_YAFFS2=y
> # CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
> CONFIG_YAFFS_CHECKPOINT_RESERVED_BLOCKS=10
> # CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
> # CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
> CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
>
Only in kernel-source-rx-34-2.6.21.0_android/arch/arm/configs:
nokia_2420_defconfig_android~
Only in kernel-source-rx-34-2.6.21.0_android/arch/arm/configs:
nokia_2420_defconfig_fb_problems
Only in kernel-source-rx-34-2.6.21.0_android/arch/arm/configs:
nokia_2420_defconfig_first_running_kernel
Only in kernel-source-rx-34-2.6.21.0_android/arch/arm/configs:
nokia_2420_defconfig_orig
Only in kernel-source-rx-34-2.6.21.0_android/arch/arm/configs:
nokia_2420_defconfig~
diff -r kernel-source-rx-34-2.6.21.0/arch/arm/kernel/process.c kernel-
source-rx-34-2.6.21.0_android/arch/arm/kernel/process.c
385a386,395
> /*
> * Capture the user space registers if the task is not running (in user space)
> */
> int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs)
> {
> struct pt_regs ptregs = *task_pt_regs(tsk);
> elf_core_copy_regs(regs, &ptregs);
> return 1;
> }
>
diff -r kernel-source-rx-34-2.6.21.0/arch/arm/kernel/signal.c kernel-
source-rx-34-2.6.21.0_android/arch/arm/kernel/signal.c
545a546,553
> // if (regs->ARM_ORIG_r0 == -ERESTARTNOHAND ||
> // regs->ARM_ORIG_r0 == -ERESTARTSYS ||
> // regs->ARM_ORIG_r0 == -ERESTARTNOINTR ||
> // regs->ARM_ORIG_r0 == -ERESTART_RESTARTBLOCK) {
> // /* the syscall cannot be safely restarted, return -EINTR instead */
> // regs->ARM_r0 = -EINTR;
> // return;
> // }
663a672
> // regs->ARM_r0 = -EAGAIN; /* prevent multiple restarts */
Only in kernel-source-rx-34-2.6.21.0_android: build.log
diff -r kernel-source-rx-34-2.6.21.0/drivers/Kconfig kernel-source-
rx-34-2.6.21.0_android/drivers/Kconfig
88a89,90
> source "drivers/android/Kconfig"
>
diff -r kernel-source-rx-34-2.6.21.0/drivers/Makefile kernel-source-
rx-34-2.6.21.0_android/drivers/Makefile
87a88,89
> obj-y += android/
> obj-$(CONFIG_BINDER) += binder/
Only in kernel-source-rx-34-2.6.21.0_android/drivers: android
Only in kernel-source-rx-34-2.6.21.0_android/drivers: binder
diff -r kernel-source-rx-34-2.6.21.0/drivers/char/Kconfig kernel-
source-rx-34-2.6.21.0_android/drivers/char/Kconfig
1078a1079,1084
> config BINDER
> tristate "OpenBinder IPC Driver"
> default n
> help
> from
openbinder.org
>
diff -r kernel-source-rx-34-2.6.21.0/drivers/input/evdev.c kernel-
source-rx-34-2.6.21.0_android/drivers/input/evdev.c
23a24,26
> #ifdef CONFIG_ANDROID_POWER
> #include <linux/android_power.h>
> #endif
43a47,49
> #ifdef CONFIG_ANDROID_POWER
> android_suspend_lock_t suspend_lock;
> #endif
47a54,63
> #ifdef CONFIG_ANDROID_POWER
> static void do_gettimeofday_monotonic(struct timeval *tv)
> {
> struct timespec ts;
> ktime_get_ts(&ts);
> tv->tv_sec = ts.tv_sec;
> tv->tv_usec = ts.tv_nsec / 1000;
> }
> #endif
>
55a72,75
> #ifdef CONFIG_ANDROID_POWER
> android_lock_suspend_auto_expire(&list->suspend_lock, 5 * HZ);
> do_gettimeofday_monotonic(&list->buffer[list->head].time);
> #else
56a77
> #endif
65a87,90
> #ifdef CONFIG_ANDROID_POWER
> android_lock_suspend_auto_expire(&list->suspend_lock, 5 * HZ);
> do_gettimeofday_monotonic(&list->buffer[list->head].time);
> #else
66a92
> #endif
122a149,152
> #ifdef CONFIG_ANDROID_POWER
> android_uninit_suspend_lock(&list->suspend_lock);
> #endif
>
123a154
>
137a169,173
> #ifdef CONFIG_ANDROID_POWER
> list->
suspend_lock.name = "evdev";
> android_init_suspend_lock(&list->suspend_lock);
> #endif
>
294a331,334
> #ifdef CONFIG_ANDROID_POWER
> if(list->head == list->tail)
> android_unlock_suspend(&list->suspend_lock);
> #endif
Only in kernel-source-rx-34-2.6.21.0_android/drivers/input: evdev.c~
diff -r kernel-source-rx-34-2.6.21.0/drivers/misc/Kconfig kernel-
source-rx-34-2.6.21.0_android/drivers/misc/Kconfig
124a125,130
> config LOW_MEMORY_KILLER
> tristate "Low Memory Killer"
> ---help---
> Register processes to be killed when memory is low.
>
>
diff -r kernel-source-rx-34-2.6.21.0/drivers/misc/Makefile kernel-
source-rx-34-2.6.21.0_android/drivers/misc/Makefile
14a15
> obj-$(CONFIG_LOW_MEMORY_KILLER) += lowmemorykiller/
Only in kernel-source-rx-34-2.6.21.0_android/drivers/misc:
lowmemorykiller
Only in kernel-source-rx-34-2.6.21.0_android/drivers/video: fbmem.c~
Only in kernel-source-rx-34-2.6.21.0_android/drivers/video:
goldfishfb.c
diff -r kernel-source-rx-34-2.6.21.0/drivers/video/omap/omapfb_main.c
kernel-source-rx-34-2.6.21.0_android/drivers/video/omap/omapfb_main.c
35a36,38
> //ses
> #include <linux/sched.h>
>
202a206
> //def_size = def_vxres * def_vyres * 2 * bpp / 8; //ses page flipping hack
267c271,272
< static void omapfb_sync(struct fb_info *info);
---
> //ses static void omapfb_sync(struct fb_info *info);
> static int omapfb_sync(struct fb_info *info);
400c405,406
< static void omapfb_sync(struct fb_info *fbi)
---
> //ses static void omapfb_sync(struct fb_info *fbi)
> static int omapfb_sync(struct fb_info *fbi)
407a414,416
> //else
> // wait_event_timeout(ses_wait, false, HZ / 15);
>
408a418,419
>
> return 0;
446a458
> //fix->ypanstep = 1; //ses page flipping hack
1119a1132
> //omapfb_sync(fbi);
1230a1244,1253
> //ses added for fake vsync
> // case FBIO_WAITFORVSYNC:
> /*if (get_user(pipe, (__u32 __user *)arg))
> return -EFAULT;
>
> retval = intelfbhw_wait_for_vsync(dinfo, pipe);*/
> //omapfb_sync(fbi);
> // wait_event_timeout(fbdev->ses_wait, false, HZ / 15);
>
> // break;
1263a1287
> .fb_sync = omapfb_sync, //ses fake vsync
1501a1526
> //var->yres_virtual = def_vyres * 2; //ses page flipping hack
1796a1822,1823
> init_waitqueue_head(&fbdev->ses_wait); //ses fake vsync
>
1943c1970
<
---
>
Only in kernel-source-rx-34-2.6.21.0_android/drivers/video/omap:
omapfb_main.c~
diff -r kernel-source-rx-34-2.6.21.0/fs/Kconfig kernel-source-
rx-34-2.6.21.0_android/fs/Kconfig
1191a1192,1194
> # Patched by YAFFS
> source "fs/yaffs2/Kconfig"
>
diff -r kernel-source-rx-34-2.6.21.0/fs/Makefile kernel-source-
rx-34-2.6.21.0_android/fs/Makefile
116a117,119
>
> # Patched by YAFFS
> obj-$(CONFIG_YAFFS_FS) += yaffs2/
diff -r kernel-source-rx-34-2.6.21.0/fs/inotify_user.c kernel-source-
rx-34-2.6.21.0_android/fs/inotify_user.c
33a34,36
> #ifdef CONFIG_ANDROID_POWER
> #include <linux/android_power.h>
> #endif
83a87,89
> #ifdef CONFIG_ANDROID_POWER
> android_suspend_lock_t suspend_lock;
> #endif
159a166,168
> #ifdef CONFIG_ANDROID_POWER
> android_uninit_suspend_lock(&dev->suspend_lock);
> #endif
303a313,315
> #ifdef CONFIG_ANDROID_POWER
> android_lock_suspend_auto_expire(&dev->suspend_lock, 5 * HZ);
> #endif
320a333,336
> #ifdef CONFIG_ANDROID_POWER
> if(dev->event_count == 0)
> android_unlock_suspend(&dev->suspend_lock);
> #endif
596a613,616
> #ifdef CONFIG_ANDROID_POWER
> dev->
suspend_lock.name = "inotify";
> android_init_suspend_lock(&dev->suspend_lock);
> #endif
Only in kernel-source-rx-34-2.6.21.0_android/fs: yaffs2
diff -r kernel-source-rx-34-2.6.21.0/include/asm-arm/arch-omap/
omapfb.h kernel-source-rx-34-2.6.21.0_android/include/asm-arm/arch-
omap/omapfb.h
29a30,31
> #include <linux/wait.h> //ses
>
31a34,38
> //ses added for vsync support
> #ifndef FBIO_WAITFORVSYNC
> #define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
> #endif
>
363a371,372
>
> wait_queue_head_t ses_wait; //ses waitqueue for fake vsync
Only in kernel-source-rx-34-2.6.21.0_android/include/asm-arm/arch-
omap: omapfb.h~
Only in kernel-source-rx-34-2.6.21.0_android/include/linux:
android_alarm.h
Only in kernel-source-rx-34-2.6.21.0_android/include/linux:
android_gadget.h
Only in kernel-source-rx-34-2.6.21.0_android/include/linux:
android_power.h
Only in kernel-source-rx-34-2.6.21.0_android/include/linux:
android_timed_gpio.h
Only in kernel-source-rx-34-2.6.21.0_android/include/linux:
anon_inodes.h
Only in kernel-source-rx-34-2.6.21.0_android/include/linux:
binder_module.h
Only in kernel-source-rx-34-2.6.21.0_android/include/linux:
binder_type_constants.h
diff -r kernel-source-rx-34-2.6.21.0/include/linux/list.h kernel-
source-rx-34-2.6.21.0_android/include/linux/list.h
428a429,439
> * list_first_entry - get the first element from a list
> * @ptr: the list head to take the element from.
> * @type: the type of the struct this is embedded in.
> * @member: the name of the list_struct within the struct.
> *
> * Note, that list is expected to be not empty.
> */
> #define list_first_entry(ptr, type, member) \
> list_entry((ptr)->next, type, member)
>
> /**
Only in kernel-source-rx-34-2.6.21.0_android/include/linux: logger.h
diff -r kernel-source-rx-34-2.6.21.0/kernel/power/process.c kernel-
source-rx-34-2.6.21.0_android/kernel/power/process.c
16a17,19
> #ifdef CONFIG_ANDROID_POWER
> #include <linux/android_power.h>
> #endif
133a137,140
> #ifdef CONFIG_ANDROID_POWER
> if (todo && !android_power_is_driver_suspended())
> break;
> #endif
149a157
> show_state();
######################### END OF DIFF ########################