public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* System reset on Kernel 2.4.10
@ 2001-10-02 19:22 Carles Pina i Estany
  2001-10-02 19:22 ` Mika Liljeberg
  2001-10-02 21:17 ` Carles Pina i Estany
  0 siblings, 2 replies; 12+ messages in thread
From: Carles Pina i Estany @ 2001-10-02 19:22 UTC (permalink / raw)
  To: linux-kernel


Hi,

I have compiled Kernel 2.4.10 in a Debian Woody/Sid with a Pentium 2 450.

The Kernel works fine. But for error I execute /usr/src/linux/vmlinux as
root user. Then the system is rebooted (without unmounting anything)

Curious.

Then I execute vmlinux as normal user, and the system is rebooted!!!

If I execute this file in Kernel 2.4.6, then tell me "Segmentation
fault"

I copy this file to my laptop computer with Kernel 2.4.10 (Pentium 166
MMX) and execute as user. And reboot the system!

With a 2.4.9 Kernel, tell me "Segmentation fault".

A friend with Pentium 3, too reboot his system.

My /proc/cpuinfo of computer laptop:

carles@pinux:~$ cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 5
model           : 4
model name      : Pentium MMX
stepping        : 4
cpu MHz         : 167.047
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : yes
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr mce cx8 mmx
bogomips        : 333.41

I do:

dd if=vmlinux of=hang bs=1k count=10

and this "mini-file" too reboot the system.

You can get this file here:
	http://www.salleurl.edu/~is08139/hang.html
(10 k)

I think that it is some bad instruction for CPU. But I think that Kernel
would control no? and a bad instruction in Pentium MMX (laptop), Pentium
3, and Pentium 2?

Thank you very much, and excuse me my bad English.

If you need more information about systems, configuration, etc. tell me.

----
Carles Pina i Estany | Nick: Pinux / Pine / Teufeus
http://www.salleURL.edu/~is08139/

   Tienes menos vocabulario que el diccionario de tarzán



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

* Re: System reset on Kernel 2.4.10
  2001-10-02 19:22 Carles Pina i Estany
@ 2001-10-02 19:22 ` Mika Liljeberg
  2001-10-02 21:09   ` VDA
  2001-10-02 21:17 ` Carles Pina i Estany
  1 sibling, 1 reply; 12+ messages in thread
From: Mika Liljeberg @ 2001-10-02 19:22 UTC (permalink / raw)
  To: linux-kernel

Carles Pina i Estany wrote:

> The Kernel works fine. But for error I execute /usr/src/linux/vmlinux as
> root user. Then the system is rebooted (without unmounting anything)
> 
> Curious.

And like a headstrong child, I refused to believe, instead thrusting my
finger into the fire.

Ouch! Curious indeed.

	MikaL

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

* Re: System reset on Kernel 2.4.10
  2001-10-02 21:09   ` VDA
@ 2001-10-02 21:06     ` Kenneth Johansson
  2001-10-02 21:52     ` VDA
  1 sibling, 0 replies; 12+ messages in thread
From: Kenneth Johansson @ 2001-10-02 21:06 UTC (permalink / raw)
  To: VDA; +Cc: linux-kernel

VDA wrote:

> Tuesday, October 02, 2001, 9:22:49 PM,
> Mika Liljeberg <Mika.Liljeberg@welho.com> wrote:
>
> ML> Carles Pina i Estany wrote:
> >> The Kernel works fine. But for error I execute /usr/src/linux/vmlinux as
> >> root user. Then the system is rebooted (without unmounting anything)
> >>
> >> Curious.
>
> ML> And like a headstrong child, I refused to believe, instead thrusting my
> ML> finger into the fire.
> ML> Ouch! Curious indeed.
>
> Come on guys, that can't be true! Linux can't fail that miserably!
> Look:
>
> # su user
> $ ./vmlinux
> Segmentation fault
> *** screen went blank, then POST screen appears ***
>
> Eh... Oh... So... it actually can.   8-(
>

I installed reiserfs this weekend so I tried it and yes me to :))

I have another one that happens with stuff that use SDL (loki stuff) but then
the computer turns off like I had pressed the power button. So  I can use both
shutdown -h or plaympeg to turn the computer off :)



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

* Re: System reset on Kernel 2.4.10
  2001-10-02 19:22 ` Mika Liljeberg
@ 2001-10-02 21:09   ` VDA
  2001-10-02 21:06     ` Kenneth Johansson
  2001-10-02 21:52     ` VDA
  0 siblings, 2 replies; 12+ messages in thread
From: VDA @ 2001-10-02 21:09 UTC (permalink / raw)
  To: linux-kernel

Tuesday, October 02, 2001, 9:22:49 PM,
Mika Liljeberg <Mika.Liljeberg@welho.com> wrote:

ML> Carles Pina i Estany wrote:
>> The Kernel works fine. But for error I execute /usr/src/linux/vmlinux as
>> root user. Then the system is rebooted (without unmounting anything)
>> 
>> Curious.

ML> And like a headstrong child, I refused to believe, instead thrusting my
ML> finger into the fire.
ML> Ouch! Curious indeed.

Come on guys, that can't be true! Linux can't fail that miserably!
Look:

# su user
$ ./vmlinux
Segmentation fault
*** screen went blank, then POST screen appears ***

Eh... Oh... So... it actually can.   8-(

Straced vmlinux does not reboot.
Kernel: 2.4.10+ext3+preempt
-- 
Best regards, VDA
mailto:VDA@port.imtp.ilyichevsk.odessa.ua



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

* Re: System reset on Kernel 2.4.10
  2001-10-02 19:22 Carles Pina i Estany
  2001-10-02 19:22 ` Mika Liljeberg
@ 2001-10-02 21:17 ` Carles Pina i Estany
  1 sibling, 0 replies; 12+ messages in thread
From: Carles Pina i Estany @ 2001-10-02 21:17 UTC (permalink / raw)
  To: linux-kernel



Hi,

> You can get this file here:
> 	http://www.salleurl.edu/~is08139/hang.html
> (10 k)

It seems that before the "mini-file" was a compressed file.

Now the web is good (with the entire file compressed and the first 10kb of
file decompressed)

Sorry...


----
Carles Pina i Estany | Nick: Pinux / Pine / Teufeus
http://www.salleURL.edu/~is08139/

   ­­­Creoquesemehaestropeadolabarraespaciadora!!!


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

* Re: System reset on Kernel 2.4.10
  2001-10-02 23:02 System reset on Kernel 2.4.10 Petr Vandrovec
@ 2001-10-02 21:41 ` Petr Vandrovec
  2001-10-02 22:15   ` Mika Liljeberg
  2001-10-02 22:19   ` Kenneth Johansson
  2001-10-02 22:50 ` Andreas Dilger
  2001-10-03  8:49 ` VDA
  2 siblings, 2 replies; 12+ messages in thread
From: Petr Vandrovec @ 2001-10-02 21:41 UTC (permalink / raw)
  To: linux-kernel

On Tue, Oct 02, 2001 at 11:02:28PM +0000, Petr Vandrovec wrote:
> On  2 Oct 01 at 23:52, VDA wrote:
> > V> Straced vmlinux does not reboot.
> > V> Kernel: 2.4.10+ext3+preempt
> > 
> > Well... sometimes it reboots too.
> > Once it rebooted ~10 mins after strace (system was at zero load).
> > Also it rebooted after two strace's in succession.
> 
> Look at fs/binfmt_elf.c, at line 642 (in -ac2). There is
> 
> error = elf_map(....)
> 
> but nobody bothers with checking error value, it even tries it
> to use as an offset if stars are in wrong constellation.
> If you could add these lines below the call:
> 
> if ((unsigned long)error >= (unsigned long)(-256)) {
>   set_fs(old_fs);
>   printk(KERN_DEBUG "Something went wrong with elf_map()\n");
>   kfree(elf_phdata);
>   send_sig(SIGSEGV, current, 0);
>   return 0;
> }
> 
> and then report results...

Well, I was not able to trigger reboot with unpatched kernel. With
patched one behavior looks same to me, except that elf_map went wrong
is printed by kernel.

I was not able to find where problem could be with unpatched
kernel, but arguments passed to do_brk(), set into mm->start_brk, 
{start,end}_code and so on looks very suspicious... But as on my 
system it does not crash neither with nor without patch below, I 
leave answer on someone else.

Btw, my system is 2.4.10-ac2, SMP PIII, compiled with Debian 2.95.4.
						Petr Vandrovec
						vandrove@vc.cvut.cz


--- linux/fs/binfmt_elf.c.xx	Mon Oct  1 18:34:46 2001
+++ linux/fs/binfmt_elf.c	Tue Oct  2 23:04:18 2001
@@ -640,7 +640,13 @@
 		}
 
 		error = elf_map(bprm->file, load_bias + vaddr, elf_ppnt, elf_prot, elf_flags);
-
+		if ((unsigned long)error >= (unsigned long)(-256)) {
+			set_fs(old_fs);
+			printk(KERN_DEBUG "elf_map went wrong\n");
+			kfree(elf_phdata);
+			send_sig(SIGSEGV, current, 0);
+			return 0;
+		}
 		if (!load_addr_set) {
 			load_addr_set = 1;
 			load_addr = (elf_ppnt->p_vaddr - elf_ppnt->p_offset);

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

* Re: System reset on Kernel 2.4.10
  2001-10-02 21:09   ` VDA
  2001-10-02 21:06     ` Kenneth Johansson
@ 2001-10-02 21:52     ` VDA
  1 sibling, 0 replies; 12+ messages in thread
From: VDA @ 2001-10-02 21:52 UTC (permalink / raw)
  To: linux-kernel

V> # su user
V> $ ./vmlinux
V> Segmentation fault
V> *** screen went blank, then POST screen appears ***

V> Straced vmlinux does not reboot.
V> Kernel: 2.4.10+ext3+preempt

Well... sometimes it reboots too.
Once it rebooted ~10 mins after strace (system was at zero load).
Also it rebooted after two strace's in succession.
-- 
Best regards, VDA
mailto:VDA@port.imtp.ilyichevsk.odessa.ua



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

* Re: System reset on Kernel 2.4.10
  2001-10-02 21:41 ` Petr Vandrovec
@ 2001-10-02 22:15   ` Mika Liljeberg
  2001-10-02 22:19   ` Kenneth Johansson
  1 sibling, 0 replies; 12+ messages in thread
From: Mika Liljeberg @ 2001-10-02 22:15 UTC (permalink / raw)
  To: Petr Vandrovec; +Cc: linux-kernel

Petr Vandrovec wrote:

> I was not able to find where problem could be with unpatched
> kernel, but arguments passed to do_brk(), set into mm->start_brk,
> {start,end}_code and so on looks very suspicious... But as on my
> system it does not crash neither with nor without patch below, I
> leave answer on someone else.

Well, your patch does seem to fix it:

$ /usr/src/linux-2.4.10/vmlinux
Segmentation fault
$ dmesg
...
elf_map error code: -22

Cheers,

	MikaL

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

* Re: System reset on Kernel 2.4.10
  2001-10-02 21:41 ` Petr Vandrovec
  2001-10-02 22:15   ` Mika Liljeberg
@ 2001-10-02 22:19   ` Kenneth Johansson
  1 sibling, 0 replies; 12+ messages in thread
From: Kenneth Johansson @ 2001-10-02 22:19 UTC (permalink / raw)
  To: Petr Vandrovec; +Cc: linux-kernel

Petr Vandrovec wrote:

>
> I was not able to find where problem could be with unpatched
> kernel, but arguments passed to do_brk(), set into mm->start_brk,
> {start,end}_code and so on looks very suspicious... But as on my
> system it does not crash neither with nor without patch below, I
> leave answer on someone else.

I no longer get the restart but then I also made more than this change to the kernel and tested
with the new vmlinux image.


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

* Re: System reset on Kernel 2.4.10
  2001-10-02 23:02 System reset on Kernel 2.4.10 Petr Vandrovec
  2001-10-02 21:41 ` Petr Vandrovec
@ 2001-10-02 22:50 ` Andreas Dilger
  2001-10-03  8:49 ` VDA
  2 siblings, 0 replies; 12+ messages in thread
From: Andreas Dilger @ 2001-10-02 22:50 UTC (permalink / raw)
  To: Petr Vandrovec; +Cc: VDA, linux-kernel

On Oct 02, 2001  23:02 +0000, Petr Vandrovec wrote:
> but nobody bothers with checking error value, it even tries it
> to use as an offset if stars are in wrong constellation.
> If you could add these lines below the call:
> 
> if ((unsigned long)error >= (unsigned long)(-256)) {

What's wrong with IS_ERR(error)?

Cheers, Andreas
--
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert


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

* Re: System reset on Kernel 2.4.10
@ 2001-10-02 23:02 Petr Vandrovec
  2001-10-02 21:41 ` Petr Vandrovec
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Petr Vandrovec @ 2001-10-02 23:02 UTC (permalink / raw)
  To: VDA; +Cc: linux-kernel

On  2 Oct 01 at 23:52, VDA wrote:
> V> Straced vmlinux does not reboot.
> V> Kernel: 2.4.10+ext3+preempt
> 
> Well... sometimes it reboots too.
> Once it rebooted ~10 mins after strace (system was at zero load).
> Also it rebooted after two strace's in succession.

Look at fs/binfmt_elf.c, at line 642 (in -ac2). There is

error = elf_map(....)

but nobody bothers with checking error value, it even tries it
to use as an offset if stars are in wrong constellation.
If you could add these lines below the call:

if ((unsigned long)error >= (unsigned long)(-256)) {
  set_fs(old_fs);
  printk(KERN_DEBUG "Something went wrong with elf_map()\n");
  kfree(elf_phdata);
  send_sig(SIGSEGV, current, 0);
  return 0;
}

and then report results...
                                    Petr Vandrovec
                                    (not willing to test it myself)
                                    

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

* Re: System reset on Kernel 2.4.10
  2001-10-02 23:02 System reset on Kernel 2.4.10 Petr Vandrovec
  2001-10-02 21:41 ` Petr Vandrovec
  2001-10-02 22:50 ` Andreas Dilger
@ 2001-10-03  8:49 ` VDA
  2 siblings, 0 replies; 12+ messages in thread
From: VDA @ 2001-10-03  8:49 UTC (permalink / raw)
  To: Petr Vandrovec; +Cc: linux-kernel

Hello Petr,
Wednesday, October 03, 2001, 2:02:28 PM, you wrote:
PV> Look at fs/binfmt_elf.c, at line 642 (in -ac2). There is

PV> error = elf_map(....)

PV> but nobody bothers with checking error value, it even tries it
PV> to use as an offset if stars are in wrong constellation.
PV> If you could add these lines below the call:

PV> if ((unsigned long)error >= (unsigned long)(-256)) {
PV>   set_fs(old_fs);
PV>   printk(KERN_DEBUG "Something went wrong with elf_map()\n");
PV>   kfree(elf_phdata);
PV>   send_sig(SIGSEGV, current, 0);
PV>   return 0;
PV> }

PV> and then report results...

It fixes reboot for me. Now vmlinux segfaults, and I see
"Something went wrong with elf_map()" in the log.
-- 
Best regards, VDA
mailto:VDA@port.imtp.ilyichevsk.odessa.ua



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

end of thread, other threads:[~2001-10-03  7:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-10-02 23:02 System reset on Kernel 2.4.10 Petr Vandrovec
2001-10-02 21:41 ` Petr Vandrovec
2001-10-02 22:15   ` Mika Liljeberg
2001-10-02 22:19   ` Kenneth Johansson
2001-10-02 22:50 ` Andreas Dilger
2001-10-03  8:49 ` VDA
  -- strict thread matches above, loose matches on Subject: below --
2001-10-02 19:22 Carles Pina i Estany
2001-10-02 19:22 ` Mika Liljeberg
2001-10-02 21:09   ` VDA
2001-10-02 21:06     ` Kenneth Johansson
2001-10-02 21:52     ` VDA
2001-10-02 21:17 ` Carles Pina i Estany

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