Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 384917 - sys-boot/syslinux-4.xx fix for boot crash
Summary: sys-boot/syslinux-4.xx fix for boot crash
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: Chí-Thanh Christopher Nguyễn
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-29 11:02 UTC by Jan Safrata
Modified: 2012-10-27 00:15 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ebuild to compile fixed syslinux (syslinux-4.04.ebuild,1.79 KB, text/plain)
2011-09-29 11:02 UTC, Jan Safrata
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Safrata 2011-09-29 11:02:00 UTC
Created attachment 288211 [details]
ebuild to compile fixed syslinux

All syslinux 4.xx versions (tested up to 4.04) seems to contain a bug, that causes a crash in early phase of syslinux boot from an usb stick.
This is always possible to reproduce, but only on certain hw (atom based embedded board).
Version 3.86 of syslinux always works with that hw.

When syslinux 4.xx is used to setup bootable usb stick (which works on general desktop pc), that usb stick does not work with embedded atom based board.
Screen is garbaged, flickering and the system hangs, instead of loading the image to be booted.

Dissecting syslinux source code reveals, that the problem is within
  core/fs/cache.c
function cache_init(), where seems to be an invalid pointer used to store an initial value - following patch fixes the problem by commenting out the offending line, that seems not to be needed anyway:

--- syslinux-4.04/core/fs/cache.c-orig	2011-04-18 23:24:17.000000000 +0200
+++ syslinux-4.04/core/fs/cache.c	2011-09-29 10:54:46.000000000 +0200
@@ -40,7 +40,9 @@ void cache_init(struct device *dev, int
     cache = dev->cache_head + 1; /* First cache descriptor */
 
     head->prev  = &cache[dev->cache_entries-1];
-    head->next->prev = dev->cache_head;
+    /* following line crashes on some hw - NULL dereference? */
+    /* head->next->prev = dev->cache_head; */
+    /* it should not be needed anyway, since following loop does it too */
     head->block = -1;
     head->data  = NULL;

With that patch, syslinux works perfectly on the atom based embedded board as well as on general pc.

Attached ebuild with changes to force recompilation using the above patch.

I wanted to report this to upstream, but both syslinux.zytor.com and syslinux.org seems to be down.
Comment 1 Chí-Thanh Christopher Nguyễn gentoo-dev 2011-10-04 12:29:42 UTC
The syslinux servers were turned off following the kernel.org compromise. For now, the best way to contact hpa is via #syslinux on irc.freenode.net

But I think the servers should be back soon.
Comment 2 Chí-Thanh Christopher Nguyễn gentoo-dev 2012-02-03 23:35:30 UTC
I think the syslinux infrastructure is mostly running again, so you can send your patch to the mailing list.
If the patch is ack'ed upstream we can include it in the next ebuild revision.
Comment 3 Jan Safrata 2012-02-20 09:06:06 UTC
I send that in October 2011:
  http://www.syslinux.org/archives/2011-October/016960.html
still no reply.

Asking for ack/nack from upstream here:
  http://www.syslinux.org/archives/2012-February/017327.html
Comment 4 Brandon Penglase 2012-10-26 22:48:36 UTC
I've been notified by someone on #syslinux, that this bug can be closed with 4.06 being released, per: http://www.syslinux.org/archives/2012-October/018346.html
Comment 5 Chí-Thanh Christopher Nguyễn gentoo-dev 2012-10-27 00:15:41 UTC
Thanks, marking as FIXED.