Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#52 closed defect (fixed)

unable to reproduce divcc/gzip hello world with divine-4.2.1+2019.02.06

Reported by: Kamil Dudka Owned by: mornfall
Priority: major Milestone: 4.3
Component: VM Keywords:


I tried to reproduce with the latest nightly snapshot of Divine but it does not seem to work any more.

Steps to reproduce:

  1. download
  2. build it using the instructions at
  3. run ninja divcc in the build directory (as divcc was not built by default)
  4. follow the instructions at

Actual result:

loading bitcode … LART … RR … constants … done
booting … done
states per second: 1000                                                   
state count: 28
mips: 1.4

error found: yes
error trace: |
  (0) Non-zero exit code: 1
  (0) FAULT: exit called with non-zero value
  [0] FATAL: unknown in userspace
  FAULT: invalid pointer passed to __vm_obj_free
  FATAL: fault handler called recursively

active stack:
  - symbol: void __dios::FaultBase::handler<__dios::Upcall<__dios::fs::VFS<__dios::ProcessManager<__dios::Fault<__dios::Scheduler<__dios::config::Base> > > > > >(_VM_Fault, _VM_Frame*, void (*)())
    location: /dios/include/dios/sys/fault.hpp:87
  - symbol: __dios_fault
    location: /dios/src/libc/sys/fault.c:14
  - symbol: _exit
    location: /dios/src/libc/sys/start.cpp:76
  - symbol: _PDCLIB_Exit
    location: /dios/src/libc/_PDCLIB/_PDCLIB_Exit.c:20
  - symbol: _Exit
    location: /dios/src/libc/stdlib/_Exit.c:18
  - symbol: exit
    location: /dios/src/libc/stdlib/exit.c:53
  - symbol: do_exit
    location: gzip.c:2102
  - symbol: abort_gzip
    location: gzip.c:2140
  - symbol: gzip_error
    location: util.c:429
  - symbol: unzip
    location: unzip.c:137
a report was written to

Note that ./gzip -f -d - < hello.gz, as well as gzip -f -d - < hello.gz, return zero exit code when invoked off Divine.

Change History (3)

comment:1 Changed 5 years ago by mornfall

Component: divccVM
Milestone: 5.04.3
Owner: changed from blurrymoi to mornfall

Turns out that gzip works OK when compiled with -O0 (i.e. ./configure CC=divcc CFLAGS=-O0). I have tracked down the problem to the VM mishandling a 'switch' instruction on a 2-bit integer that the optimizer now emits. I won't have time to fix this tomorrow, but next week should be quite doable. For now, I have added the recipe as an automated testcase so that we do not regress on this in the future.

PS: gzip-1.8-divine.diff is no longer required with recent versions of divine

comment:2 Changed 5 years ago by mornfall

Resolution: fixed
Status: newclosed

I have checked in the fix. Also turns out that LLVM codegen can't deal (on x86_64 at least) with vaarg of 'long double'. On debug builds, it triggers an assertion, on release builds, it silently generates bad code. I have added a workaround that makes the generated code fail at runtime (meaning the gzip test should pass now also with assertions enabled).

comment:3 Changed 5 years ago by Kamil Dudka

I can confirm that the problem does not occur with Thanks for the quick fix!

Note: See TracTickets for help on using tickets.