[flashrom] flashrom: Can't mmap memory

Pádraig Brady P at draigBrady.com
Thu Sep 30 18:36:52 CEST 2010

On 30/09/10 17:13, Carl-Daniel Hailfinger wrote:
> 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.

Nothing seems pertinent in flashrom -V.
I've changed the hardware to one with a different BIOS chip. Same issue.
I went back to an older build of ours with glibc-2.11-2 and it works!
I downgraded from glibc-2.11.2-1 to glibc-2.11-2 on our current build and still broken.
So it's some recent config in our build that's triggering this.

So there is nothing you can help with I think I'm afraid.
I'll just keep looking when I have time.


More information about the flashrom mailing list