Opened 5 years ago

Closed 5 days ago

#15251 closed bug (fixed)

KERN: PANIC: attempting to clone area "runtime_loader_seg1rw"

Reported by: bbjimmy Owned by: nobody
Priority: high Milestone: R1/beta6
Component: Applications/Debugger Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

hrev 53368

Browsing the web

KERN: PANIC: attempting to clone area "runtime_loader_seg1rw"

the panic is continuable, but the system locks up after.

Attachments (1)

syslog.old (512.1 KB ) - added by bbjimmy 5 years ago.
syslog shows two such panics

Download all attachments as: .zip

Change History (8)

by bbjimmy, 5 years ago

Attachment: syslog.old added

syslog shows two such panics

comment:1 by waddlesplash, 5 years ago

Cc: anevilyak added
Component: - GeneralSystem

I already made a change to make the runtime_loader debug area cloneable; and this seems to have been more than enough in most cases here (most uses of Debugger seem to be just fine following the changes.) So the fact that the SymbolLookup is trying to clone the "runtime_loader_seg1rw" is strange to me. Shouldn't all the information it wants be in the debug area? What is it looking for in there, and why only in this case?

comment:2 by anevilyak, 5 years ago

As best I can tell from what little information is available here, the instruction pointer it was asked to resolve a symbol for was in that area, hence the attempt to clone it. More than that I can't tell you without looking at a dump of that segment, which I'm not in a position to do right now.

comment:3 by waddlesplash, 3 years ago

This is still a problem, though now it becomes a "dprintf" instead of a KDL.

I guess Debugger needs a mechanism to clone areas that should not otherwise be cloneable.

comment:4 by waddlesplash, 7 weeks ago

Component: SystemApplications/Debugger
Owner: changed from nobody to anevilyak

The panic will be gone by now, but I don't think the debugger was ever adjusted to search for symbols differently in these particular cases.

comment:5 by waddlesplash, 7 weeks ago

Cc: anevilyak removed
Owner: changed from anevilyak to nobody
Status: newassigned

comment:6 by waddlesplash, 4 weeks ago

One possibility here is to change the behavior of the clone_area syscall when a debugger is installed, like so:

		Team* targetTeam = thread_get_current_thread()->team;
		Team* sourceTeam = Team::GetAndLock(sourceAddressSpace->ID());
		bool debuggerTeam = false;
		if (sourceTeam != NULL) {
			debuggerTeam = (sourceTeam->debug_info.debugger_team == targetTeam->id);
			sourceTeam->UnlockAndReleaseReference();
		}
		if (!debuggerTeam) {
#if KDEBUG
			dprintf("team \"%s\" (%" B_PRId32 ") attempted to clone area \"%s\" (%"
				B_PRId32 ")!\n", targetTeam->Name(), targetTeam->id, sourceArea->name, sourceID);
#endif
			return B_NOT_ALLOWED;
		}

However, I don't think this is a good idea for multiple reasons. For one, the source will become B_SHARED_AREA, which probably is not what we want (though this could be mitigated). For another, having syscalls "magically" change behavior based on whether a debugger is installed doesn't sound like a good option to me. Instead the user debugger API should probably include a "clone area" message.

comment:7 by waddlesplash, 5 days ago

Milestone: UnscheduledR1/beta6
Resolution: fixed
Status: assignedclosed

Fixed in hrev58524.

Note: See TracTickets for help on using tickets.