pwrite does not work right under qemu-sh4

Bug #1701974 reported by Bruno Haible
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Undecided
Unassigned

Bug Description

The pwrite system call has no effect when writing to a non-zero file position, in a program running under qemu-sh4 (version 2.9.0).

How to reproduce:
- Compile the program:
  sh4-linux-gnu-gcc-5 -O -Wall -static -o test-pwrite test-pwrite.c
- Set environment variable for using qemu-sh4 (actually not needed, since the program is statically linked here).
- ~/inst-qemu/2.9.0/bin/qemu-sh4 test-pwrite

Expected output:
buf = 01W3456789

Actual output:
buf = 0123456789
test-pwrite.c:56: assertion 'strcmp ("01W3456789",buf) == 0' failed
qemu: uncaught target signal 6 (Aborted) - core dumped

Revision history for this message
Bruno Haible (bruno-clisp) wrote :
Revision history for this message
Bruno Haible (bruno-clisp) wrote :
Revision history for this message
Bruno Haible (bruno-clisp) wrote :

In case it matters: My host platform is Linux/x86_64.

Revision history for this message
Bruno Haible (bruno-clisp) wrote :

The behaviour in qemu-2.10 is the same as in qemu-2.9.

Revision history for this message
John Paul Adrian Glaubitz (glaubitz) wrote :

This might be related to this fix:

> https://git.qemu.org/?p=qemu.git;a=commit;h=8bf8e9df4a7d82c7a47cc961c9cdee1615595de0

FWIW, if you're interested in sh4, please join #debian-ports on OFTC and subscribe to the debian-superh mailing list. We're doing lots of sh4 development and testing QEMU in Debian.

Revision history for this message
Bruno Haible (bruno-clisp) wrote :

Works fine in qemu-2.11:
$ ~/inst-qemu/2.11.0/bin/qemu-sh4 test-pwrite
buf = 01W3456789

Changed in qemu:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.