All of lore.kernel.org
 help / color / mirror / Atom feed
* fio 1.22 segfaults when pressing ctrl-c
@ 2008-11-18 15:24 Erwan Velu
  2008-11-18 17:58 ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Erwan Velu @ 2008-11-18 15:24 UTC (permalink / raw)
  To: fio

I'm running fio with the surface scan example, and it just segfault and 
generate a core if I'm pressing CTRL-C during the test.

[root@max5 examples]# fio surface-scan
write-phase: (g=0): rw=write, bs=64K-64K/64K-64K, ioengine=sync, iodepth=1
verify-phase: (g=1): rw=read, bs=64K-64K/64K-64K, ioengine=sync, iodepth=1
Starting 2 threads
**** I'm pressing CTRL-C ****
fio: terminating on signal 2
Quit (core dumped)
[root@max5 examples]#


Then same from gdb:

[root@max5 examples]# gdb --args fio surface-scan
GNU gdb Red Hat Linux (6.5-25.el5_1.1rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain 
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu"...Using host 
libthread_db library "/lib64/libthread_db.so.1".

(gdb) run
Starting program: /usr/bin/fio surface-scan
[Thread debugging using libthread_db enabled]
[New Thread 46912498286832 (LWP 2158)]
write-phase: (g=0): rw=write, bs=64K-64K/64K-64K, ioengine=sync, iodepth=1
verify-phase: (g=1): rw=read, bs=64K-64K/64K-64K, ioengine=sync, iodepth=1
Starting 2 threads
[New Thread 1084229952 (LWP 2161)]
Jobs: 1 (f=1): [WP] [-.-% done] [     0/ 57822 kb/s] [eta 00m:00s]

**** I'm pressing CTRL-C ****

Program received signal SIGINT, Interrupt.
[Switching to Thread 46912498286832 (LWP 2158)]
0x0000003c23495511 in nanosleep () from /lib64/libc.so.6
(gdb) bt
#0  0x0000003c23495511 in nanosleep () from /lib64/libc.so.6
#1  0x0000003c234c8554 in usleep () from /lib64/libc.so.6
#2  0x0000000000408448 in main (argc=<value optimized out>, argv=<value 
optimized out>) at fio.c:1394
(gdb)

-- 
Erwan Velu
Pre-Sales Engineer
Seanodes
http://www.seanodes.com
+33 (0)1 41 22 13 83


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: fio 1.22 segfaults when pressing ctrl-c
  2008-11-18 15:24 fio 1.22 segfaults when pressing ctrl-c Erwan Velu
@ 2008-11-18 17:58 ` Jens Axboe
  2008-11-18 18:08   ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2008-11-18 17:58 UTC (permalink / raw)
  To: Erwan Velu; +Cc: fio

On Tue, Nov 18 2008, Erwan Velu wrote:
> I'm running fio with the surface scan example, and it just segfault and 
> generate a core if I'm pressing CTRL-C during the test.
> 
> [root@max5 examples]# fio surface-scan
> write-phase: (g=0): rw=write, bs=64K-64K/64K-64K, ioengine=sync, iodepth=1
> verify-phase: (g=1): rw=read, bs=64K-64K/64K-64K, ioengine=sync, iodepth=1
> Starting 2 threads
> **** I'm pressing CTRL-C ****
> fio: terminating on signal 2
> Quit (core dumped)
> [root@max5 examples]#
> 
> 
> Then same from gdb:
> 
> [root@max5 examples]# gdb --args fio surface-scan
> GNU gdb Red Hat Linux (6.5-25.el5_1.1rh)
> Copyright (C) 2006 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain 
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for details.
> This GDB was configured as "x86_64-redhat-linux-gnu"...Using host 
> libthread_db library "/lib64/libthread_db.so.1".
> 
> (gdb) run
> Starting program: /usr/bin/fio surface-scan
> [Thread debugging using libthread_db enabled]
> [New Thread 46912498286832 (LWP 2158)]
> write-phase: (g=0): rw=write, bs=64K-64K/64K-64K, ioengine=sync, iodepth=1
> verify-phase: (g=1): rw=read, bs=64K-64K/64K-64K, ioengine=sync, iodepth=1
> Starting 2 threads
> [New Thread 1084229952 (LWP 2161)]
> Jobs: 1 (f=1): [WP] [-.-% done] [     0/ 57822 kb/s] [eta 00m:00s]
> 
> **** I'm pressing CTRL-C ****
> 
> Program received signal SIGINT, Interrupt.
> [Switching to Thread 46912498286832 (LWP 2158)]
> 0x0000003c23495511 in nanosleep () from /lib64/libc.so.6
> (gdb) bt
> #0  0x0000003c23495511 in nanosleep () from /lib64/libc.so.6
> #1  0x0000003c234c8554 in usleep () from /lib64/libc.so.6
> #2  0x0000000000408448 in main (argc=<value optimized out>, argv=<value 
> optimized out>) at fio.c:1394
> (gdb)

Can you recreate with the -O2 removed in the Makefile? That'll get us
some better debug information. You probably also want to inspect the
thread that crashed, you are looking at the main process and that just
mainly sleeps and does status dumps every few seconds.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: fio 1.22 segfaults when pressing ctrl-c
  2008-11-18 17:58 ` Jens Axboe
@ 2008-11-18 18:08   ` Jens Axboe
  0 siblings, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2008-11-18 18:08 UTC (permalink / raw)
  To: Erwan Velu; +Cc: fio

On Tue, Nov 18 2008, Jens Axboe wrote:
> On Tue, Nov 18 2008, Erwan Velu wrote:
> > I'm running fio with the surface scan example, and it just segfault and 
> > generate a core if I'm pressing CTRL-C during the test.
> > 
> > [root@max5 examples]# fio surface-scan
> > write-phase: (g=0): rw=write, bs=64K-64K/64K-64K, ioengine=sync, iodepth=1
> > verify-phase: (g=1): rw=read, bs=64K-64K/64K-64K, ioengine=sync, iodepth=1
> > Starting 2 threads
> > **** I'm pressing CTRL-C ****
> > fio: terminating on signal 2
> > Quit (core dumped)
> > [root@max5 examples]#
> > 
> > 
> > Then same from gdb:
> > 
> > [root@max5 examples]# gdb --args fio surface-scan
> > GNU gdb Red Hat Linux (6.5-25.el5_1.1rh)
> > Copyright (C) 2006 Free Software Foundation, Inc.
> > GDB is free software, covered by the GNU General Public License, and you are
> > welcome to change it and/or distribute copies of it under certain 
> > conditions.
> > Type "show copying" to see the conditions.
> > There is absolutely no warranty for GDB.  Type "show warranty" for details.
> > This GDB was configured as "x86_64-redhat-linux-gnu"...Using host 
> > libthread_db library "/lib64/libthread_db.so.1".
> > 
> > (gdb) run
> > Starting program: /usr/bin/fio surface-scan
> > [Thread debugging using libthread_db enabled]
> > [New Thread 46912498286832 (LWP 2158)]
> > write-phase: (g=0): rw=write, bs=64K-64K/64K-64K, ioengine=sync, iodepth=1
> > verify-phase: (g=1): rw=read, bs=64K-64K/64K-64K, ioengine=sync, iodepth=1
> > Starting 2 threads
> > [New Thread 1084229952 (LWP 2161)]
> > Jobs: 1 (f=1): [WP] [-.-% done] [     0/ 57822 kb/s] [eta 00m:00s]
> > 
> > **** I'm pressing CTRL-C ****
> > 
> > Program received signal SIGINT, Interrupt.
> > [Switching to Thread 46912498286832 (LWP 2158)]
> > 0x0000003c23495511 in nanosleep () from /lib64/libc.so.6
> > (gdb) bt
> > #0  0x0000003c23495511 in nanosleep () from /lib64/libc.so.6
> > #1  0x0000003c234c8554 in usleep () from /lib64/libc.so.6
> > #2  0x0000000000408448 in main (argc=<value optimized out>, argv=<value 
> > optimized out>) at fio.c:1394
> > (gdb)
> 
> Can you recreate with the -O2 removed in the Makefile? That'll get us
> some better debug information. You probably also want to inspect the
> thread that crashed, you are looking at the main process and that just
> mainly sleeps and does status dumps every few seconds.

OK nevermind, it's because of that main thread getting its own SIGQUIT
and not handling it. The below should fix it, I'll release a new version
soon.

diff --git a/fio.c b/fio.c
index 08011c9..2aa8b40 100644
--- a/fio.c
+++ b/fio.c
@@ -116,6 +116,13 @@ static void sig_alrm(int fio_unused sig)
 	}
 }
 
+/*
+ * Happens on thread runs with ctrl-c, ignore our own SIGQUIT
+ */
+static void sig_quit(int sig)
+{
+}
+
 static void sig_int(int sig)
 {
 	if (threads) {
@@ -154,6 +161,11 @@ static void set_sig_handlers(void)
 	act.sa_handler = sig_ill;
 	act.sa_flags = SA_RESTART;
 	sigaction(SIGILL, &act, NULL);
+
+	memset(&act, 0, sizeof(act));
+	act.sa_handler = sig_quit;
+	act.sa_flags = SA_RESTART;
+	sigaction(SIGQUIT, &act, NULL);
 }
 
 static inline int should_check_rate(struct thread_data *td)

-- 
Jens Axboe


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-11-18 18:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-18 15:24 fio 1.22 segfaults when pressing ctrl-c Erwan Velu
2008-11-18 17:58 ` Jens Axboe
2008-11-18 18:08   ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.