0

I can't figure out what went wrong ! I'm trying to run a simple sockets comunication. I'm using Eclipse Mars 2 and by the way, it cashes and quits in debug mode and when I try to run Junit tests ! I don't know why !

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x739ac3e1, pid=2144, tid=0x0000182c
#
# JRE version: Java(TM) SE Runtime Environment (8.0_111-b14) (build 1.8.0_111-b14)
# Java VM: Java HotSpot(TM) Client VM (25.111-b14 mixed mode, sharing windows-x86 )
# Problematic frame:
# C  [chtbrkg.dll+0x1c3e1]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\User.ASUS\Documents\eclipse\workspace\Sockets\hs_err_pid2144.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

I get the error message above on the server, and a java.util.NoSuchElementException on the client ! precisely when I try to get the result from the server ( temp = scanner2.nextInt(); in Client.java )

Server class

package main;

import java.io.IOException;
import java.io.PrintStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Scanner;

public class Server {

public static void main(String[] args) throws IOException {
    ServerSocket serverSocket = new ServerSocket(1234);
    System.out.println("Waiting for the client...");
    Socket socket = serverSocket.accept();
    System.out.println("Client connected");
    Scanner scanner = new Scanner(socket.getInputStream());
    int number = scanner.nextInt();
    int temp = number * 2;
    PrintStream printStream = new PrintStream(socket.getOutputStream());
    printStream.println(temp);
}

}

Client class

package main;

import java.io.IOException;
import java.io.PrintStream;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.Scanner;

public class Client {

public static void main(String[] args) throws UnknownHostException, IOException {
    int number, temp = 0;
    Scanner scanner = new Scanner(System.in);   // to read input from user
    Socket socket = new Socket("127.0.0.1", 1234);
    Scanner scanner2 = new Scanner(socket.getInputStream());    // used to accept results from the server
    System.out.println("Enter any number");
    number = scanner.nextInt();
    PrintStream printStream = new PrintStream(socket.getOutputStream());
    printStream.println(number);    // send the number to the server
    temp = scanner2.nextInt();
    System.out.println(temp);
}

}
Stoufa
  • 23
  • 7

1 Answers1

0

The crash has happened inside chtbrkg.dll library, which does not belong to Java or Eclipse Mars or Windows. I don't really know what chtbrkg.dll is (googling suggests it is a part of AdSkip software), but this is apparently a problem of third party software on your PC.

apangin
  • 92,924
  • 10
  • 193
  • 247
  • I'm a beginner, can you tell me how to proceed in order to solve this problem ? how can I find the software using `chtbrkg.dll` ? – Stoufa Dec 09 '16 at 21:55
  • Reinstalling the JDK and the .dll file didn't worked ! I get the same error message ! EXCEPTION_ACCESS_VIOLATION on the server and java.util.NoSuchElementException on the client. – Stoufa Dec 10 '16 at 09:47
  • Uninstall the software apangin mentioned – the8472 Dec 10 '16 at 14:00
  • @the8472 I don't have this type of software and I even scanned the computer using an anti-malware software but the problem persist ! – Stoufa Dec 10 '16 at 18:30
  • 1
    Then you will have to identify which software this dll belongs to. I think https://superuser.com is a better place for that. – the8472 Dec 10 '16 at 18:55
  • It does look like some virus chtbrkg.dll here is the details - http://greatis.com/blog/how-to/remove-uninstall-chtbrkg-dll-virus.htm – Fairoz Dec 14 '16 at 09:34
  • @Fairoz Thanks a lot :) My problem is solved ! chtbrkg.dll was used by a malicious hidden service ! – Stoufa Dec 18 '16 at 16:04