about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorCristian Cadar <c.cadar@imperial.ac.uk>2014-09-15 10:43:36 +0100
committerCristian Cadar <c.cadar@imperial.ac.uk>2014-09-15 10:43:36 +0100
commitaa000e933bda48ac67901b2a729dda7d5f9ca215 (patch)
tree84c8cf3e2519ea732aefe6ef1e0d774caae50c7d
parent543bb5d7fef5d039d3a6f2a65a0a16a76068f864 (diff)
parenta04f2277f90dc2aac3a3277c9dd7c6d3378059e4 (diff)
downloadklee-aa000e933bda48ac67901b2a729dda7d5f9ca215.tar.gz
Merge pull request #157 from MartinNowack/fix_posix_printout
Fix a possible deadlock.
-rw-r--r--runtime/POSIX/fd.c6
-rw-r--r--test/Runtime/POSIX/Write2.c6
2 files changed, 3 insertions, 9 deletions
diff --git a/runtime/POSIX/fd.c b/runtime/POSIX/fd.c
index 1c75cd76..24b248e3 100644
--- a/runtime/POSIX/fd.c
+++ b/runtime/POSIX/fd.c
@@ -157,7 +157,7 @@ int __fd_open(const char *pathname, int flags, mode_t mode) {
     if ((flags & O_TRUNC) && (flags & O_RDONLY)) {
       /* The result of using O_TRUNC with O_RDONLY is undefined, so we
 	 return error */
-      fprintf(stderr, "Undefined call to open(): O_TRUNC | O_RDONLY\n");
+      klee_warning("Undefined call to open(): O_TRUNC | O_RDONLY\n");
       errno = EACCES;
       return -1;
     }
@@ -165,7 +165,7 @@ int __fd_open(const char *pathname, int flags, mode_t mode) {
     if ((flags & O_EXCL) && !(flags & O_CREAT)) {
       /* The result of using O_EXCL without O_CREAT is undefined, so
 	 we return error */
-      fprintf(stderr, "Undefined call to open(): O_EXCL w/o O_RDONLY\n");
+      klee_warning("Undefined call to open(): O_EXCL w/o O_RDONLY\n");
       errno = EACCES;
       return -1;
     }
@@ -461,7 +461,7 @@ ssize_t write(int fd, const void *buf, size_t count) {
       memcpy(f->dfile->contents + f->off, buf, actual_count);
     
     if (count != actual_count)
-      fprintf(stderr, "WARNING: write() ignores bytes.\n");
+      klee_warning("write() ignores bytes.\n");
 
     if (f->dfile == __exe_fs.sym_stdout)
       __exe_fs.stdout_writes += actual_count;
diff --git a/test/Runtime/POSIX/Write2.c b/test/Runtime/POSIX/Write2.c
index 97d501f6..edb3e5b2 100644
--- a/test/Runtime/POSIX/Write2.c
+++ b/test/Runtime/POSIX/Write2.c
@@ -1,12 +1,6 @@
 // RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t.bc
 // RUN: rm -rf %t.klee-out
 // RUN: %klee --output-dir=%t.klee-out --exit-on-error --libc=uclibc --posix-runtime %t.bc --sym-files 1 10 --sym-stdout 2>%t.log
-//
-// Disable this test on LLVM 3.4 for now, it seems to hang indefinitely when run
-// in our Travis CI config.
-//
-// FIXME: Investigate.
-// REQUIRES: not-llvm-3.4
 
 #include <stdio.h>
 #include <assert.h>