BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005894 [buildroot] Architecture Specific crash always 10-31-08 08:23 10-31-08 08:23
Reporter pviney View Status public  
Assigned To buildroot
Priority normal Resolution open  
Status assigned   Product Version 0.9.27
Summary 0005894: JamVM Major Bug + patch
Description JamVM crashes when background threads are used with an InvalidMonitorStateException. Doing pretty much anything that uses synchronization in any way crashes the jvm. The problem is not in JamVM but in the avr32 patches.

The following program crashes:

import java.io.*;
import java.net.*;

public class TestS {
  public static void main(String args[]) {
    new Thread() {
      public void run() {
        testConnect();
      }
    }.start();
  }

  private static void testConnect() {
    try {
      System.out.println("Try connect");
      Socket s = new Socket("127.0.0.1",2000); //crashes here with an invalid
monitor exception: thread not owner (lock.c notifyAll)
      System.out.println("connected!");
    } catch (Exception e) {
      e.printStackTrace();
    }
    System.out.println("exiting");
    System.exit(0);
  }
}

This crash is caused by a bug in the COMPARE_AND_SWAP macro in src/arch/avr32.h
Additional Information Index: buildroot/package/java/jamvm/jamvm-1.5.0.patch.avr32
===================================================================
--- buildroot/package/java/jamvm/jamvm-1.5.0.patch.avr32 (revision 23881)
+++ buildroot/package/java/jamvm/jamvm-1.5.0.patch.avr32 (working copy)
@@ -53,7 +53,7 @@
 diff -urpN jamvm-1.5.0/src/arch/avr32.h jamvm-1.5.0-avr32/src/arch/avr32.h
 --- jamvm-1.5.0/src/arch/avr32.h 1970-01-01 01:00:00.000000000 +0100
 +++ jamvm-1.5.0-avr32/src/arch/avr32.h 2008-02-08 09:20:41.000000000 +0100
-@@ -0,0 +1,109 @@
+@@ -0,0 +1,110 @@
 +/*
 + * Copyright (C) 2003, 2004, 2005, 2006, 2007
 + * Robert Lougher <rob@lougher.org.uk>.
@@ -128,17 +128,18 @@
 +// printf("compare and swap %d %d %s:line %d\n",old_val,new_val,__FILE__,__LINE__);
 +#define COMPARE_AND_SWAP(addr, old_val, new_val) \
 +({ \
-+ int result; \
++ int tmp, result=0; \
 + __asm__ __volatile__ (" \
 + 1: ssrf 5; \
-+ ld.w %[ret], %[m]; \
-+ cp.w %[ret], %[old]; \
++ ld.w %[tmp], %[m]; \
++ cp.w %[tmp], %[old]; \
 + brne 2f; \
 + stcond %[m], %[new]; \
 + brne 1b; \
++ mov %[ret], 1; \
 + 2:" \
-+ : [ret] "=&r" (result), [m] "=m" (*addr) \
-+ : "m" (*addr), [old] "r" (old_val), [new] "r" (new_val) \
++ : [tmp] "=&r" (tmp), [ret] "=&r" (result), [m] "=m" (*addr) \
++ : "m" (*addr), [old] "ir" (old_val), [new] "r" (new_val) \
 + : "memory", "cc"); \
 + result; \
 +})
Attached Files  patch [^] (1,556 bytes) 10-31-08 08:23

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
10-31-08 08:23 pviney New Issue
10-31-08 08:23 pviney Status new => assigned
10-31-08 08:23 pviney Assigned To  => buildroot
10-31-08 08:23 pviney File Added: patch


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker