[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


linux random reboots while running my program

Posted on 2004-08-24
Medium Priority
Last Modified: 2010-04-22
Hello experts-

I am using a RH9.0 system kernel 2.4.20-31.9.  I experience this problem on my knoppix 2.4.26 machine too.

The problem occurs when I am running a program that I wrote that controls a USB HID device.  I run this program with a certain frequency as I am adding new things to it all the time.  The final product will need to speak back and forth with the USB device almost constantly (every three seconds or more to be exact).  it does not yet talk every three seconds as I have the device in debug mode currently.  So anyhow.  The reboots occur at random time intervals.  Sometimes I can only only run my program three or four times, and other times I can run it all day, about 200 times.  The programs total execution at present is about 1.35 minutes on average.  I have run my program inside Etnus TotalView memory debugging program, and found nothing, no memory leaks, no heap dump, no stack overflows.  Does anyonw have any ideas.  I would post my code but it is confidential.  Are there any errors that I may not be catching that can cause the machine to reboot instantly if not caught.  Like for instance: I believed that i was receiving a ctrl-alt-del signal in my receive buffer that the OS was picking up and using as if I had pressed that buttons on the keyboard.  I deactivated (read: commented out) the ca: trapping in my inittab file, yet i still got a reboot about 10 minutes later.   Any ideas at all would be helpful.   also if it helps any, the kernel mode driver uses a ringbuffer in user space.  I am sure this is not the problem as i can find no memory leaks in the ringbuffer but I haven't used a ring buffer since college so i could be missing something.

Thanks in advance for your help
Question by:cosmowen
  • 2

Expert Comment

ID: 11947832
I'm no expert in kernel programming, or device drivers, but I'm pretty sure a usermode program can't accidentally access anything that would reboot the computer, hence the problem is almost certain to be the kernel mode driver. The latest 2.4 kernel is 2.4.27, could there be a bug which patching your kernel might fix?

Without more info, it is pretty tough to diagnose your problem. Can you at least tell us what the USB device is? Are you using pre-existing drivers, or your own?
You have debugged this code, can you tell at what point during execution the reboot occurs? If you can't post the code snippet for that point, can you tell us what it is doing, which system calls it accesses?

A possible workaround: Is the program running as root? If so, can it be made to run entirely as a normal user, since unpriveledged users should not be able to reboot the machine.

Author Comment

ID: 11969579
ok well the device is a usb Reel controller (from a slot machine)
the reboots happen at random places I cannot track it to any specific place.  I modified the skeleton driver.  All messages must be 64 BYTEs in length.

I have set the program up to run as a normal user and allowed myseld access to the /dev/usbnode1 and everything works as just a regular user until all of a sudden reboot or completely hang.

I believe you are right about the problem being in the kernel mode driver. i will bring the code over to this computer and post what i can of it, later tonight or tom.  I will also try the 2.4.27 kernel and see if that might not solve the problem.

Also i am not sure if it is relevent but the kernel mode driver does a lock_kernel() call and then it does the following unlock_kernel() but could it be getting hung somewhere in between those two calls?? and if so could that cause a reboot or a hang??

thanks for your insight

Expert Comment

ID: 12158486
Sorry for not posting anything, I must have missed the e-mail notification of cos's last message. I'm afraid I can't offer any more usefull info - like I said I'm not a kernel hacker. Perhaps you should take this to the kernel mailing list, or one of the c.o.linux newsfroups? Good luck, and HH

Accepted Solution

Computer101 earned 0 total points
ID: 12195303
PAQed, with points refunded (300)

E-E Admin

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Loops Section Overview
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month19 days, 5 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question