Why a Java 8 compiler does not generate (bytecode) anonymous classes for method references? [duplicate] - reflection

Loop.times(5, () -> {
System.out.println("looping");
});
Which of these would it effectively compile to?
for(int i = 0; i < 5; i++)
System.out.println("looping");
or something like
new CallableInterfaceImpl(){
public void call(){
for(int i = 0; i < 5; i++)
System.out.println("looping");
}
}.call();
So would it replace (kind of inline), or actually create an anonymous class?

The VM decides how to implement lambda, not a compiler.
See Translation strategy section in Translation of Lambda Expressions.
Instead of generating bytecode to create the object that implements the lambda expression (such as calling a constructor for an inner class), we describe a recipe for constructing the lambda, and delegate the actual construction to the language runtime. That recipe is encoded in the static and dynamic argument lists of an invokedynamic instruction.
for construction from your example is most effective way in terms of simple compiling or perfomance (but the performance differences are very small, by the tests).
Addon:
I created and disassemble two examples:
for (String string: Arrays.asList("hello")) {
System.out.println(string);
}
Disassembled bytecode, constants and other information:
Classfile LambdaCode.class
Last modified 30.05.2013; size 771 bytes
MD5 checksum 79bf2821b5a14485934e5cebb60c99d6
Compiled from "LambdaCode.java"
public class test.lambda.LambdaCode
SourceFile: "LambdaCode.java"
minor version: 0
major version: 52
flags: ACC_PUBLIC, ACC_SUPER
Constant pool:
#1 = Methodref #11.#22 // java/lang/Object."<init>":()V
#2 = Class #23 // java/lang/String
#3 = String #24 // hello
#4 = Methodref #25.#26 // java/util/Arrays.asList:([Ljava/lang/Object;)Ljava/util/List;
#5 = InterfaceMethodref #27.#28 // java/util/List.iterator:()Ljava/util/Iterator;
#6 = InterfaceMethodref #29.#30 // java/util/Iterator.hasNext:()Z
#7 = InterfaceMethodref #29.#31 // java/util/Iterator.next:()Ljava/lang/Object;
#8 = Fieldref #32.#33 // java/lang/System.out:Ljava/io/PrintStream;
#9 = Methodref #34.#35 // java/io/PrintStream.println:(Ljava/lang/String;)V
#10 = Class #36 // test/lambda/LambdaCode
#11 = Class #37 // java/lang/Object
#12 = Utf8 <init>
#13 = Utf8 ()V
#14 = Utf8 Code
#15 = Utf8 LineNumberTable
#16 = Utf8 main
#17 = Utf8 ([Ljava/lang/String;)V
#18 = Utf8 StackMapTable
#19 = Class #38 // java/util/Iterator
#20 = Utf8 SourceFile
#21 = Utf8 LambdaCode.java
#22 = NameAndType #12:#13 // "<init>":()V
#23 = Utf8 java/lang/String
#24 = Utf8 hello
#25 = Class #39 // java/util/Arrays
#26 = NameAndType #40:#41 // asList:([Ljava/lang/Object;)Ljava/util/List;
#27 = Class #42 // java/util/List
#28 = NameAndType #43:#44 // iterator:()Ljava/util/Iterator;
#29 = Class #38 // java/util/Iterator
#30 = NameAndType #45:#46 // hasNext:()Z
#31 = NameAndType #47:#48 // next:()Ljava/lang/Object;
#32 = Class #49 // java/lang/System
#33 = NameAndType #50:#51 // out:Ljava/io/PrintStream;
#34 = Class #52 // java/io/PrintStream
#35 = NameAndType #53:#54 // println:(Ljava/lang/String;)V
#36 = Utf8 test/lambda/LambdaCode
#37 = Utf8 java/lang/Object
#38 = Utf8 java/util/Iterator
#39 = Utf8 java/util/Arrays
#40 = Utf8 asList
#41 = Utf8 ([Ljava/lang/Object;)Ljava/util/List;
#42 = Utf8 java/util/List
#43 = Utf8 iterator
#44 = Utf8 ()Ljava/util/Iterator;
#45 = Utf8 hasNext
#46 = Utf8 ()Z
#47 = Utf8 next
#48 = Utf8 ()Ljava/lang/Object;
#49 = Utf8 java/lang/System
#50 = Utf8 out
#51 = Utf8 Ljava/io/PrintStream;
#52 = Utf8 java/io/PrintStream
#53 = Utf8 println
#54 = Utf8 (Ljava/lang/String;)V
{
public test.lambda.LambdaCode();
descriptor: ()V
flags: ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: return
LineNumberTable:
line 15: 0
public static void main(java.lang.String[]);
descriptor: ([Ljava/lang/String;)V
flags: ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=3, args_size=1
0: iconst_1
1: anewarray #2 // class java/lang/String
4: dup
5: iconst_0
6: ldc #3 // String hello
8: aastore
9: invokestatic #4 // Method java/util/Arrays.asList:([Ljava/lang/Object;)Ljava/util/List;
12: invokeinterface #5, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
17: astore_1
18: aload_1
19: invokeinterface #6, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z
24: ifeq 47
27: aload_1
28: invokeinterface #7, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
33: checkcast #2 // class java/lang/String
36: astore_2
37: getstatic #8 // Field java/lang/System.out:Ljava/io/PrintStream;
40: aload_2
41: invokevirtual #9 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
44: goto 18
47: return
LineNumberTable:
line 35: 0
line 36: 37
line 37: 44
line 38: 47
StackMapTable: number_of_entries = 2
frame_type = 252 /* append */
offset_delta = 18
locals = [ class java/util/Iterator ]
frame_type = 250 /* chop */
offset_delta = 28
}
and
Arrays.asList("hello").forEach(p -> {System.out.println(p);});
Disassembled bytecode, constants and other information:
Classfile LambdaCode.class
Last modified 30.05.2013; size 1262 bytes
MD5 checksum 4804e0a37b73141d5791cc39d51d649c
Compiled from "LambdaCode.java"
public class test.lambda.LambdaCode
SourceFile: "LambdaCode.java"
InnerClasses:
public static final #64= #63 of #70; //Lookup=class java/lang/invoke/MethodHandles$Lookup of class java/lang/invoke/MethodHandles
BootstrapMethods:
0: #27 invokestatic java/lang/invoke/LambdaMetafactory.metaFactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
Method arguments:
#28 invokeinterface java/util/function/Consumer.accept:(Ljava/lang/Object;)V
#29 invokestatic test/lambda/LambdaCode.lambda$0:(Ljava/lang/String;)V
#30 (Ljava/lang/String;)V
minor version: 0
major version: 52
flags: ACC_PUBLIC, ACC_SUPER
Constant pool:
#1 = Methodref #10.#21 // java/lang/Object."<init>":()V
#2 = Class #22 // java/lang/String
#3 = String #23 // hello
#4 = Methodref #24.#25 // java/util/Arrays.asList:([Ljava/lang/Object;)Ljava/util/List;
#5 = InvokeDynamic #0:#31 // #0:lambda$:()Ljava/util/function/Consumer;
#6 = InterfaceMethodref #32.#33 // java/util/List.forEach:(Ljava/util/function/Consumer;)V
#7 = Fieldref #34.#35 // java/lang/System.out:Ljava/io/PrintStream;
#8 = Methodref #36.#37 // java/io/PrintStream.println:(Ljava/lang/String;)V
#9 = Class #38 // test/lambda/LambdaCode
#10 = Class #39 // java/lang/Object
#11 = Utf8 <init>
#12 = Utf8 ()V
#13 = Utf8 Code
#14 = Utf8 LineNumberTable
#15 = Utf8 main
#16 = Utf8 ([Ljava/lang/String;)V
#17 = Utf8 lambda$0
#18 = Utf8 (Ljava/lang/String;)V
#19 = Utf8 SourceFile
#20 = Utf8 LambdaCode.java
#21 = NameAndType #11:#12 // "<init>":()V
#22 = Utf8 java/lang/String
#23 = Utf8 hello
#24 = Class #40 // java/util/Arrays
#25 = NameAndType #41:#42 // asList:([Ljava/lang/Object;)Ljava/util/List;
#26 = Utf8 BootstrapMethods
#27 = MethodHandle #6:#43 // invokestatic java/lang/invoke/LambdaMetafactory.metaFactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
#28 = MethodHandle #9:#44 // invokeinterface java/util/function/Consumer.accept:(Ljava/lang/Object;)V
#29 = MethodHandle #6:#45 // invokestatic test/lambda/LambdaCode.lambda$0:(Ljava/lang/String;)V
#30 = MethodType #18 // (Ljava/lang/String;)V
#31 = NameAndType #46:#47 // lambda$:()Ljava/util/function/Consumer;
#32 = Class #48 // java/util/List
#33 = NameAndType #49:#50 // forEach:(Ljava/util/function/Consumer;)V
#34 = Class #51 // java/lang/System
#35 = NameAndType #52:#53 // out:Ljava/io/PrintStream;
#36 = Class #54 // java/io/PrintStream
#37 = NameAndType #55:#18 // println:(Ljava/lang/String;)V
#38 = Utf8 test/lambda/LambdaCode
#39 = Utf8 java/lang/Object
#40 = Utf8 java/util/Arrays
#41 = Utf8 asList
#42 = Utf8 ([Ljava/lang/Object;)Ljava/util/List;
#43 = Methodref #56.#57 // java/lang/invoke/LambdaMetafactory.metaFactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
#44 = InterfaceMethodref #58.#59 // java/util/function/Consumer.accept:(Ljava/lang/Object;)V
#45 = Methodref #9.#60 // test/lambda/LambdaCode.lambda$0:(Ljava/lang/String;)V
#46 = Utf8 lambda$
#47 = Utf8 ()Ljava/util/function/Consumer;
#48 = Utf8 java/util/List
#49 = Utf8 forEach
#50 = Utf8 (Ljava/util/function/Consumer;)V
#51 = Utf8 java/lang/System
#52 = Utf8 out
#53 = Utf8 Ljava/io/PrintStream;
#54 = Utf8 java/io/PrintStream
#55 = Utf8 println
#56 = Class #61 // java/lang/invoke/LambdaMetafactory
#57 = NameAndType #62:#66 // metaFactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
#58 = Class #67 // java/util/function/Consumer
#59 = NameAndType #68:#69 // accept:(Ljava/lang/Object;)V
#60 = NameAndType #17:#18 // lambda$0:(Ljava/lang/String;)V
#61 = Utf8 java/lang/invoke/LambdaMetafactory
#62 = Utf8 metaFactory
#63 = Class #71 // java/lang/invoke/MethodHandles$Lookup
#64 = Utf8 Lookup
#65 = Utf8 InnerClasses
#66 = Utf8 (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
#67 = Utf8 java/util/function/Consumer
#68 = Utf8 accept
#69 = Utf8 (Ljava/lang/Object;)V
#70 = Class #72 // java/lang/invoke/MethodHandles
#71 = Utf8 java/lang/invoke/MethodHandles$Lookup
#72 = Utf8 java/lang/invoke/MethodHandles
{
public test.lambda.LambdaCode();
descriptor: ()V
flags: ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: return
LineNumberTable:
line 15: 0
public static void main(java.lang.String[]);
descriptor: ([Ljava/lang/String;)V
flags: ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=1, args_size=1
0: iconst_1
1: anewarray #2 // class java/lang/String
4: dup
5: iconst_0
6: ldc #3 // String hello
8: aastore
9: invokestatic #4 // Method java/util/Arrays.asList:([Ljava/lang/Object;)Ljava/util/List;
12: invokedynamic #5, 0 // InvokeDynamic #0:lambda$:()Ljava/util/function/Consumer;
17: invokeinterface #6, 2 // InterfaceMethod java/util/List.forEach:(Ljava/util/function/Consumer;)V
22: return
LineNumberTable:
line 28: 0
line 38: 22
}
Compiler generated class-file is more complicated and larger (771b vs 1262b) for Lambda example.

Java compiler will generate synthetic methods for the code construct that is neither explicitly nor implicitly declared.
As we are aware, lambda expression/function is an anonymous class method implementation for abstract method in functional interface and if we see the byte code of a compiled class file with lambda expression, Instead of creating a new object that will wrap the Lambda function, it uses the new INVOKEDYNAMIC instruction to dynamically link this call site to the actual Lambda function which is converted to private static synthetic lambda$0(Ljava/lang/String;)V which will accept string as a parameter.
private static synthetic lambda$0(Ljava/lang/String;)V
GETSTAIC java/lang/System.out: Ljava/io/PrintStream;
ALOAD 0
INVOKEVIRTUAL java/io/PrintStream.println(Ljava/lang/String;)V
RETURN
Example: list.forEach(x-> System.out.println(x));
This lambda expression x-> System.out.println(x) is converted to private static synthetic block as mentioned above. But how this will be invoked for each element in the list when we run java Class? Refer the below byte code of lambda expression linkage as forEach accepts Consumer functional interface object.
INVOKEDYNAMIC accept()Ljava/util/function/Consumer;
[
java/lang/invoke/LambdaMetaFactory.metafactory(Ljava/lang/invokeMethodHandler$Lookup.Ljava/lang/invoke/CallSite..
//arguments
(Ljava/lang/Object;)V
//INVOKESTATIC
com/<Classname>.lambda$)(Ljava/lang/String;)V,
(Ljava/lang/String;)V
]
java.lang.invoke.LambdaMetaFactory: This class provides two forms of linkage methods:
A standard version (metafactory(MethodHandles.Lookup, String, MethodType, MethodType, MethodHandle, MethodType)) using an optimized protocol,
An alternate version altMetafactory(MethodHandles.Lookup, String, MethodType, Object...)).
These linkage methods are designed to support the evaluation of lambda expressions and method references in the Java Language.
For every lambda expressions or method reference in the source code, there is a target type which is a functional interface.
Evaluating a lambda expression produces an object of its target type. The recommended mechanism for evaluating lambda expressions is to desugar the lambda body to a method, invoke an invokedynamic call site whose static argument list describes the sole method of the functional interface and the desugared implementation method, and returns an object (the lambda object) that implements the target type.
Note(For method references, the implementation method is simply the referenced method; no desugaring is needed.)

Related

Am having a problem while adding new user to my worpress website

Am getting the below error while trying to add new user to my word press website
Fatal error: Uncaught Error: Call to undefined function PHPMailer\PHPMailer\mail() in /home/dshopcok/public_html/wp-includes/PHPMailer/PHPMailer.php:874 Stack trace: #0 /home/dshopcok/public_html/wp-includes/PHPMailer/PHPMailer.php(1945): PHPMailer\PHPMailer\PHPMailer->mailPassthru('albertrex410#gm...', '[demarxs] New U...', 'New user regist...', 'Date: Sun, 19 F...', NULL) #1 /home/dshopcok/public_html/wp-includes/PHPMailer/PHPMailer.php(1666): PHPMailer\PHPMailer\PHPMailer->mailSend('Date: Sun, 19 F...', 'New user regist...') #2 /home/dshopcok/public_html/wp-includes/PHPMailer/PHPMailer.php(1502): PHPMailer\PHPMailer\PHPMailer->postSend() #3 /home/dshopcok/public_html/wp-includes/pluggable.php(542): PHPMailer\PHPMailer\PHPMailer->send() #4 /home/dshopcok/public_html/wp-includes/pluggable.php(2159): wp_mail(Array, '[demarxs] New U...', 'New user regist...', Array) #5 /home/dshopcok/public_html/wp-includes/user.php(3439): wp_new_user_notification(11, NULL, 'admin') #6 /home/dshopcok/public_html/wp-includes/class-wp-hook.php(308): wp_send_new_user_notifications(11, 'admin') #7 /home/dshopcok/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array) #8 /home/dshopcok/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #9 /home/dshopcok/public_html/wp-admin/includes/user.php(241): do_action('edit_user_creat...', 11, 'admin') #10 /home/dshopcok/public_html/wp-admin/user-new.php(195): edit_user() #11 {main} thrown in /home/dshopcok/public_html/wp-includes/PHPMailer/PHPMailer.php on line 874
** please help what could be the problem**
Am not sure of the way to fix it

WordPress call to a member function get_error_codes() on null error

WordPress returns an error on the line where I call get_error_codes():
add_filter( 'login_errors', function( $error ) {
global $errors;
//var_dump($errors);
$err_codes = $errors->get_error_codes();
$error = 'Message here.';
return $error;
});
Here is the full error message:
Fatal error: Uncaught Error: Call to a member function get_error_codes() on null in /app/www/wp-content/themes/shoptheme/functions.php:1065
Stack trace:
#0 /app/www/wp-includes/class-wp-hook.php(307): {closure}('<strong>Error</...')
#1 /app/www/wp-includes/plugin.php(191): WP_Hook->apply_filters('<strong>Error</...', Array)
#2 /app/www/wp-content/plugins/woocommerce/includes/class-wc-form-handler.php(983): apply_filters('login_errors', '<strong>Error</...')
#3 /app/www/wp-includes/class-wp-hook.php(307): WC_Form_Handler::process_login('')
#4 /app/www/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
#5 /app/www/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
#6 /app/www/wp-settings.php(620): do_action('wp_loaded')
#7 /app/www/wp-config.php(111): require_once('/app/www/wp-set...')
#8 /app/www/wp-load.php(50): require_once('/app/www/wp-con...')
#9 /app/www/wp-blog-header.php(13): require_once('/app/www/wp-loa...')
#10 /app/www/index.php(17): require('/app/www/wp-blo...')
#11 {main}
thrown in /app/www/wp-content/themes/shoptheme/functions.php on line 1065
I am trying to understand what is happening here. Is the WooCommerce apply_filters on 'login_errors' not allowing me to do this?

Address Sanitizer on a python extension result in AddressSanitizer:DEADLYSIGNAL

c source code as below:
#include<stdlib.h>
#include<stdio.h>
#include "demo_c.h"
void func(data_pair* pair) {
printf("func called");
pair->len=4;
pair->data = (char*)malloc(pair->len + 1);
memset(pair->data, 0, pair->len + 1);
memcpy(pair->data, "test", 4);
return;
}
gcc -fpic -c demo_c.c -fno-omit-frame-pointer -fsanitize=address -fsanitize-recover=address
gcc --share demo_c.o -o libdemo_c.so
then I import this library in python like this:
from ctypes import *
demo_c = CDLL('/xxx/libdemo_c.so', RTLD_GLOBAL)
libc = CDLL('libc.so.6')
libc.free.argtypes = [c_void_p]
class entry(Structure):
_fields_ = [('len',c_int),
('data', c_void_p)]
v = entry()
demo_c.func.argtypes = [c_void_p]
demo_c.func(byref(v))
libc.free(v.data)
then I run:
LD_PRELOAD=/lib64/libasan.so.5 python demo.py
output is:
AddressSanitizer:DEADLYSIGNAL
=================================================================
==432489==ERROR: AddressSanitizer: BUS on unknown address 0x000000000000 (pc 0x7f281c9c90fe bp 0x200000000000003 sp 0x7ffe0c369b20 T0)
#0 0x7f281c9c90fd in _int_free (/lib64/libc.so.6+0x810fd)
#1 0x7f281356cdcb in ffi_call_unix64 (/lib64/libffi.so.6+0x5dcb)
#2 0x7f281356c6f4 in ffi_call (/lib64/libffi.so.6+0x56f4)
#3 0x7f281377fc6a in _ctypes_callproc (/usr/lib64/python2.7/lib-dynload/_ctypes.so+0x10c6a)
#4 0x7f2813779a64 (/usr/lib64/python2.7/lib-dynload/_ctypes.so+0xaa64)
#5 0x7f281d687072 in PyObject_Call (/lib64/libpython2.7.so.1.0+0x4c072)
#6 0x7f281d71b845 in PyEval_EvalFrameEx (/lib64/libpython2.7.so.1.0+0xe0845)
#7 0x7f281d72264c in PyEval_EvalCodeEx (/lib64/libpython2.7.so.1.0+0xe764c)
#8 0x7f281d722751 in PyEval_EvalCode (/lib64/libpython2.7.so.1.0+0xe7751)
#9 0x7f281d73bb8e (/lib64/libpython2.7.so.1.0+0x100b8e)
#10 0x7f281d73cd5d in PyRun_FileExFlags (/lib64/libpython2.7.so.1.0+0x101d5d)
#11 0x7f281d73dfe8 in PyRun_SimpleFileExFlags (/lib64/libpython2.7.so.1.0+0x102fe8)
#12 0x7f281d74f19e in Py_Main (/lib64/libpython2.7.so.1.0+0x11419e)
#13 0x7f281c96a554 in __libc_start_main (/lib64/libc.so.6+0x22554)
#14 0x40068d (/usr/bin/python2.7+0x40068d)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: BUS (/lib64/libc.so.6+0x810fd) in _int_free
==432489==ABORTING
But if I wrap libc.so's free in demo_c.c and call it instead of directly calling free directly in python code, it works fine.
Problem is that you allocate your memory with Asan's malloc and later try to release it with libc's free. This is not going to work as different allocators are generally incompatible.

Drupal reports "The website encountered an unexpected error. Please try again later"

When I login to the backend of my site and I click either the content tab or the people tab I get the error "The website encountered an unexpected error. Please try again later". I have not altered any core code on the site just the frontend theme. My thinking is that Drupal needs updating to the latest version as it is currently on 8.2.5 and some of the plugins are not up-to-date.
I tried updating Drupal and the site crashed, I have also updated a couple of modules but 2 of them wouldn't update and they were: https://www.drupal.org/project/metatag or https://www.drupal.org/project/twig_extender.
Here is the PHP error message:
TypeError: Argument 2 passed to Drupal\views\Entity\Render\EntityFieldRenderer::render() must be an instance of Drupal\views\Plugin\views\field\Field, instance of Drupal\views\Plugin\views\field\EntityField given, called in /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/modules/views/src/Plugin/views/field/EntityField.php on line 809 in Drupal\views\Entity\Render\EntityFieldRenderer->render() (line 120 of /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/modules/views/src/Entity/Render/EntityFieldRenderer.php)
#0 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/modules/views/src/Plugin/views/field/EntityField.php(809): Drupal\views\Entity\Render\EntityFieldRenderer->render(Object(Drupal\views\ResultRow), Object(Drupal\views\Plugin\views\field\EntityField))
#1 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/modules/views/src/Plugin/views/field/FieldPluginBase.php(1137): Drupal\views\Plugin\views\field\EntityField->getItems(Object(Drupal\views\ResultRow))
#2 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/modules/views/views.theme.inc(224): Drupal\views\Plugin\views\field\FieldPluginBase->advancedRender(Object(Drupal\views\ResultRow))
#3 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/lib/Drupal/Core/Theme/ThemeManager.php(287): template_preprocess_views_view_field(Array, 'views_view_fiel...', Array)
#4 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/lib/Drupal/Core/Render/Renderer.php(435): Drupal\Core\Theme\ThemeManager->render('views_view_fiel...', Array)
#5 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\Core\Render\Renderer->doRender(Array, false)
#6 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/modules/views/src/Plugin/views/field/FieldPluginBase.php(1736): Drupal\Core\Render\Renderer->render(Array)
#7 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/modules/views/src/Plugin/views/style/StylePluginBase.php(765): Drupal\views\Plugin\views\field\FieldPluginBase->theme(Object(Drupal\views\ResultRow))
#8 [internal function]: Drupal\views\Plugin\views\style\StylePluginBase->elementPreRenderRow(Array)
#9 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/lib/Drupal/Core/Render/Renderer.php(376): call_user_func(Array, Array)
#10 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\Core\Render\Renderer->doRender(Array, false)
#11 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/modules/views/src/Plugin/views/style/StylePluginBase.php(713): Drupal\Core\Render\Renderer->render(Array)
#12 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/modules/views/src/Plugin/views/style/StylePluginBase.php(580): Drupal\views\Plugin\views\style\StylePluginBase->renderFields(Array)
#13 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/modules/views/src/Plugin/views/style/StylePluginBase.php(466): Drupal\views\Plugin\views\style\StylePluginBase->renderGrouping(Array, Array, true)
#14 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(2117): Drupal\views\Plugin\views\style\StylePluginBase->render(Array)
#15 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/modules/views/src/ViewExecutable.php(1520): Drupal\views\Plugin\views\display\DisplayPluginBase->render()
#16 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/modules/views/src/Plugin/views/display/Page.php(171): Drupal\views\ViewExecutable->render()
#17 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/modules/views/src/ViewExecutable.php(1617): Drupal\views\Plugin\views\display\Page->execute()
#18 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/modules/views/src/Element/View.php(78): Drupal\views\ViewExecutable->executeDisplay('page_1', Array)
#19 [internal function]: Drupal\views\Element\View::preRenderViewElement(Array)
#20 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/lib/Drupal/Core/Render/Renderer.php(376): call_user_func(Array, Array)
#21 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\Core\Render\Renderer->doRender(Array, false)
#22 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(226): Drupal\Core\Render\Renderer->render(Array, false)
#23 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/lib/Drupal/Core/Render/Renderer.php(574): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
#24 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(227): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#25 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(117): Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch))
#26 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch))
#27 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#28 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/vendor/symfony/http-kernel/HttpKernel.php(144): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent))
#29 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/vendor/symfony/http-kernel/HttpKernel.php(62): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#30 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#32 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#33 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#34 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#35 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#36 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#37 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/core/lib/Drupal/Core/DrupalKernel.php(652): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#38 /srv/bindings/786d3e8414d9428c9683501ffa37adf3/code/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#39 {main}.
It seems you have issue with Drupal core updates.
The problem is this:
Argument 2 passed to Drupal\views\Entity\Render\EntityFieldRenderer::render() must be an instance of Drupal\views\Plugin\views\field\Field, instance of Drupal\views\Plugin\views\field\EntityField given
That plugin got renamed from Field to EntityField. See #2408667: Rename Field.php to EntityField.php. But that only got committed to 8.3.x, so something seems to have gone wrong during your update to 8.2.5. Some shuffling between 8.3 and 8.2? Can you try running the update again?
Take a look here for details: https://www.drupal.org/node/2848227

Error when closing Qt app on dev computer, not reported elsewhere

I am hoping that someone can shed some light on the issue I am experiencing. Our application is crashing when it is exited. This is the error I see in gdb.
Catchpoint 1 (exception thrown)
__cxa_throw (obj=0x19c1f388, tinfo=0xc450f8, dest=0)
at ../../../../gcc-4.4.0/libstdc++-v3/libsupc++/unwind-cxx.h:234
234 ../../../../gcc-4.4.0/libstdc++-v3/libsupc++/unwind-cxx.h: No such file
or directory.
in ../../../../gcc-4.4.0/libstdc++-v3/libsupc++/unwind-cxx.h
Current language: auto; currently c++
I am using Qt Creator 2.4.1 using the built in "Qt 4.8.1 for Desktop MinGw (Qt SDK)" libs.
Any help would be appreciated. I feel that this is an issue with GCC 4.4 as there have been a few quirks with it.
EDIT Backtrace
(gdb) bt
#0 __cxa_throw (obj=0x199ed1e8, tinfo=0xc450f8, dest=0)
at ../../../../gcc-4.4.0/libstdc++-v3/libsupc++/unwind-cxx.h:234
#1 0x007594fd in boost::this_thread::interruptible_wait ()
#2 0x007de101 in boost::detail::basic_cv_list_entry::wait (this=0x1a3fbdf8,
abs_time=
{start = 0, milliseconds = 18446744073709551615, relative = true, abs_time
= {<boost::date_time::base_time<boost::posix_time::ptime, boost::date_time::cou
nted_time_system<boost::date_time::counted_time_rep<boost::posix_time::millisec_
posix_time_system_config> > >> = {<boost::less_than_comparable<boost::posix_time
::ptime, boost::equality_comparable<boost::posix_time::ptime, boost::posix_time:
:ptime, boost::detail::empty_base<boost::posix_time::ptime>, boost::detail::fals
e_t>, boost::detail::empty_base<boost::posix_time::ptime>, boost::detail::true_t
>> = {<boost::less_than_comparable1<boost::posix_time::ptime, boost::equality_co
mparable<boost::posix_time::ptime, boost::posix_time::ptime, boost::detail::empt
y_base<boost::posix_time::ptime>, boost::detail::false_t> >> = {<boost::equality
_comparable<boost::posix_time::ptime, boost::posix_time::ptime, boost::detail::e
mpty_base<boost::posix_time::ptime>, boost::detail::false_t>> = {<boost::equalit
y_comparable1<boost::posix_time::ptime, boost::detail::empty_base<boost::posix_t
ime::ptime> >> = {<boost::detail::empty_base<boost::posix_time::ptime>> = {<No d
ata fields>}, <No data fields>}, <No data fields>}, <No data fields>}, <No data
fields>}, time_ = {time_count_ = {value_ = 9223372036854775806}}}, <No data fiel
ds>}, static max_non_infinite_wait = 4294967294})
at c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../include/boost/thr
ead/win32/condition_variable.hpp:94
#3 0x007dfbeb in boost::detail::basic_condition_variable::do_wait<boost::unique
_lock<boost::mutex> > (this=0xda81b0, lock=#0x15b1fe7c, abs_time=
{start = 0, milliseconds = 18446744073709551615, relative = true, abs_time
= {<boost::date_time::base_time<boost::posix_time::ptime, boost::date_time::cou
nted_time_system<boost::date_time::counted_time_rep<boost::posix_time::millisec_
posix_time_system_config> > >> = {<boost::less_than_comparable<boost::posix_time
::ptime, boost::equality_comparable<boost::posix_time::ptime, boost::posix_time:
:ptime, boost::detail::empty_base<boost::posix_time::ptime>, boost::detail::fals
e_t>, boost::detail::empty_base<boost::posix_time::ptime>, boost::detail::true_t
>> = {<boost::less_than_comparable1<boost::posix_time::ptime, boost::equality_co
mparable<boost::posix_time::ptime, boost::posix_time::ptime, boost::detail::empt
y_base<boost::posix_time::ptime>, boost::detail::false_t> >> = {<boost::equality
_comparable<boost::posix_time::ptime, boost::posix_time::ptime, boost::detail::e
mpty_base<boost::posix_time::ptime>, boost::detail::false_t>> = {<boost::equalit
y_comparable1<boost::posix_time::ptime, boost::detail::empty_base<boost::posix_t
ime::ptime> >> = {<boost::detail::empty_base<boost::posix_time::ptime>> = {<No d
ata fields>}, <No data fields>}, <No data fields>}, <No data fields>}, <No data
fields>}, time_ = {time_count_ = {value_ = 9223372036854775806}}}, <No data fiel
ds>}, static max_non_infinite_wait = 4294967294})
at c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../include/boost/thr
ead/win32/condition_variable.hpp:228
#4 0x007c5867 in boost::condition_variable::wait (this=0xda81b0,
m=#0x15b1fe7c)
at c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../include/boost/thr
ead/win32/condition_variable.hpp:318
#5 0x007769c8 in CCheckQueue<CScriptCheck>::Loop (this=0xda81a8,
fMaster=false) at ../Feathercoin-0.8.5/src/checkqueue.h:93
#6 0x00776cd1 in CCheckQueue<CScriptCheck>::Thread (this=0xda81a8)
at ../Feathercoin-0.8.5/src/checkqueue.h:127
#7 0x0043933f in ThreadScriptCheck ()
at ../Feathercoin-0.8.5/src/main.cpp:1657
#8 0x007d8546 in boost::detail::thread_data<void (*)()>::run (this=0x7a27140)
at c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../include/boost/thr
ead/detail/thread.hpp:117
#9 0x00758bf0 in boost::(anonymous namespace)::thread_start_function ()
#10 0x00757996 in boost::(anonymous namespace)::ThreadProxy ()
#11 0x76d0336a in KERNEL32!BaseCleanupAppcompatCacheSupport ()
from C:\Windows\syswow64\kernel32.dll
#12 0x151e2e50 in ?? ()
#13 0x15b1ffd4 in ?? ()
#14 0x77a39f72 in ntdll!RtlpNtSetValueKey ()
from C:\Windows\system32\ntdll.dll
#15 0x151e2e50 in ?? ()
#16 0x6f8b48f8 in ?? ()
#17 0x00000000 in ?? ()

Resources