linux-um archives
 help / color / mirror / Atom feed
* [uml-devel] core dumps and hostfs
@ 2004-10-13 19:45 Michael Richardson
  2004-10-17 13:34 ` BlaisorBlade
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Richardson @ 2004-10-13 19:45 UTC (permalink / raw)
  To: user-mode-linux-devel

-----BEGIN PGP SIGNED MESSAGE-----


I have a problem with core dumps under UML.
It seems that they don't work on hostfs. My guess is that there is
something in hostfs that doesn't return the right answer.

fs/exec.c, do_coredump(long signr, struct pt_regs * regs) has the
following code:

	file = filp_open(corename, O_CREAT | 2 | O_NOFOLLOW, 0600);
	if (IS_ERR(file))
		goto fail;
	inode = file->f_dentry->d_inode;
%	if (inode->i_nlink > 1)
%		goto close_fail;	/* multiple links - don't dump */
	if (d_unhashed(file->f_dentry))
		goto close_fail;

	if (!S_ISREG(inode->i_mode))
		goto close_fail;
	if (!file->f_op)
		goto close_fail;
	if (!file->f_op->write)
		goto close_fail;
	if (do_truncate(file->f_dentry, 0) != 0)
		goto close_fail;

	retval = binfmt->core_dump(signr, regs, file);

Note that since the file gets created, I looked carefully at what
happens, and finally I noticed that the file has multiple hard links!

As such that would cause the test at (%) to fail. Look below to
EXPERIMENT.

Does this make any sense to anyone?
I did not have this problem with 2.4.19-47.


- --DETAILS--

My guest is:

east:/testing/pluto/aggr-pluto-01# uname -a
Linux east 2.4.26-3um #1 Fri Oct 8 00:26:17 EDT 2004 i686 unknown

I have:

east:/testing/pluto/aggr-pluto-01# ulimit -a
core file size (blocks)     unlimited
data seg size (kbytes)      unlimited
file size (blocks)          unlimited
max locked memory (kbytes)  unlimited
max memory size (kbytes)    unlimited
open files                  1024
pipe size (512 bytes)       8
stack size (kbytes)         8192
cpu time (seconds)          unlimited
max user processes          112
virtual memory (kbytes)     unlimited

I run:

gimli-[aggr/testing/pluto/aggr-pluto-01] mcr 1025 %cc -g -o die die.c
gimli-[aggr/testing/pluto/aggr-pluto-01] mcr 1026 %cat die.c
#include <assert.h>

main()
{
        abort();
}

east:/testing/pluto/aggr-pluto-01# ./die
Aborted

east:/testing/pluto/aggr-pluto-01# ls -l core
- -rw-------    3 root     root            0 Oct 13 19:32 core

east:/tmp# ./die
Aborted (core dumped)
east:/tmp# ls -l
total 68
- -rw-------    1 root     root        57344 Oct 13 19:32 core

east:/testing/pluto/aggr-pluto-01# mount
/dev/root on / type hostfs (rw)
proc on /proc type proc (rw)
/dev/shm on /tmp type tmpfs (rw)
/dev/shm on /var/run type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0622)
none on /usr/share type hostfs (ro)
none on /testing type hostfs (rw,/0i/sandboxes/aggr/testing)
none on /usr/src type hostfs (ro,/0i/sandboxes/aggr)
none on /var/tmp type hostfs (rw,/0i/sandboxes/aggr/UMLPOOL/east/root/var/tmp)
none on /usr/local type hostfs (rw,/0i/sandboxes/aggr/UMLPOOL/east/root/usr/local)

EXPERIMENT

east:/testing/pluto/aggr-pluto-01# ls -lta
total 58
- -rw-------    3 root     root            0 Oct 13 19:32 core

east:/testing/pluto/aggr-pluto-01# cp /tmp/core .
east:/testing/pluto/aggr-pluto-01# ls -lta
total 58
- -rw-------    4 root     root        57344 Oct 13 19:40 core

east:/testing/pluto/aggr-pluto-01# ./die
Aborted
east:/testing/pluto/aggr-pluto-01# ls -lta
total 58
- -rw-------    5 root     root        57344 Oct 13 19:40 core

east:/testing/pluto/aggr-pluto-01# cp /tmp/core .
east:/testing/pluto/aggr-pluto-01# ./die
Aborted
east:/testing/pluto/aggr-pluto-01# ls -l core
- -rw-------    7 root     root        57344 Oct 13 19:40 core

gimli-[aggr/testing/pluto/aggr-pluto-01] mcr 1029 %ls -l core
- -rw-------  1 mcr ixia 57344 Oct 13 15:40 core

{Note that on the host, /0i is an NFS mount from another server.
 (The server is very fast, as fast as local disks, and gets backed up)}

- --
]     "Elmo went to the wrong fundraiser" - The Simpson         |  firewalls  [
]   Michael Richardson,    Xelerance Corporation, Ottawa, ON    |net architect[
] mcr@xelerance.com      http://www.sandelman.ottawa.on.ca/mcr/ |device driver[
] panic("Just another Debian GNU/Linux using, kernel hacking, security guy"); [


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Finger me for keys

iQCVAwUBQW2FzYqHRg3pndX9AQFJwgQAvJCXBSJc1kJZf5CnUusNWPyrIh6aIcFE
O0F3A/Hyt34LV0HemtTkcx+AyYt73Q+Xx4sZ4McV8n/S2WwTuyABap6WNz/dvsKt
QINGyCMVBcIF5ukkHjXno1V4cv1te9LWIbIpWJlsGAbievGTFm+LZXvDcMEeIaJs
PRv4CQRxnYY=
=U60V
-----END PGP SIGNATURE-----


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [uml-devel] core dumps and hostfs
  2004-10-13 19:45 [uml-devel] core dumps and hostfs Michael Richardson
@ 2004-10-17 13:34 ` BlaisorBlade
  2004-10-18 16:25   ` Michael Richardson
  0 siblings, 1 reply; 3+ messages in thread
From: BlaisorBlade @ 2004-10-17 13:34 UTC (permalink / raw)
  To: user-mode-linux-devel; +Cc: Michael Richardson

On Wednesday 13 October 2004 21:45, Michael Richardson wrote:
> I have a problem with core dumps under UML.
> It seems that they don't work on hostfs. My guess is that there is
> something in hostfs that doesn't return the right answer.
>
> fs/exec.c, do_coredump(long signr, struct pt_regs * regs) has the
> following code:
>
> 	file = filp_open(corename, O_CREAT | 2 | O_NOFOLLOW, 0600);
> 	if (IS_ERR(file))
> 		goto fail;
> 	inode = file->f_dentry->d_inode;
> %	if (inode->i_nlink > 1)
> %		goto close_fail;	/* multiple links - don't dump */
> 	if (d_unhashed(file->f_dentry))
> 		goto close_fail;
>
> 	if (!S_ISREG(inode->i_mode))
> 		goto close_fail;
> 	if (!file->f_op)
> 		goto close_fail;
> 	if (!file->f_op->write)
> 		goto close_fail;
> 	if (do_truncate(file->f_dentry, 0) != 0)
> 		goto close_fail;
>
> 	retval = binfmt->core_dump(signr, regs, file);
>
> Note that since the file gets created, I looked carefully at what
> happens, and finally I noticed that the file has multiple hard links!
>
> As such that would cause the test at (%) to fail. Look below to
> EXPERIMENT.
>
> Does this make any sense to anyone?
> I did not have this problem with 2.4.19-47.
I think this will not appear with UML versions until 2.4.24-1um included. In 
fact, I'm going to release (don't know when) some 2.4 patches without all the 
hostfs changes, to make it more stable. I'm not seeing, for now, where does 
this come from, but I do not expect the "rewritten" hostfs to work (nor does 
Jeff, for now).

Thanks for the plenty of details, I'll use them later, when debugging this.
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [uml-devel] core dumps and hostfs
  2004-10-17 13:34 ` BlaisorBlade
@ 2004-10-18 16:25   ` Michael Richardson
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Richardson @ 2004-10-18 16:25 UTC (permalink / raw)
  To: BlaisorBlade; +Cc: user-mode-linux-devel

-----BEGIN PGP SIGNED MESSAGE-----


>>>>> "BlaisorBlade" == BlaisorBlade  <blaisorblade_spam@yahoo.it> writes:
    >> Does this make any sense to anyone?  I did not have this problem
    >> with 2.4.19-47.

    BlaisorBlade> I think this will not appear with UML versions until
    BlaisorBlade> 2.4.24-1um included. In fact, I'm going to release

  Okay, for now, I am flushing things, etc. by umount/mount the hostfs.
  I'm core dumping to tmpfs (/tmp) and copying, which doesn't work as
well, as our regression testing system looks for core dumps via the
host copy of the hostfs...
  But, the "look for core dump" is just a heads up "something is wrong"
notification.

- --
]     "Elmo went to the wrong fundraiser" - The Simpson         |  firewalls  [
]   Michael Richardson,    Xelerance Corporation, Ottawa, ON    |net architect[
] mcr@xelerance.com      http://www.sandelman.ottawa.on.ca/mcr/ |device driver[
] panic("Just another Debian GNU/Linux using, kernel hacking, security guy"); [
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Finger me for keys

iQCVAwUBQXPuXYqHRg3pndX9AQEFtwQArKWaAXSDNUwJaHk13HnSuHND3TjYDwI/
wmsKZnqqqiL7RY81Jl6MOQRvMVOFq0+UtektWR9x84mNU3wXXZI9Ro3PWCUSwEDj
oNS0YKnrF8or3bsCD1a5KA21rzPc9qtCjMIoyKPi3PN3PSJ9A6CY80oILcEntMB4
YF1bB+3qXoU=
=NKAZ
-----END PGP SIGNATURE-----


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-10-18 16:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-13 19:45 [uml-devel] core dumps and hostfs Michael Richardson
2004-10-17 13:34 ` BlaisorBlade
2004-10-18 16:25   ` Michael Richardson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox