Skip to contentSkip to conversation

Plain "./fio" segfaults on FreeBSD

DISCUSSION Bruce Cran 2 participants 3 messages Feb 25, 2015 – Feb 26, 2015

lore
Share & tools
lore

Bruce Cran

author
#0 lore raw

The latest code from git (built using clang) causes a segfault after printing the usage text when "./fio" is run:

[New LWP 100111]
No jobs(s) defined

fio-2.2.5-28-g93eeb
[usage text]
[New Thread 801c06400 (LWP 100111/fio)]

Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 801c06400 (LWP 100111/fio)] flist_empty (head=0x802000040) at flist.h:119
119 return head->next == head;
Current language: auto; currently minimal (gdb) p head
$1 = (const struct flist_head *) 0x802000040

Also, could we update -std=gnu99 to -std=c11 and use _Static_assert in compiler.h? Currently, turning optimizations off in the Makefile causes linker failures such as "fio/libfio.c:308: undefined reference to `__compiletime_assert_308'".

Signature · 1 line
Bruce
#1 lore raw
Quoted 10 lines · Bruce Cran

The latest code from git (built using clang) causes a segfault after printing the usage text when "./fio" is run:

[New LWP 100111]
No jobs(s) defined

fio-2.2.5-28-g93eeb
[usage text]
[New Thread 801c06400 (LWP 100111/fio)]

Quoted 7 lines

Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 801c06400 (LWP 100111/fio)] flist_empty (head=0x802000040) at flist.h:119
119 return head->next == head;
Current language: auto; currently minimal (gdb) p head
$1 = (const struct flist_head *) 0x802000040

I can reproduce this, very strange... I'll debug it.

Quoted 4 lines

Also, could we update -std=gnu99 to -std=c11 and use _Static_assert in compiler.h? Currently, turning optimizations off in the Makefile causes linker failures such as "fio/libfio.c:308: undefined reference to `__compiletime_assert_308'".

I think it'd be more bullet proof (considering other platforms) to just not do the compile time asserts at all if optimizations aren't enabled. I'd be happy to take a patch for that...

Signature · 1 line
Jens Axboe
#2 lore raw
Quoted 19 lines · Jens Axboe
Quoted 10 lines · Bruce Cran

The latest code from git (built using clang) causes a segfault after printing the usage text when "./fio" is run:

[New LWP 100111]
No jobs(s) defined

fio-2.2.5-28-g93eeb
[usage text]
[New Thread 801c06400 (LWP 100111/fio)]

Quoted 7 lines

Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 801c06400 (LWP 100111/fio)] flist_empty (head=0x802000040) at flist.h:119
119 return head->next == head;
Current language: auto; currently minimal (gdb) p head
$1 = (const struct flist_head *) 0x802000040

Quoted 1 line

I can reproduce this, very strange... I'll debug it.

This should fix it:

http://git.kernel.dk/?p=fio.git;a=commit;h=3d0e3417997d9caa27cf97462e15ba437d285d29

Signature · 1 line
Jens Axboe