Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix BeagleBoardBlack error "java: free(): invalid next size (fast): " when use interrupt handler (Button listener) #96

Open
igor-suhorukov opened this issue Sep 27, 2016 · 3 comments
Assignees

Comments

@igor-suhorukov
Copy link

igor-suhorukov commented Sep 27, 2016

When program use Interrupt handler on BeagleBoardBlack native code exception is occured

Java program:
String pinName = args[0];
Board board = Platform.createBoard();
DigitalInput isClose = board.getPin(pinName).as(DigitalInput.class);

    Button button = new Button(isClose, io.silverspoon.bulldog.core.Signal.Low);
    button.addListener(new ButtonListener() {

        @Override
        public void buttonPressed() {
            System.out.println("PRESSED");
        }

        @Override
        public void buttonReleased() {
            System.out.println("RELEASED");
        }
    });

    for(int i=0; i<100; i++){
        System.out.println(isClose.read().getNumericValue());
        Thread.sleep(300);
    }

    Thread.sleep(20000);
    System.out.println("DONE");

machinekit@beaglebone:~$ uname -a

Linux beaglebone 3.8.13-xenomai-r79 #1 Wed Jun 15 20:40:46 UTC 2016 armv7l GNU/Linux

Oracle jdk-8u101-linux-arm32-vfp-hflt

OUTPUT...

0
0
0

*** glibc detected *** /home/machinekit/jdk1.8.0_101//bin/java: free(): invalid next size (fast): 0x001a2d58 ***

@igor-suhorukov
Copy link
Author

igor-suhorukov commented Oct 17, 2016

The same error on debian BeagleBoard.org Debian Image 2015-03-01

uname -a
Linux beaglebone 3.8.13-bone70 #1 SMP Fri Jan 23 02:15:42 UTC 2015 armv7l GNU/Linux


root@beaglebone:/home/debian# gpio-bbb-1.0-SNAPSHOT/bin/launcher.sh P9_18
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
-- listing properties --
beagleboneblack.emmc.enabled=true
beagleboneblack.hdmi.enabled=true
beagleboneblack.dogtag=BeagleBoard.org Debian Image 2015-03-01

iolib_setdir: PortSet_ptr P9.18
0
*** glibc detected *** /home/debian/jdk1.8.0_101//bin/java: malloc(): memory corruption (fast): 0x001e30b8 ***
Aborted

@igor-suhorukov
Copy link
Author

*** glibc detected *** /home/debian/jdk1.8.0_101//bin/java: munmap_chunk(): invalid pointer: 0x00269b68 ***
Aborted

@ZenoFuturista
Copy link

Hello all,
I faced the same issue on my Beaglebone black and found a workaround, so I would like to let you know of my findings. Versions of my software:
uname -a
Linux alarm 4.8.5-1-ARCH #1 Sat Oct 29 20:34:37 MDT 2016 armv7l GNU/Linux

java -version
openjdk version "1.8.0_112"
OpenJDK Runtime Environment (build 1.8.0_112-b15)
OpenJDK Zero VM (build 25.112-b15, interpreted mode)

So, at the beggining I was using crosscompiled version of Bulldog from my desktop PC (arm gcc 6.1.1) and I was facing similar errors when attaching interrupt listeners to Input GPIOS. From what I saw, the problems came from Bulldog natives. Afterwards I tried and recompiled Bulldog on the Beaglebone itself (gcc 6.2.1) and the problem went away. Could it be that there is some mismatch in headers?
I hope this could point you out to successfull solution.
Have a nice days.
Jan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants