Fork us on GitHub Follow us on Facebook Follow us on Twitter

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#95 closed defect (fixed)

devmap crashes on ia64

Reported by: Jakub Jermář Owned by:
Priority: blocker Milestone: 0.4.1
Component: helenos/srv/locsrv Version: mainline
Keywords: Cc:
Blocker for: Depends on:
See also:

Description

SPARTAN kernel, release 0.4.0 (Sinister Valentine), revision 4623:4625
Built on 2009-07-07 23:21:39 for ia64
Copyright (c) 2001-2009 HelenOS project
Detected 1 CPU(s), 64 MiB free memory
Kernel console ready (press any key to activate)
ns: HelenOS IPC Naming Service
ns: Accepting connections
init: HelenOS init
devmap: HelenOS Device Mapper
rd: HelenOS RAM disk server
rd: Found RAM disk at 0x45e4000, 2146304 bytes
vfs: HelenOS VFS server
fat: HelenOS FAT file system server.
devmap: Accepting connections
Task init:devmap (4) killed due to an exception at 0xb490: Page fault at 0x450.

The crash occurs in fibril_switch().

Change History (5)

comment:1 Changed 10 years ago by Jakub Jermář

This bug is not reproducible in revision 4597 and is reproducible in 4601 (i.e. memory allocator replacement).

comment:2 Changed 10 years ago by Jakub Jermář

Resolution: fixed
Status: newclosed

I analyzed the bug and came to the conclusion, that the problem is in fibril_switch(). The srcf needs to be refreshed after context_restore().

Fixed in revision 4633.

comment:3 Changed 10 years ago by Jiri Svoboda

Resolution: fixed
Status: closedreopened

This is not a fix, just a workaround. A local variable in fibril_switch() is clobbered by passing through a context save/restore on ia64. You just worked around it by refreshing the contents of the variable.

comment:4 Changed 10 years ago by Jakub Jermář

Resolution: fixed
Status: reopenedclosed

I think you just underestimate the true power of context_restore() :-)

A simpler example which demonstrates the working of the bug:

void func(void)
{

int a; /* assuming a lives in the memory stack */
context_t c;

a = 1;
if (!context_save(&c)) {

assert(a == 1); /* will abort here */
return;

}
a = 2;
context_restore(&c);

}

comment:5 in reply to:  4 Changed 10 years ago by Jakub Jermář

When context_save() is given the 'returns_twice' attribute, the compiler will do the right thing for us and srcf does not need to be refreshed. Fixed in revision 4635.

Note: See TracTickets for help on using tickets.