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

 
 

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

Submitter:  Thomas Schwinge <tschwinge>
Submitted:  Fri 04 Aug 2006 02:14:59 PM UTC
   
 
Category:  Hurd Servers Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  None Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Open Reproducibility:  Every Time
Size (loc):  None Planned Release:  None
Effort:  0.00
Wiki-like text discussion box: 


* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group 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>
Group 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>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2006-08-07 benasselstine Attached File- Added crash-server-added-orphan-action-to-append-args-20060806.patch, #10477
    2006-08-05 tschwinge Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code