Hui Zhu
a65e7bfcd7
elf: fix multithreaded program core dumping on arm
...
Fix the multithread program core thread message error.
This issue affects arches with neither has CORE_DUMP_USE_REGSET nor
ELF_CORE_COPY_TASK_REGS, ARM is one of them.
The thread message of core file is generated in elf_dump_thread_status.
The register values is set by elf_core_copy_task_regs in this function.
If an arch doesn't define ELF_CORE_COPY_TASK_REGS,
elf_core_copy_task_regs() will do nothing. Then the core file will not
have the register message of thread.
So add elf_core_copy_regs to set regiser values if ELF_CORE_COPY_TASK_REGS
doesn't define.
The following is how to reproduce this issue:
cat 1.c
#include <stdio.h>
#include <pthread.h>
#include <assert.h>
void td1(void * i)
{
while (1)
{
printf ("1\n");
sleep (1);
}
return;
}
void td2(void * i)
{
while (1)
{
printf ("2\n");
sleep (1);
}
return;
}
int
main(int argc,char *argv[],char *envp[])
{
pthread_t t1,t2;
pthread_create(&t1, NULL, (void*)td1, NULL);
pthread_create(&t2, NULL, (void*)td2, NULL);
sleep (10);
assert(0);
return (0);
}
arm-xxx-gcc -g -lpthread 1.c -o 1
copy 1.c and 1 to a arm board.
Goto this board.
ulimit -c 1800000
./1
# ./1
1
2
1
...
...
1
1: 1.c:37: main: Assertion `0' failed.
Aborted (core dumped)
Then you can get a core file.
gdb 1 core.xxx
Without the patch:
(gdb) info threads
3 process 909 0x00000000 in ?? ()
2 process 908 0x00000000 in ?? ()
* 1 process 907 0x4a6e2238 in raise () from /lib/libc.so.6
You can found that the pc of 909 and 908 is 0x00000000.
With the patch:
(gdb) info threads
3 process 885 0x4a749974 in nanosleep () from /lib/libc.so.6
2 process 884 0x4a749974 in nanosleep () from /lib/libc.so.6
* 1 process 883 0x4a6e2238 in raise () from /lib/libc.so.6
The pc of 885 and 884 is right.
Signed-off-by: Hui Zhu <teawater@gmail.com >
Cc: Amerigo Wang <xiyou.wangcong@gmail.com >
Cc: Al Viro <viro@zeniv.linux.org.uk >
Cc: David Howells <dhowells@redhat.com >
Cc: Roland McGrath <roland@redhat.com >
Cc: Jakub Jelinek <jakub@redhat.com >
Cc: Russell King <rmk@arm.linux.org.uk >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-07-06 13:57:03 -07:00
..
2009-06-19 16:46:03 -07:00
2009-06-01 02:53:35 -07:00
2009-06-20 10:17:02 -07:00
2009-06-08 00:45:50 -07:00
2009-06-17 18:02:10 -07:00
2009-06-17 19:41:52 +02:00
2009-06-05 10:36:24 -07:00
2009-06-16 19:14:16 -03:00
2009-06-22 16:56:22 -07:00
2009-06-29 14:31:46 +02:00
2009-06-22 12:55:50 -07:00
2009-06-18 08:46:47 +10:00
2009-06-15 11:18:26 +01:00
2009-06-30 18:56:00 -07:00
2009-06-22 12:55:50 -07:00
2009-06-30 19:46:49 -07:00
2009-06-11 03:30:20 -07:00
Merge branches 'acerhdf', 'acpi-pci-bind', 'bjorn-pci-root', 'bugzilla-12904', 'bugzilla-13121', 'bugzilla-13396', 'bugzilla-13533', 'bugzilla-13612', 'c3_lock', 'hid-cleanups', 'misc-2.6.31', 'pdc-leak-fix', 'pnpacpi', 'power_nocheck', 'thinkpad_acpi', 'video' and 'wmi' into release
2009-06-24 01:19:50 -04:00
2009-06-17 00:36:36 -04:00
2009-06-19 10:21:42 +10:00
2009-06-30 18:55:58 -07:00
2009-06-15 18:52:52 +02:00
2009-04-08 20:47:48 +02:00
2009-06-24 00:00:52 -04:00
2009-04-01 08:59:23 -07:00
2009-06-01 06:21:13 +00:00
2009-04-06 08:04:53 -07:00
2009-05-02 15:36:10 -07:00
2009-07-01 10:56:25 +02:00
2009-04-23 10:06:35 +01:00
2009-07-01 10:56:26 +02:00
2009-06-10 11:55:06 +02:00
2009-04-01 08:59:14 -07:00
2009-04-16 07:47:49 -07:00
2009-06-16 19:47:48 -07:00
2009-06-15 15:49:34 +02:00
2009-04-13 08:32:28 -07:00
2009-06-13 22:42:59 +02:00
2009-06-11 21:36:09 -04:00
2009-04-03 15:24:35 -07:00
2009-06-04 17:45:43 +01:00
2009-05-13 16:52:42 +02:00
2009-05-02 11:45:15 +02:00
2009-04-30 19:24:24 +02:00
2009-06-18 13:03:57 -07:00
2009-06-12 21:46:57 +09:30
2009-06-22 10:12:35 +01:00
2009-06-22 21:18:12 -07:00
2009-06-09 22:30:26 +09:30
2009-06-16 19:47:31 -07:00
2009-06-11 21:36:10 -04:00
2009-05-29 08:40:01 -07:00
2009-06-11 08:50:57 -07:00
2009-06-11 21:36:06 -04:00
2009-04-14 11:11:52 +02:00
2009-06-22 10:12:35 +01:00
2009-06-15 21:30:25 -07:00
2009-05-07 10:14:26 -05:00
2009-04-02 19:55:30 +01:00
2009-06-22 10:12:30 +01:00
2009-06-22 10:12:35 +01:00
2009-05-18 14:46:26 +01:00
2009-04-15 12:22:37 +02:00
2009-06-19 16:46:08 -07:00
2009-05-12 14:41:47 -07:00
2009-06-23 22:09:17 +01:00
2009-06-11 14:57:53 -04:00
2009-04-03 14:53:32 -07:00
2009-04-01 15:42:34 -07:00
2009-04-16 16:17:11 -07:00
2009-06-17 09:33:49 -07:00
2009-06-15 21:30:26 -07:00
2009-05-11 09:52:18 +02:00
2009-07-06 13:57:03 -07:00
2009-05-05 12:26:24 -07:00
2009-06-09 05:25:36 -07:00
2009-06-30 18:55:58 -07:00
2009-06-24 08:17:04 -04:00
2009-04-03 11:10:33 -07:00
2009-06-24 08:15:27 -04:00
2009-06-30 18:56:00 -07:00
2009-04-03 12:13:03 +02:00
2009-04-13 15:04:30 -07:00
2009-06-14 14:26:29 +02:00
2009-06-16 19:47:28 -07:00
2009-06-15 21:30:25 -07:00
2009-04-27 02:53:51 -07:00
2009-03-31 23:00:26 -04:00
2009-06-24 08:15:27 -04:00
2009-04-03 16:42:37 +01:00
2009-04-03 16:42:39 +01:00
2009-06-18 13:03:42 -07:00
2009-06-29 10:00:58 -04:00
2009-06-11 14:57:54 -04:00
2009-06-01 23:26:02 -04:00
2009-06-18 18:40:18 -04:00
2009-06-30 20:12:24 +02:00
2009-04-30 11:41:35 +02:00
2009-05-09 16:10:18 -07:00
2009-06-18 13:04:05 -07:00
2009-06-15 21:30:25 -07:00
2009-06-18 13:12:57 -07:00
2009-04-06 01:41:22 +02:00
2009-04-01 21:42:26 +02:00
2009-05-20 15:48:35 +02:00
2009-06-16 19:47:41 -07:00
2009-06-24 11:15:09 +02:00
2009-06-23 11:23:33 -07:00
2009-04-06 18:11:41 -07:00
2009-06-13 10:39:28 +01:00
2009-06-19 16:58:21 +02:00
2009-05-28 20:52:40 -04:00
2009-06-23 04:31:07 -07:00
2009-06-29 19:20:42 -07:00
2009-04-02 19:04:53 -07:00
2009-06-03 14:05:10 -04:00
2009-06-09 05:25:30 -07:00
2009-06-15 03:02:23 -07:00
2009-05-21 15:13:39 -07:00
2009-04-27 03:23:54 -07:00
2009-05-19 16:02:02 -07:00
2009-04-16 02:02:07 -07:00
2009-05-18 22:19:19 -07:00
2009-06-29 08:59:10 +10:00
2009-06-02 00:45:24 -07:00
2009-06-27 00:06:42 +02:00
2009-06-18 13:03:57 -07:00
2009-06-19 22:55:17 -07:00
2009-05-18 14:46:26 +01:00
2009-06-15 15:50:49 +02:00
2009-06-10 23:07:15 +02:00
2009-06-11 12:04:06 -07:00
2009-06-18 13:03:56 -07:00
2009-04-21 13:41:48 -07:00
2009-04-21 13:41:48 -07:00
2009-06-01 03:07:33 -07:00
2009-06-20 11:30:01 -07:00
2009-06-17 11:47:48 -04:00
2009-04-14 10:10:47 -04:00
2009-06-22 10:12:35 +01:00
2009-06-18 13:03:40 -07:00
2009-06-25 22:06:11 +02:00
2009-04-03 12:21:12 +02:00
2009-06-14 13:50:36 -07:00
2009-06-15 15:49:23 +02:00
2009-06-11 17:03:28 +01:00
2009-04-14 22:05:43 -04:00
2009-04-09 07:49:44 -07:00
2009-04-07 08:31:08 -07:00
2009-06-28 14:10:29 +03:00
2009-06-10 11:48:27 +03:00
2009-06-10 11:48:39 +03:00
2009-04-06 16:06:26 +01:00
2009-04-06 16:06:26 +01:00
2009-06-23 20:21:38 +01:00
2009-06-23 20:21:39 +01:00
2009-06-12 22:27:11 +09:30
2009-06-12 22:27:03 +09:30
2009-04-16 15:28:23 -04:00
2009-06-26 23:58:39 +02:00
2009-06-16 19:47:57 -07:00
2009-06-16 19:47:57 -07:00
2009-06-13 12:28:57 +02:00
2009-06-22 14:34:22 -07:00
2009-04-28 07:37:28 +02:00
2009-04-14 09:00:19 +10:00
2009-06-11 21:36:10 -04:00
2009-06-16 19:47:48 -07:00
2009-06-09 00:53:21 +04:00
2009-06-11 02:47:10 -07:00
2009-06-18 13:03:47 -07:00
2009-04-05 11:04:19 -07:00
2009-06-16 08:40:20 +02:00
2009-04-29 17:32:35 -07:00
2009-06-15 21:30:25 -07:00
2009-05-25 00:55:30 -07:00
2009-06-11 19:05:32 +02:00
2009-05-25 00:55:45 -07:00
2009-06-16 19:50:13 -07:00
2009-06-25 11:22:13 -07:00
2009-05-02 15:36:10 -07:00
2009-04-29 11:33:34 +02:00
2009-06-16 19:47:42 -07:00
2009-06-22 21:28:25 -07:00
2009-06-18 13:03:57 -07:00
2009-06-12 21:46:58 +09:30
2009-06-11 21:36:02 -04:00
2009-04-01 07:38:54 -04:00
2009-04-30 09:01:34 +02:00
2009-06-11 21:36:01 -04:00
2009-06-15 03:02:23 -07:00
2009-06-18 00:29:08 -07:00
2009-06-17 18:02:11 -07:00
2009-06-17 18:02:11 -07:00
2009-06-17 12:24:34 -07:00
2009-06-17 14:11:42 -07:00
2009-04-03 16:42:44 +01:00
2009-04-03 16:42:43 +01:00
2009-06-17 12:24:34 -07:00
2009-06-17 18:02:11 -07:00
2009-04-07 08:31:20 -07:00
2009-05-13 15:44:39 -04:00
2009-06-09 05:25:33 -07:00
2009-06-15 21:44:43 -07:00
2009-06-16 19:47:35 -07:00
2009-06-03 14:05:12 -04:00
2009-03-31 23:00:27 -04:00
2009-04-27 02:53:47 -07:00
2009-05-02 15:36:10 -07:00
2009-04-27 02:53:45 -07:00
2009-06-12 11:00:54 +03:00
2009-04-01 08:59:13 -07:00
2009-06-17 08:30:15 +03:00
2009-06-16 19:47:42 -07:00
2009-04-01 08:59:13 -07:00
2009-04-07 08:44:06 -07:00
2009-06-02 09:53:22 -07:00
Merge branches 'acerhdf', 'acpi-pci-bind', 'bjorn-pci-root', 'bugzilla-12904', 'bugzilla-13121', 'bugzilla-13396', 'bugzilla-13533', 'bugzilla-13612', 'c3_lock', 'hid-cleanups', 'misc-2.6.31', 'pdc-leak-fix', 'pnpacpi', 'power_nocheck', 'thinkpad_acpi', 'video' and 'wmi' into release
2009-06-24 01:19:50 -04:00
2009-06-30 18:55:59 -07:00
2009-06-22 21:38:22 -07:00
2009-06-16 14:29:30 -07:00
2009-06-22 21:38:22 -07:00
2009-06-30 18:55:59 -07:00
2009-06-11 17:04:18 +01:00
2009-06-30 12:00:16 +02:00
2009-05-26 21:16:25 -07:00
2009-05-11 14:13:10 +02:00
2009-04-24 08:54:21 +02:00
2009-06-15 21:30:24 -07:00
2009-06-12 21:32:31 +02:00
2009-06-05 14:37:41 +00:00
2009-04-01 08:59:13 -07:00
2009-06-16 19:47:48 -07:00
2009-06-24 16:58:48 -04:00
2009-06-18 13:04:04 -07:00
2009-06-18 13:04:04 -07:00
2009-06-11 21:36:01 -04:00
2009-06-18 13:03:51 -07:00
2009-06-11 21:36:12 -04:00
2009-06-11 21:36:04 -04:00
2009-06-16 19:47:30 -07:00
2009-06-11 08:51:08 -07:00
2009-04-03 12:23:05 +02:00
2009-04-14 18:41:15 +02:00
2009-04-03 12:23:05 +02:00
2009-04-03 12:23:05 +02:00
2009-04-14 11:33:43 +02:00
2009-06-24 08:17:06 -04:00
2009-06-24 08:17:06 -04:00
2009-06-11 21:35:58 -04:00
2009-06-18 13:03:46 -07:00
2009-05-17 11:45:45 -07:00
2009-06-18 13:03:48 -07:00
2009-06-19 11:50:18 -04:00
2009-06-15 15:49:37 +02:00
2009-06-23 12:50:05 -07:00
2009-05-09 10:49:41 -04:00
2009-04-17 20:37:21 -07:00
2009-04-02 19:04:51 -07:00
2009-04-01 08:59:24 -07:00
2009-06-30 18:55:59 -07:00
2009-06-03 09:14:45 -04:00
2009-04-19 10:47:45 -07:00
2009-06-04 12:07:48 +10:00
2009-06-18 13:03:57 -07:00
2009-06-22 11:32:25 -07:00
2009-04-08 14:33:38 -07:00
2009-06-22 11:32:24 -07:00
2009-05-08 23:22:26 +09:00
2009-06-11 08:50:58 -07:00
2009-05-09 16:10:18 -07:00
2009-05-03 17:57:17 +09:00
2009-06-24 08:17:06 -04:00
2009-04-13 15:04:29 -07:00
2009-04-30 19:24:24 +02:00
2009-06-18 14:07:15 -07:00
2009-06-13 08:58:43 +02:00
2009-06-15 15:50:49 +02:00
2009-06-12 18:53:33 +03:00
2009-04-21 19:40:00 -07:00
2009-06-12 18:53:33 +03:00
2009-06-16 19:47:48 -07:00
2009-04-28 01:53:11 -07:00
2009-04-27 02:45:02 -07:00
2009-06-09 05:25:30 -07:00
2009-06-10 11:48:14 +02:00
2009-04-02 19:05:11 -07:00
2009-05-12 11:11:48 +02:00
2009-06-12 23:04:12 +02:00
2009-04-05 10:30:21 -07:00
2009-04-10 15:48:52 +02:00
2009-06-12 21:32:33 +02:00
2009-06-23 12:50:05 -07:00
2009-04-08 16:18:38 +02:00
2009-04-02 19:05:01 -07:00
2009-06-16 19:47:52 -07:00
2009-04-20 02:25:26 -07:00
2009-04-06 11:14:03 +02:00
2009-06-13 12:00:26 +02:00
2009-05-02 11:45:15 +02:00
2009-06-24 11:15:09 +02:00
2009-06-16 19:47:27 -07:00
2009-06-15 11:37:09 -04:00
2009-06-18 13:03:49 -07:00
2009-06-15 21:30:28 -07:00
2009-06-11 08:50:59 -07:00
2009-06-11 08:51:01 -07:00
2009-06-19 08:08:50 +02:00
2009-05-27 06:25:05 -07:00
2009-06-12 18:01:45 +02:00
2009-06-16 13:06:10 -07:00
2009-06-16 19:47:47 -07:00
2009-06-23 03:12:37 -03:00
2009-06-09 14:41:40 +02:00
2009-06-12 22:16:38 +09:30
2009-05-01 15:34:02 -07:00
2009-06-12 22:16:37 +09:30
2009-06-12 22:16:39 +09:30
2009-06-12 22:16:36 +09:30
2009-06-16 19:47:52 -07:00
2009-06-16 19:47:46 -07:00
2009-06-18 13:03:58 -07:00
2009-05-11 12:59:37 +02:00
2009-05-28 18:02:32 -07:00
2009-04-02 19:04:50 -07:00
2009-06-11 21:36:03 -04:00