google-ar / arcore-android-sdk

ARCore SDK for Android Studio
https://developers.google.com/ar
Other
4.95k stars 1.22k forks source link

frame.acquireCameraImage().close() triggers crash #352

Closed itanbp closed 6 years ago

itanbp commented 6 years ago

Hi, I added the following code to ARCore sample app. When the app loads it Immediately crashes.

try (final Image image = frame.acquireCameraImage()) {
    if (image.getFormat() == ImageFormat.YUV_420_888) {
        image.close();
    }
} catch (NotYetAvailableException e) {
    Log.e("TAG", e.getMessage());
}

When commenting out image.close(); the app loads and works.

logs:

05-03 14:30:15.344 7001-7001/? I/zygote64: Late-enabling -Xcheck:jni
05-03 14:30:15.402 7001-7016/com.google.ar.core.examples.java.helloar D/libEGL: loaded /vendor/lib64/egl/libEGL_adreno.so
05-03 14:30:15.410 7001-7016/com.google.ar.core.examples.java.helloar D/libEGL: loaded /vendor/lib64/egl/libGLESv1_CM_adreno.so
05-03 14:30:15.422 7001-7016/com.google.ar.core.examples.java.helloar D/libEGL: loaded /vendor/lib64/egl/libGLESv2_adreno.so
05-03 14:30:15.454 7001-7001/com.google.ar.core.examples.java.helloar W/linker: "/data/app/com.google.ar.core.examples.java.helloar-2s-Jux-o44MDos9qyMHbUA==/lib/arm64/libarcore_sdk_jni.so" unused DT entry: type 0xf arg 0x20b9
05-03 14:30:15.455 7001-7001/com.google.ar.core.examples.java.helloar I/third_party/arcore/ar/core/android/sdk/session_create.cc: Entering ArSession_create
05-03 14:30:15.465 7001-7001/com.google.ar.core.examples.java.helloar I/zygote64: The ClassLoaderContext is a special shared library.
05-03 14:30:15.470 7001-7001/com.google.ar.core.examples.java.helloar W/native: commandlineflags.cc:1503 Ignoring RegisterValidateFunction() for flag pointer 0x7b9c23b1a8: no flag found at that address
05-03 14:30:15.465 7001-7001/com.google.ar.core.examples.java.helloar W/es.java.helloar: type=1400 audit(0.0:18023): avc: denied { read } for name="stat" dev="proc" ino=4026532079 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc_stat:s0 tclass=file permissive=0
05-03 14:30:15.470 7001-7001/com.google.ar.core.examples.java.helloar I/native: version_check.cc:23 ARCore Version: APK version:1.1.180312063
05-03 14:30:15.470 7001-7001/com.google.ar.core.examples.java.helloar I/native: version_check.cc:24 ARCore Version: emulated SDK version:1.1.180226000
05-03 14:30:15.471 7001-7001/com.google.ar.core.examples.java.helloar I/third_party/arcore/ar/core/android/sdk/session_create.cc: ARCore Version: SDK build name: 1.1
05-03 14:30:15.471 7001-7001/com.google.ar.core.examples.java.helloar I/third_party/arcore/ar/core/android/sdk/session_create.cc: Dynamite load ok.
05-03 14:30:15.471 7001-7001/com.google.ar.core.examples.java.helloar W/es.java.helloar: type=1400 audit(0.0:18024): avc: denied { read } for name="stat" dev="proc" ino=4026532079 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc_stat:s0 tclass=file permissive=0
05-03 14:30:15.477 7001-7001/com.google.ar.core.examples.java.helloar W/native: commandlineflags.cc:1503 Ignoring RegisterValidateFunction() for flag pointer 0x7b9c1b7068: no flag found at that address
05-03 14:30:15.479 7001-7001/com.google.ar.core.examples.java.helloar I/native: session_create_implementation.cc:527 Entering ArSession_createImplementation. ARCore SDK version: [1.1.180226000].
05-03 14:30:15.491 7001-7001/com.google.ar.core.examples.java.helloar V/third_party/redwood/base/jni_common/src/jni_helper.cc: JniHelper: about to attach thread. (Called from line 49.)
05-03 14:30:15.491 7001-7020/com.google.ar.core.examples.java.helloar V/third_party/redwood/base/jni_common/src/jni_helper.cc: JniHelper: about to attach thread. (Called from line 155.)
05-03 14:30:15.491 7001-7001/com.google.ar.core.examples.java.helloar V/third_party/redwood/base/jni_common/src/jni_helper.cc: JniHelper: thread already attached. (Called from line 49.)
05-03 14:30:15.491 7001-7001/com.google.ar.core.examples.java.helloar V/third_party/redwood/base/jni_common/src/jni_helper.cc: ~JniHelper: did not need to detach thread. (Called from line 49.)
05-03 14:30:15.491 7001-7020/com.google.ar.core.examples.java.helloar V/third_party/redwood/base/jni_common/src/jni_helper.cc: JniHelper: attached thread. (Called from line 155.)
05-03 14:30:15.492 7001-7001/com.google.ar.core.examples.java.helloar I/native: performance_manager.cc:22 Processor data: Num processors 8
                                                                                Processor type: LittleBig
                                                                                Num small cores 4
                                                                                Max frequency 1900800
                                                                                Min frequency 300000
                                                                                Small cores 0 1 2 3
                                                                                Num big cores 4
                                                                                Max frequency 2457600
                                                                                Min frequency 300000
                                                                                Big cores 4 5 6 7
05-03 14:30:15.492 7001-7001/com.google.ar.core.examples.java.helloar I/native: device_provider.cc:808 Identified device type: kWalleye
05-03 14:30:15.493 7001-7001/com.google.ar.core.examples.java.helloar I/native: feature_matching_base.cc:38 Using gyro prediction for matching.
05-03 14:30:15.494 7001-7001/com.google.ar.core.examples.java.helloar I/native: feature_matcher_bin_manager.cc:157 Neighborhood radius for feature matcher bin-grid-0 is 21.2132 pixels.
05-03 14:30:15.494 7001-7001/com.google.ar.core.examples.java.helloar I/native: feature_matcher_bin_manager.cc:157 Neighborhood radius for feature matcher bin-grid-1 is 42.4264 pixels.
05-03 14:30:15.494 7001-7001/com.google.ar.core.examples.java.helloar I/native: feature_matcher_bin_manager.cc:157 Neighborhood radius for feature matcher bin-grid-2 is 64.1467 pixels.
05-03 14:30:15.494 7001-7001/com.google.ar.core.examples.java.helloar I/native: feature_matcher_bin_manager.cc:157 Neighborhood radius for feature matcher bin-grid-3 is 99.4286 pixels.
05-03 14:30:15.494 7001-7001/com.google.ar.core.examples.java.helloar I/native: feature_matcher_bin_manager.cc:157 Neighborhood radius for feature matcher bin-grid-4 is 148.18 pixels.
05-03 14:30:15.494 7001-7001/com.google.ar.core.examples.java.helloar I/native: gyro_feature_matching.cc:20 Running tracker at 10 Hz.
05-03 14:30:15.494 7001-7001/com.google.ar.core.examples.java.helloar I/native: vio_helper.cc:48 Use calibrated IMU scale factors.
05-03 14:30:15.494 7001-7001/com.google.ar.core.examples.java.helloar I/native: vio_helper.cc:60 Use calibrated IMU misalignment factors.
05-03 14:30:15.494 7001-7001/com.google.ar.core.examples.java.helloar I/native: data_manager.cc:79 Mapping Config: 
                                                                                ViwlsConfig: 
                                                                                OnlineMappingConfig: 
                                                                                enable_online_viwls: 1
                                                                                load_online_map_in_vio: 1
                                                                                enable_lite_com: 1

                                                                                MapFormulationConfig: 
                                                                                vio_drift_tolerance_rotation: 0.05
                                                                                vio_drift_tolerance_translation: 0.2
                                                                                enable_keypoint_pruning: 1
                                                                                enable_local_map_tracking: 1
                                                                                add_every_nth_keyframe: 3

                                                                                WLS_options: 
                                                                                estimate_camera_intrinsics: 0
                                                                                estimate_imu_camera_extrinsics: 0
                                                                                estimate_imu_intrinsics: 0
                                                                                calculate_keyframe_covariance: 0
                                                                                calculate_landmark_covariance: 0
                                                                                calculate_calibration_parameters_covariance: 0
                                                                                use_huber_loss_visual_cost_term: 1
                                                                                nonlinear_optimization_type: NLWLS
                                                                                num_outlier_rejection_loops: 1
                                                                                log_viwls_state_estimates_to_file: 0
                                                                                minimize_photometric_error: 0
                                                                                fail_on_missing_inv_depth_base_keyframe: 1
                                                                                enable_lite_com: 1
                                                                                ViwlsProblemType: kMarginalizedViwls

                                                                                MapSparsifierConfig: 
                                                                                enable_debug_output: 0
                                                                                marginalize_n_keyframes: 20
                                                                                retain_n_keyframes: 5
                                                                                enable_marginalization: 1

                                                                                MapLandmarkConfig: 
                                                                                min_landmark_observations: 5
                                                                                LandmarkParam: k3DInverseDepth
                                                                                min_depth_of_pointlandmark_from_image_plane: 0.05
                                                                                max_depth_of_pointlandmark_from_image_plane: 15
                                                                                landmark_covariance_use_approximation: 1
                                                                                keypoint_pixel_sigma: 1

                                                                                Debug_options: 
                                                                                simulator_export_state_error_sigma_info: 0
                                                                                log_visual_residuals: 0
                                                                                evaluation_log_directory: 

                                                                                DataManagerConfig: 
                                                                                visualization_enabled: 0
                                                                                enable_online_calibration: 0
                                                                                log_maps_for_visualization: 0
                                                                                fisheye_buffer_size: 7
                                                                                save_map_with_uuid_as_filename: 0
                                                                                save_map_filename: 
                                                                                evaluation_log_directory: 

                                                                                MapLifeCycleConfig: 
                                                                                save_map_for_structure_relocalization: 0
                                                                                enable_multi_map_merging: 1
                                                                                max_solver_memory_for_map_split: 100

                                                                                MultiMapManagerConfig: 
                                                                                threshold_position_meters: 2
                                                                                threshold_orientation_radians: 0.174
                                                                                min_num_cross_adf_constraints: 9
                                                                                perform_full_multimap_optimization: 0
                                                                                merge_active_map_until_stable_coregistration: 1
                                                                                min_number_of_keyframes_to_add_adf: 25
05-03 14:30:15.574 7001-7001/com.google.ar.core.examples.java.helloar I/native: backend_base.h:51 LC-backend initialized.
05-03 14:30:15.601 7001-7001/com.google.ar.core.examples.java.helloar I/native: loop_detector_graph.cc:47 Initializing localizer with: loop_detector_engine: inverted_multi_index_pq
                                                                                low_power_localization: 0
                                                                                feature_descriptor: lens_invariant_ocvfreak
                                                                                override projection_matrix: 
                                                                                override quantizer: 
                                                                                override product quantizer: 
                                                                                max_num_of_image_to_image_matches: 1
                                                                                use_landmarks_for_relocalization: 0
                                                                                use_augmentation_with_previous_matches: 1
                                                                                verification_options:
                                                                                skip_bad_landmarks: 1
                                                                                overwrite_hamming_distance_threshold: -1
                                                                                min_geom_inlier_ratio: 0.35
                                                                                Ransac structure matching:
                                                                                min_num_points: 8
                                                                                max_iterations: 50
                                                                                confidence: 0.99
                                                                                sampson_error_threshold: 0.0008
                                                                                use_upright_pose_estimation: 1

                                                                                Ransac image to image matching:
                                                                                min_num_points: 8
                                                                                max_iterations: 50
                                                                                confidence: 0.99
                                                                                sampson_error_threshold: 0.0001
                                                                                use_upright_pose_estimation: 1

                                                                                compute_relative_pose_covariance: 0
                                                                                max_num_points_covariance_calc: 60
                                                                                min_match_image_time_difference: 10
                                                                                gravity_direction_threshold_degrees: 5
                                                                                matching_engine_options:
                                                                                projected_descriptor_dimensions: 16
                                                                                num_closest_words_for_nn_search: 30
                                                                                knn_search_epsilon: 2
                                                                                knn_max_radius: 100
                                                                                num_neighbors: -1
                                                                                vote_filter_type: covisibility-graph-filter
                                                                                use pose prior for image to image matching: 0
05-03 14:30:15.601 7001-7001/com.google.ar.core.examples.java.helloar I/native: session_create_implementation.cc:658 ArSession_createImplementation returning OK.
05-03 14:30:15.602 7001-7001/com.google.ar.core.examples.java.helloar I/native: session.cc:370 Entering Session::Resume.
05-03 14:30:15.602 7001-7001/com.google.ar.core.examples.java.helloar I/native: android_camera.cc:1073 Initializing camera manager.
05-03 14:30:15.603 7001-7001/com.google.ar.core.examples.java.helloar I/native: android_camera.cc:1089 Camera manager initialized successfully with 2 cameras.
05-03 14:30:15.604 7001-7001/com.google.ar.core.examples.java.helloar I/native: android_sensors.cc:52 Using uncalibrated accelerometer.
05-03 14:30:15.604 7001-7001/com.google.ar.core.examples.java.helloar I/native: android_sensors.cc:80 Starting thread.
05-03 14:30:15.605 7001-7001/com.google.ar.core.examples.java.helloar E/NdkImageReader: AImageReader_getWindow
05-03 14:30:15.605 7001-7036/com.google.ar.core.examples.java.helloar I/native: android_sensors.cc:120 Gyro min delay 2.5ms requesting 5ms
05-03 14:30:15.610 7001-7036/com.google.ar.core.examples.java.helloar I/native: android_sensors.cc:137 Accel min delay 2.5ms requesting 5ms
05-03 14:30:15.642 7001-7001/com.google.ar.core.examples.java.helloar I/native: session.cc:408 Session::Resume returning OK.
05-03 14:30:15.642 7001-7033/com.google.ar.core.examples.java.helloar I/native: cameras.cc:247 Camera changed state from 0 to 1: Camera device opened succesfully.
05-03 14:30:15.642 7001-7033/com.google.ar.core.examples.java.helloar I/native: cameras.cc:247 Camera changed state from 1 to 2: Capture session starting...
05-03 14:30:15.642 7001-7033/com.google.ar.core.examples.java.helloar I/native: cameras.cc:247 Camera changed state from 2 to 3: Capture session started streaming.
05-03 14:30:15.666 7001-7083/com.google.ar.core.examples.java.helloar D/OpenGLRenderer: HWUI GL Pipeline
05-03 14:30:15.707 7001-7083/com.google.ar.core.examples.java.helloar I/Adreno: QUALCOMM build                   : 594927b, I916dfac403
                                                                                Build Date                       : 10/11/17
                                                                                OpenGL ES Shader Compiler Version: EV031.21.02.00
                                                                                Local Branch                     : mybranch28618966
                                                                                Remote Branch                    : quic/gfx-adreno.lnx.6.4.9-rel
                                                                                Remote Branch                    : NONE
                                                                                Reconstruct Branch               : NOTHING
05-03 14:30:15.709 7001-7083/com.google.ar.core.examples.java.helloar I/Adreno: PFP: 0x005ff087, ME: 0x005ff063
05-03 14:30:15.713 7001-7083/com.google.ar.core.examples.java.helloar I/zygote64: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 1
05-03 14:30:15.714 7001-7083/com.google.ar.core.examples.java.helloar I/OpenGLRenderer: Initialized EGL, version 1.4
05-03 14:30:15.714 7001-7083/com.google.ar.core.examples.java.helloar D/OpenGLRenderer: Swap behavior 2
05-03 14:30:15.824 7001-7019/com.google.ar.core.examples.java.helloar I/native: arcore_feature_extractor_wrapper.cc:29 Extracting features using  ArcoreFeatureExtractorWrapper.
05-03 14:30:15.824 7001-7019/com.google.ar.core.examples.java.helloar I/native: arcore_feature_extractor_wrapper.cc:48 Narrow camera model.
05-03 14:30:15.847 7001-7022/com.google.ar.core.examples.java.helloar W/native: gyro_helper.cc:59 Gyro samples do not cover << [ 0 ; 1905814.18149932707 ] sec. Use identity R. Gyro samples cover [ 1905814.23272617301 ; 1905814.23272617301 ] sec.
05-03 14:30:15.847 7001-7022/com.google.ar.core.examples.java.helloar W/native: gyro_helper.cc:59 Gyro samples do not cover << [ 1905814.16534209508 ; 1905814.18149932707 ] sec. Use identity R. Gyro samples cover [ 1905814.23272617301 ; 1905814.23272617301 ] sec.
05-03 14:30:15.847 7001-7022/com.google.ar.core.examples.java.helloar W/native: gyro_helper.cc:59 Gyro samples do not cover << [ 1905814.18149932707 ; 1905814.19765655906 ] sec. Use identity R. Gyro samples cover [ 1905814.23272617301 ; 1905814.23272617301 ] sec.
05-03 14:30:15.847 7001-7022/com.google.ar.core.examples.java.helloar W/native: feature_processing.cc:152 Skipping first feature measurement because we don't have a previous to diff against.
05-03 14:30:15.848 7001-7022/com.google.ar.core.examples.java.helloar E/native: vio_initializer.cc:288 Received image measurement before corresponding IMU measurement. [1905814.181499 < 1905814.232726]
05-03 14:30:15.935 7001-7006/com.google.ar.core.examples.java.helloar I/zygote64: Do partial code cache collection, code=30KB, data=21KB
05-03 14:30:15.935 7001-7006/com.google.ar.core.examples.java.helloar I/zygote64: After code cache collection, code=30KB, data=21KB
05-03 14:30:15.935 7001-7006/com.google.ar.core.examples.java.helloar I/zygote64: Increasing code cache capacity to 128KB
05-03 14:30:15.946 7001-7023/com.google.ar.core.examples.java.helloar W/native: gyro_helper.cc:59 Gyro samples do not cover << [ 1905814.18149932707 ; 1905814.28144439496 ] sec. Use identity R. Gyro samples cover [ 1905814.23272617301 ; 1905814.32882602699 ] sec.
05-03 14:30:15.947 7001-7023/com.google.ar.core.examples.java.helloar I/native: vio_initializer.cc:645 Not accepting frame as first BA keyframe.
05-03 14:30:16.051 7001-7024/com.google.ar.core.examples.java.helloar I/native: vio_initializer.cc:645 Not accepting frame as first BA keyframe.
05-03 14:30:16.120 7001-7006/com.google.ar.core.examples.java.helloar I/zygote64: Do partial code cache collection, code=60KB, data=39KB
05-03 14:30:16.120 7001-7006/com.google.ar.core.examples.java.helloar I/zygote64: After code cache collection, code=56KB, data=38KB
05-03 14:30:16.120 7001-7006/com.google.ar.core.examples.java.helloar I/zygote64: Increasing code cache capacity to 256KB
05-03 14:30:16.149 7001-7022/com.google.ar.core.examples.java.helloar I/native: vio_initializer.cc:645 Not accepting frame as first BA keyframe.
05-03 14:30:17.149 7001-7022/com.google.ar.core.examples.java.helloar I/native: ba_initialization_helpers.cc:519 Number of landmarks before eliminating short tracks 1521, and after elimination 242
05-03 14:30:17.149 7001-7022/com.google.ar.core.examples.java.helloar I/native: ba_initialization_helpers.cc:684 num_frames_for_dsolver: 10
05-03 14:30:17.149 7001-7022/com.google.ar.core.examples.java.helloar I/native: ba_initialization_helpers.cc:685 number_of_landmarks_for_dsolver: 50
05-03 14:30:17.149 7001-7022/com.google.ar.core.examples.java.helloar I/native: ba_initialization_helpers.cc:692 maximum_cam_meas_displacement_squared: 0.00282655
05-03 14:30:17.149 7001-7022/com.google.ar.core.examples.java.helloar W/native: ba_initialization_helpers.cc:700 Maximum displacement of landmark measurements: 0.0531653
05-03 14:30:17.149 7001-7022/com.google.ar.core.examples.java.helloar W/native: ba_initialization_helpers.cc:702 Motion is close to static motion, use pure propagation to initialize small scale BA
05-03 14:30:17.149 7001-7022/com.google.ar.core.examples.java.helloar I/native: ba_initialization.cc:688 Deterministic initialization
05-03 14:30:17.154 7001-7022/com.google.ar.core.examples.java.helloar I/native: ba_initialization_helpers.cc:845 Num. landmarks before pruning 237
05-03 14:30:17.154 7001-7022/com.google.ar.core.examples.java.helloar I/native: ba_initialization_helpers.cc:846 Num. landmarks uninitialized: 5
05-03 14:30:17.154 7001-7022/com.google.ar.core.examples.java.helloar I/native: ba_initialization_helpers.cc:858 Num. landmarks initialized after pruning 60
05-03 14:30:17.154 7001-7022/com.google.ar.core.examples.java.helloar I/native: ba_initialization_helpers.cc:860 Num. landmarks uninitialized: 182
05-03 14:30:17.154 7001-7022/com.google.ar.core.examples.java.helloar I/native: ba_initialization.cc:197 Intrinsic vector size of the camera 0 is 7
05-03 14:30:17.264 7001-7022/com.google.ar.core.examples.java.helloar I/native: ba_initialization.cc:394 
                                                                                Solver Summary (v 1.13.0-eigen-(3.2.90)-no_lapack-suitesparse-(4.5.4)-no_openmp-no_tbb)

                                                                                                                     Original                  Reduced
                                                                                Parameter blocks                           83                       80
                                                                                Parameters                                234                      220
                                                                                Effective parameters                      219                      206
                                                                                Residual blocks                           621                      621
                                                                                Residuals                                1374                     1374

                                                                                Minimizer                        TRUST_REGION

                                                                                Dense linear algebra library            EIGEN
                                                                                Trust region strategy     LEVENBERG_MARQUARDT

                                                                                                                        Given                     Used
                                                                                Linear solver                     DENSE_SCHUR              DENSE_SCHUR
                                                                                Threads                                     1                        1
                                                                                Linear solver ordering              AUTOMATIC                    65,15
                                                                                Schur structure                         d,d,d                    d,d,d

                                                                                Cost:
                                                                                Initial                          5.989593e+03
                                                                                Final                            3.098907e+01
                                                                                Change                           5.958604e+03

                                                                                Minimizer iterations                       19
                                                                                Successful steps                           15
                                                                                Unsuccessful steps                          4

                                                                                Time (in seconds):
                                                                                Preprocessor                         0.001291

                                                                                  Residual only evaluation           0.020987 (18)
                                                                                  Jacobian & residual evaluation     0.030985 (15)
                                                                                  Linear solver                      0.042369 (18)
                                                                                Minimizer                            0.099048

                                                                                Postprocessor                        0.000041
                                                                                Total                                0.100381

                                                                                Termination:                   NO_CONVERGENCE (Maximum number of iterations reached. Number of iterations: 18.)
05-03 14:30:17.264 7001-7022/com.google.ar.core.examples.java.helloar I/native: ba_initialization.cc:404 Initializer did not converge: Maximum number of iterations reached. Number of iterations: 18.
05-03 14:30:17.265 7001-7022/com.google.ar.core.examples.java.helloar I/native: ba_initialization_helpers.h:187 Number of measurements used in BA initialization for temporal landmarks: 600
05-03 14:30:17.265 7001-7022/com.google.ar.core.examples.java.helloar I/native: ba_initialization_helpers.h:189 Number of good measurements (i.e., reprojection errors <= 3 pixels) in BA initialization for temporal landmarks: 600
05-03 14:30:17.269 7001-7021/com.google.ar.core.examples.java.helloar I/native: visual_inertial_filter.cc:938 VIO sliding window is initialized, with sliding window size 4
05-03 14:30:17.271 7001-7026/com.google.ar.core.examples.java.helloar E/native: motion_tracking_context.cc:524 Could not relate vio to world. redwood::NOT_FOUND: Could not retrieve pose from base to target
05-03 14:30:17.271 7001-7029/com.google.ar.core.examples.java.helloar I/native: map_manager.cc:229 VIWLS Map Manager: Updating rolling shutter time from 0.0323145 to 0.0323145
05-03 14:30:17.280 7001-7029/com.google.ar.core.examples.java.helloar I/native: visual_inertial_wls.cc:304 The number of keyframes in the current map is less than 2 keyframes. This is not a valid map right now.
05-03 14:30:17.326 7001-7018/com.google.ar.core.examples.java.helloar A/native: ref_counting.h:55 Check failed: previous > 0 (0 vs. 0) 
05-03 14:30:17.326 7001-7018/com.google.ar.core.examples.java.helloar A/native: terminating.
05-03 14:30:17.327 7001-7018/com.google.ar.core.examples.java.helloar A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 7018 (GLThread 20979), pid 7001 (es.java.helloar)
inio commented 6 years ago

That looks like it should be valid. We're investigating.

inio commented 6 years ago

We can reproduce this failure. Thank you for the report.

inio commented 6 years ago

Whoops, looks like our close() method is not idempotent, so your code:

try (final Image image = frame.acquireCameraImage()) {
    if (image.getFormat() == ImageFormat.YUV_420_888) {
        image.close();
    }
}

Will end up closing the image twice: once at the literal image.close() call and once when the try-with-resources block exits.

Remove the inner call and it should stop crashing.

itanbp commented 6 years ago

@inio thanks for the detailed answer

inio commented 6 years ago

Sounds like this is resolved. Feel free to reopen if I'm not reading your response correctly.

fredsa commented 6 years ago

Image.close() is now idempotent, as of version 1.3.0.