[flashrom] flashrom: Can't mmap memory

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Thu Sep 30 18:13:47 CEST 2010

On 30.09.2010 14:43, Pádraig Brady wrote:
> On 30/09/10 13:25, Pádraig Brady wrote:
>> On 30/09/10 13:13, Carl-Daniel Hailfinger wrote:
>>> I noticed that the broken kernel is apparently some self-built kernel,
>>> possibly with extra patches. Still, I'd like to make sure it works fine
>>> if at all possible.
>> It's F12 official, rebuilt with a patch to a network driver.
>> No changes to config.
>>> Could you add the following kernel parameters to the command line of the
>>> broken kernel?
>>> noexec=off nopat acpi_enforce_resources=lax highmem=0K iomem=relaxed
>>> The character after "highmen=" is a zero.
>> OK :)
>>> A combination of these parameters may fix it.
>> No change with all of the above included :(
> Hmm doing an strace shows:
> sys_physmap_rw_uncached (phys_addr=FFF00000, size=1048576) {
>   mmap2(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_SHARED, 5, 0xffffffffffffff00) = -1 EOVERFLOW
> }
> I at first thought that strace was just getting it wrong,
> but perhaps something (glibc?) is messing up and doing
> a signed right shift of the address, and thus mangling the address.

The man page for mmap2() says:
"the final argument specifies the offset into the file in 4096-byte
units instead of bytes"
So the shifting is correct, but the sign extension is a HUGE FREAKING
BUG. It would be interesting to see if the same sign extension happens
on the working machine.
If the flashrom binary is the same, we can rule out compiler side
effects, and should probably blame libc.

What happens if you don't use the -c parameter to flashrom? Just
flashrom -V
maybe that gives us some additional clues.


More information about the flashrom mailing list