bugThe GNU Hurd - Bugs: bug #17319, /hurd/crash --suspend doesn't work

 
 

bug #17319: /hurd/crash --suspend doesn't work

Submitted by:  Thomas Schwinge <tschwinge>
Submitted on:  Fri 04 Aug 2006 02:14:59 PM UTC  
 
Category: Hurd ServersSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: NonePrivacy: Public
Assigned to: NoneOriginator Name: 
Open/Closed: OpenReproducibility: Every Time
Size (loc): NonePlanned Release: None
Effort: 0.00
Wiki-like text discussion box: 

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 27 Nov 2006 03:24:17 PM UTC, comment #5:

I installed file #10477 (`crash-server-added-orphan-action-to-append-args-20060806.patch') after a tiny tweak.

#v+
2006-11-27 Ben Asselstine <benasselstine@canada.com>
Thomas Schwinge <tschwinge@gnu.org>

* crash.c (trivfs_append_args): Handle CRASH_ORPHANS_HOW.
#v-

This does -- of course -- not yet fix this bug report's main issue.

Thomas Schwinge <tschwinge>
Project Administrator
Thu 10 Aug 2006 12:04:53 AM UTC, comment #4:

I had some success with the patched crash-server and I thought I should share it here.

After doing this:

# ln -sf crash-suspend /servers/crash
# fsysopts /servers/crash-suspend --suspend --orphan-action=kill

I could successfully attach to crashed suspended processes using gdb.

I also tried --orphan-action=core-file, and --orphan-action=suspend, but no luck.

Fun stuff!

Ben Asselstine <benasselstine>
Tue 08 Aug 2006 11:11:12 PM UTC, comment #3:

I tried the patched crash server, and it didn't quite work as expected.

I retried Thomas' example:

#v+
thomas@leibniz:/var/tmp $ cat > crash.c
int main (void) { return (int ) 0; }
thomas@leibniz:/var/tmp $ gcc crash.c
thomas@leibniz:/var/tmp $ ./a.out
Segmentation fault (core dumped)
thomas@leibniz:/var/tmp $ ls -l core
-rw------- 1 thomas root 16912384 Jun 15 20:43 core
thomas@leibniz:/var/tmp $ ls -l /servers/crash
lrwxr-xr-x 1 root root 13 Jun 15 20:42 /servers/crash -> crash-suspend
thomas@leibniz:/var/tmp $ showtrans /servers/crash-suspend
/hurd/crash --suspend
#v-

But I added:

$ fsysopts /servers/crash-suspend --suspend --orphan-action=suspend

It didn't change the behaviour -- it still dumped core. but,

$ fsysopts /servers/crash-suspend --suspend --orphan-action=kill

did. It suspended the task.

I then tried to attach to the crash server using gdb, but it said that the pid didn't have any children.

Ben Asselstine <benasselstine>
Mon 07 Aug 2006 12:36:50 AM UTC, comment #2:

Here is a patch that makes the crash server support --orphan-action in fsysopts.

Incidentally I couldn't set the fsysopts as a regular user. Perhaps this is a bug also.

Ben Asselstine <benasselstine>
Sat 05 Aug 2006 01:05:34 AM UTC, comment #1:

Roland commented on bug-hurd:

Make sure it's not just a bug in the option parsing or something. Check
with fsysopts /servers/crash. I note that its trivfs_append_args doesn't
show the --orphan-action setting. You might fix that.

Try fsysopts --orphan-action=suspend and see if that changes the behavior.
If it does, then the problem is in deciding whether it's an orphan.

Then debug the server and see if crash_how is set correctly. Because
nothing else (that's not dying) depends on it, it is easy to use gdb on crash.
Break in S_crash_dump_task and see what's going on.

Thomas Schwinge <tschwinge>
Project Administrator
Fri 04 Aug 2006 02:14:59 PM UTC, original submission:

`/hurd/crash --suspend' is usually running as a server on `/servers/crash-suspend' and may be linked to from `/servers/crash' to actually use it.

It's meant to suspend a crashed process, i.e. keep it in a frozen state in memory (as opposed to dumping a core file) to make it attachable and debuggable by gdb.

Unfortunately this doesn't work:

#v+
thomas@leibniz:/var/tmp $ cat > crash.c
int main (void) { return (int ) 0; }
thomas@leibniz:/var/tmp $ gcc crash.c
thomas@leibniz:/var/tmp $ ./a.out
Segmentation fault (core dumped)
thomas@leibniz:/var/tmp $ ls -l core
-rw------- 1 thomas root 16912384 Jun 15 20:43 core
thomas@leibniz:/var/tmp $ ls -l /servers/crash
lrwxr-xr-x 1 root root 13 Jun 15 20:42 /servers/crash -> crash-suspend
thomas@leibniz:/var/tmp $ showtrans /servers/crash-suspend
/hurd/crash --suspend
#v-

According to Roland it has been working ``in the past'' (``Long before core dumping ever worked at all.'') and he also added that ``the crash server is one of the easier ones to debug with gdb.''

Thomas Schwinge <tschwinge>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by tschwinge (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 07 Aug 2006 12:36:50 AM UTCbenasselstineAttached File-=>Added crash-server-added-orphan-action-to-append-args-20060806.patch, #10477
    Sat 05 Aug 2006 01:05:34 AM UTCtschwingeCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup