Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have written a program for basic file reading/writing. When I added lseek, a function new to me it did not terminate. I have tried to use the following commands to get it to do so:

ctrl 
kill PID 
kill -9 PID 
killall Processname 

I have disconnected the telnet session, but the host is still reachable.

Since it is a BSP for an embedded device, it does not support all commands. For instance, ps will only return:

PID   USER     TIME   COMMAND 
1001 root       0:00 ./07-7 

I have found How is it possible that kill -9 for a process on Linux has no effect? but due to the previously mentioned limitation I can not see ps STAT, or execute ps axopid,comm,wchan.

Since the board is on a remote location, with no-one in place and other users in need to use it over the weekend, I do not want to reboot it. I can also not just let the program run, since it has a lock on a shared file needed by others. Any advice would be appreciated!

Code:

write(fd, pix1, 64);
lseek(fd, -19, SEEK_SET); //added last, after which it did not recover
read(fd, pix2, 64);
close(fd);
share|improve this question

migrated from stackoverflow.com Dec 8 '12 at 16:04

This question came from our site for professional and enthusiast programmers.

    
Bizarre... It won't respond to kill -9? How about sudo kill -9? –  Linuxios Dec 7 '12 at 22:11
    
After reading the other question, I suspect the failing storage medium sleep. Can you launch another process (with a timeout) to see if the storage medium is failing? –  Linuxios Dec 7 '12 at 22:14
    
@Linuxios I am logged in as root, the only user possible on this board. –  Tom Dec 7 '12 at 22:17
    
Hm. Very, very odd. What kind of storage medium is it, and are they custom drivers, or Linux drivers. (eg. is it SATA or PATA, or is it something odd and exotic)? –  Linuxios Dec 7 '12 at 22:19
    
I can still write to other files on the disk. I can not write to the particular file which is locked by open() in the stalling program –  Tom Dec 7 '12 at 22:20
show 10 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.