Skip to contentSkip to conversation

Segfault of UML-TT on FC1

uml-devel Pete Zaitcev 5 participants 6 messages Feb 16, 2004 – Feb 17, 2004 User-mode Linux (UML)

lore
Share & tools
lore
#0 lore raw

Hi:

I'm trying to run uml-patch-2.6.3-rc2-1 under Fedora Core 1, kernel 2.4.22-1.2149.nptl, glibc 2.3.2-101.1. The uml runs in TT mode (FC1 doesn't have SKAS) and segfaults while trying to do
remap_data(UML_ROUND_DOWN(&__bss_start), UML_ROUND_UP(brk_start), 1);

The reason is the hole between BSS and heap on my system. If I run with gdb and break at main(), an instance of uml looks like this:

[zaitcev@niphredil linux-2.6.3-rc2-uml-1-t1]$ cat /proc/22415/maps
a0000000-a01c6000 rwxp 00000000 03:04 442599 /q/zaitcev/uml/linux-2.6.3-rc2-uml-1-t1
a01c6000-a0294000 rw-p 00000000 00:00 0 a1f12000-a1f33000 rw-p 00000000 00:00 0 bff58000-c0000000 rwxp fff9f000 00:00 0 [zaitcev@niphredil linux-2.6.3-rc2-uml-1-t1]$

The &__bss_start at this point is a01c6000, abd brk_start is a1f33000, and so memcpy segfaults when it steps on the hole.

Does anyone have a suggestion what to do about this?

-- Pete

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#1 lore raw
Quoted 4 lines · Pete Zaitcev

I'm trying to run uml-patch-2.6.3-rc2-1 under Fedora Core 1, kernel 2.4.22-1.2149.nptl, glibc 2.3.2-101.1. The uml runs in TT mode (FC1 doesn't have SKAS) and segfaults while trying to do
remap_data(UML_ROUND_DOWN(&__bss_start), UML_ROUND_UP(brk_start), 1);

Isn't this the exec-shield bug?

http://toast.debian.net/~may/umlproject/bugs.html

It runs fine just using "i386".

Steve

Signature · 14 lines
Steven Pritchard - K&S Pritchard Enterprises, Inc.
Email: [email protected]             http://www.kspei.com/
Phone: (618)398-7360               Mobile: (618)567-7320


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#2 lore raw
In reply to Pete Zaitcev
Quoted 4 lines · Pete Zaitcev

The &__bss_start at this point is a01c6000, abd brk_start is a1f33000, and so memcpy segfaults when it steps on the hole.

Does anyone have a suggestion what to do about this?

the workaround is to install the setarch rpm, and then do:

	i386 ./linux <args>

(but it would be nice to find the brk assumption in UML and change it to work with the FC1 brk changes.)

Ingo

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#3 lore raw
Quoted 5 lines · Ingo Molnar
Quoted 3 lines · Pete Zaitcev

The &__bss_start at this point is a01c6000, abd brk_start is a1f33000, and so memcpy segfaults when it steps on the hole.

Quoted 8 lines
Quoted 1 line

Does anyone have a suggestion what to do about this?

the workaround is to install the setarch rpm, and then do:

	i386 ./linux <args>

(but it would be nice to find the brk assumption in UML and change it to work with the FC1 brk changes.)

See
http://marc.theaimsgroup.com/?l=user-mode-linux-devel&m=107564046216529&w=2
The first two segments of the patch there are in the latest 2.4 uml kernel patch. The problem is that for exec-shield the program area and data segment aren't adjacent. The remaining issue which the final part addresses is that a later routine that reserves area to act as physical memory still assumes the areas are adjacent, and you get a random amount less memory reserved than you expect (something like 16M), and this might not leave you with enough memory to use.

Michael Young

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#5 lore raw
In reply to Ingo Molnar
Quoted 2 lines · [email protected] said:

(but it would be nice to find the brk assumption in UML and change it to work with the FC1 brk changes.)

I believe it has, and I believe it's fixed in the 2.4 release I made yesterday.

Jeff

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#4 lore raw
In reply to M A Young
Quoted 5 lines · [email protected] said:

The remaining issue which the final part addresses is that a later routine that reserves area to act as physical memory still assumes the areas are adjacent, and you get a random amount less memory reserved than you expect (something like 16M), and this might not leave you with enough memory to use.

The space is non-zero even on a non-exec-shield system, probably because some mallocing has pushed the brk across a page boundary. So I changed it to add memory only if it's > 1M, and also added a printf saying what's happening.

Jeff

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel