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

Support for logging on unix like systems from the console. #7

Closed
SvenKirschbaum opened this issue Jul 26, 2014 · 20 comments
Closed

Support for logging on unix like systems from the console. #7

SvenKirschbaum opened this issue Jul 26, 2014 · 20 comments

Comments

@SvenKirschbaum
Copy link

I would like to see this

@kwhat
Copy link
Owner

kwhat commented Jul 27, 2014

ill see what I can compile.

@kwhat
Copy link
Owner

kwhat commented Jul 29, 2014

Ok, so what arm arch are you trying to run on? v6, v7? Hardfloat? Raspberry Pi?

@SvenKirschbaum
Copy link
Author

It´s an Raspberry Pi

root@raspberrypi ~ # uname -a
Linux raspberrypi 3.12.22+ #691 PREEMPT Wed Jun 18 18:29:58 BST 2014 armv6l GNU/Linux

@kwhat
Copy link
Owner

kwhat commented Jul 29, 2014

Can you grab the following two java properties from your jvm:

System.getProperty("os.name");
System.getProperty("os.arch");

@SvenKirschbaum
Copy link
Author

root@raspberrypi ~ # java test
Linux
arm

@kwhat
Copy link
Owner

kwhat commented Jul 29, 2014

Well that makes things really interesting. I need a way to tell what version of the arm processor I am dealing with from Java. Is this the openjdk or oracle? I was hoping os.arch would be closer to armv6 or armv6j. Does os.version, java.vendor or java.version have anything arch identifying? Also how much do you know about compiling for arm? I am interested in how the oracle jrm is arm v6/v7, does -
march=armv6j support both?

@kwhat
Copy link
Owner

kwhat commented Jul 29, 2014

I think I may have a solution, it may take a day or two.

@kwhat
Copy link
Owner

kwhat commented Aug 4, 2014

Try this binary out: https://drive.google.com/file/d/0BzIKwDqIyYGkVEt1a3RZTUtoakE/edit?usp=sharing

Its untested but it will hopefully work with armv6j. Sorry about google drive, but apparently I cant attach binary files to github bugs.

@kwhat
Copy link
Owner

kwhat commented Aug 13, 2014

Were you able to test the attached zip?

@reinaldo-rda
Copy link

I tested the attached file but returned the error, you can check please?

Error:
A fatal error has been detected by the Java Runtime Environment:
SIGSEGV (0xb) at pc=0xa8c3097c, pid=2647, tid=3058250864
JRE version: Java(TM) SE Runtime Environment (7.0_40-b43) (build 1.7.0_40-b43)
Java VM: Java HotSpot(TM) Client VM (24.0-b56 mixed mode linux-arm )
Problematic frame:
C [libX11.so.6+0x7f97c] XkbGetAutoRepeatRate+0x8
Core dump written. Default location: /home/pi/PIBalanca/core or core.2647
If you would like to submit a bug report, please visit:
http://bugreport.sun.com/bugreport/crash.jsp
The crash happened outside the Java Virtual Machine in native code.
See problematic frame for where to report the bug.

@kwhat
Copy link
Owner

kwhat commented Aug 14, 2014

Hmm, I tested last night and it seemed to run fine for me on RASPBIAN Wheezy. What arm chip are you using? Are you able to compile from source? Do you have the complete dump available?

@reinaldo-rda
Copy link

I tried starting the code does not compile, but I can try, just do not have much experience in native code, you can pass me the commands to compile?

dump:
https://drive.google.com/file/d/0B9twwkwCwI6GekVDTWRwbDFwLWc/edit?usp=sharing

Chip:
/proc/cpuinfo:
processor : 0
model name : ARMv6-compatible processor rev 7 (v6l)
Features : swp half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7

@kwhat
Copy link
Owner

kwhat commented Aug 14, 2014

Depending on your distribution you will probably need -dev packages for libXt libX11 libXtst. You wil also need autotools, autoreconf, and ant. You can build a working jar with ant compile jar from the project root.

Does the jar produce any console output? The problematic line is likely: https://github.com/kwhat/libuiohook/blob/f1f2de864c9d5ae55e40fb273b90cf960ddf6d16/src/x11/system_properties.c#L54 I am wondering if XOpenDisplay failed?

@reinaldo-rda
Copy link

console output:

JNativeHook: Global keyboard and mouse hooking for Java.
Copyright (C) 2006-2014 Alexander Barker. All Rights Received.
https://github.com/kwhat/jnativehook/

JNativeHook is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

JNativeHook is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see http://www.gnu.org/licenses/.

  • A fatal error has been detected by the Java Runtime Environment:
    *
  • SIGSEGV (0xb) at pc=0xa896b97c, pid=3992, tid=3058087024
  • JRE version: Java(TM) SE Runtime Environment (7.0_40-b43) (build 1.7.0_40-b43)
  • Java VM: Java HotSpot(TM) Client VM (24.0-b56 mixed mode linux-arm )
  • Problematic frame:
  • C [libX11.so.6+0x7f97c] XkbGetAutoRepeatRate+0x8
    *
  • Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
    *
  • An error report file with more information is saved as:
  • /home/pi/PIBalanca/hs_err_pid3992.log
    *
  • If you would like to submit a bug report, please visit:
  • http://bugreport.sun.com/bugreport/crash.jsp

@reinaldo-rda
Copy link

I'm not working with desktop, only via console, can it be the cause of XOpenDisplay failed?

@kwhat
Copy link
Owner

kwhat commented Aug 14, 2014

oh yes! It requires and active X11 session to function, although there should be a check(s) for XOpenDisplay failures to avoid segfaults. I would probably need to use the kernel event interface or evdev. I am not sure what kind of permission workaround are going to be needed. Some more info: https://kernel.googlesource.com/pub/scm/linux/kernel/git/legion/kbd/+/2.0.2/src/dumpkeys.c
https://www.kernel.org/doc/Documentation/input/input.txt
http://www.osdever.net/bkerndev/Docs/keyboard.htm
http://www.freedesktop.org/software/libevdev/doc/latest/

I will fix the issue with the XOpenDisplay segfaults, but its going to be a while before I can even take a look at supporting console input. Your free to hack around on your own. Any amount of information gathering helps.

@kwhat kwhat changed the title Support for ARM architecture Support for logging on unix like systems from the console. Aug 14, 2014
@kwhat
Copy link
Owner

kwhat commented Aug 26, 2014

Hey, So I stumbled on this project while digging around on github: https://github.com/xoeye/evdev-java/compare/progman32:master...master

It should do close to what you need until I can integrate full evdev support.

@reinaldo-rda
Copy link

Thanks for the help, I tried to use but returned the error below, know how to solve?

EventDevice: System: arm
EventDevice: libPath: /NATIVE/arm/libevdev-java.so
EventDevice: in: sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream@147e0ec

. A fatal error has been detected by the Java Runtime Environment:
.
. SIGILL (0x4) at pc=0xb42cb640, pid=3068, tid=3058209904
.
. JRE version: Java(TM) SE Runtime Environment (7.0_40-b43) (build 1.7.0_40-b43)
. Java VM: Java HotSpot(TM) Client VM (24.0-b56 mixed mode linux-arm )
. Problematic frame:
. C [libevdev-java6629126383018815710.so+0x640] call_gmon_start+0x7
.
. Core dump written. Default location: /home/pi/c/evdev/core or core.3068
.
. An error report file with more information is saved as:
. /home/pi/c/evdev/hs_err_pid3068.log

Detail:
https://drive.google.com/file/d/0B9twwkwCwI6GaFBzQXlzcGg3WFE/edit?usp=sharing

@kwhat
Copy link
Owner

kwhat commented Aug 26, 2014

My best guess, the binary you are using, the one packaged with the repo, was compiled with gprof support but your system doesn't have some dependency it needs. Try recompile the binary src without the -pg flag.

@kwhat
Copy link
Owner

kwhat commented Sep 28, 2021

This should be working at this point, please open a new bug if it is still an issue.

@kwhat kwhat closed this as completed Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants