filament: Android Filament update from 1.8.1 to 1.9.2 causes Fatal signal 11 (SIGSEGV) when setting irradiance

Describe the bug This code causes a SIGSEGV when updating dependencies to Filament 1.9.2.

Commenting it out prevents the crash.
        // setting irradiance crashes
        filament.scene.indirectLight = IndirectLight
            .Builder()
            .irradiance(
                3,
                frame.lightEstimate.environmentalHdrAmbientSphericalHarmonics
                    .let { getEnvironmentalHdrSphericalHarmonics(it) }
            )
            .build(filament.engine)

To Reproduce Sample code to reproduce crash is available here: https://github.com/zirman/arcore-filament-example-app/tree/irradience

Expected behavior N/A

Screenshots N/A

Desktop (please complete the following information): N/A

Smartphone (please complete the following information):

  • Device: Pixel 3
  • OS: Android 11

Additional context

2020-09-29 13:11:03.002 7647-7647/com.example.app W/com.example.ap: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
2020-09-29 13:11:03.071 7647-7647/com.example.app I/AdrenoGLES-0: QUALCOMM build                   : c9bef8a, Ie73904e3bd
    Build Date                       : 06/26/20
    OpenGL ES Shader Compiler Version: EV031.31.04.00
    Local Branch                     : gfx-adreno.lnx.2.0
    Remote Branch                    : quic/gfx-adreno.lnx.2.0
    Remote Branch                    : NONE
    Reconstruct Branch               : NOTHING
2020-09-29 13:11:03.071 7647-7647/com.example.app I/AdrenoGLES-0: Build Config                     : C P 11.0.1 AArch64
2020-09-29 13:11:03.071 7647-7647/com.example.app I/AdrenoGLES-0: Driver Path                      : /vendor/lib64/egl/libGLESv2_adreno.so
2020-09-29 13:11:03.082 7647-7647/com.example.app I/AdrenoGLES-0: PFP: 0x016ee189, ME: 0x00000000
2020-09-29 13:11:03.085 7647-7647/com.example.app W/AdrenoUtils: <ReadGpuID_from_sysfs:197>: Failed to open /sys/class/kgsl/kgsl-3d0/gpu_model
2020-09-29 13:11:03.085 7647-7647/com.example.app W/AdrenoUtils: <ReadGpuID:221>: Failed to read chip ID from gpu_model. Fallback to use the GSL path
2020-09-29 13:11:03.122 7647-7647/com.example.app I/third_party/arcore/ar/core/android/sdk/session_create.cc: Entering ArSession_createWithFeatures
2020-09-29 13:11:03.122 7647-7647/com.example.app I/third_party/arcore/ar/core/android/sdk/session_create.cc: ARCore Version: SDK build name: 1.19
2020-09-29 13:11:03.124 7647-7647/com.example.app I/third_party/arcore/ar/core/android/sdk/session_create.cc: ARCore Version: APK version code: 202550203
2020-09-29 13:11:03.133 7647-7647/com.example.app D/ApplicationLoaders: Returning zygote-cached class loader: /system/framework/android.test.base.jar
2020-09-29 13:11:03.173 7647-7647/com.example.app I/third_party/arcore/ar/core/android/sdk/session_create.cc: Dynamite load ok.
2020-09-29 13:11:03.174 7647-7647/com.example.app I/third_party/arcore/java/com/google/vr/dynamite/client/native/dynamite_client.cc: Attempting to load native library arcore_c from package com.google.ar.core
2020-09-29 13:11:03.203 7647-7647/com.example.app I/third_party/arcore/java/com/google/vr/dynamite/client/native/dynamite_client.cc: Dynamite::LoadNativeRemoteLibrary handle=3270391885326583399
2020-09-29 13:11:03.204 7647-7647/com.example.app I/third_party/arcore/ar/core/android/sdk/session_create.cc: ARCore SDK: dynamite number_of_symbols_loaded=206
2020-09-29 13:11:03.204 7647-7647/com.example.app I/native: session_create_implementation.cc:194 Entering createImplementationWithFeaturesAndSettings. ARCore SDK version: [1.19.201750000].
2020-09-29 13:11:03.212 7647-7676/com.example.app V/third_party/redwood/infrastructure/jni_common/jni_helper.cc: JniHelper: attached thread (Called from line 363).
2020-09-29 13:11:03.222 7647-7647/com.example.app I/native: session_create_implementation_shared.cc:2076 Persistent online recalibration is enabled by Phenotype.
2020-09-29 13:11:03.225 7647-7647/com.example.app I/tflite: Initialized TensorFlow Lite runtime.
2020-09-29 13:11:03.225 7647-7647/com.example.app I/native: online_calibration_manager.cc:90 OnlineCalibrationManager: Could not open /data/user/0/com.example.app/cache/arcore-online-recalibration for reading.
2020-09-29 13:11:03.251 7647-7647/com.example.app W/ARCore-ContextUtils: The API key for use with the Google AR service could not be obtained!
2020-09-29 13:11:03.276 7647-7647/com.example.app I/native: session_create_implementation_shared.cc:904 Datasource will be created with timeout = 4s, should_wait = false, should_use_greedy_recovery = true
2020-09-29 13:11:03.276 7647-7647/com.example.app I/native: android_camera.cc:168 Camera start operation timeout set to 4000 ms.
2020-09-29 13:11:03.276 7647-7647/com.example.app I/native: android_camera.cc:1823 Initializing camera manager.
2020-09-29 13:11:03.289 7647-7647/com.example.app I/native: android_camera.cc:1849 Camera manager initialized successfully with 4 cameras.
2020-09-29 13:11:03.289 7647-7647/com.example.app I/native: session_create_implementation_shared.cc:1085 Datasource will be created with should_use_cameras_async = true
2020-09-29 13:11:03.291 7647-7647/com.example.app I/native: android_sensors.cc:95 Using uncalibrated accelerometer.
2020-09-29 13:11:03.291 7647-7647/com.example.app I/native: android_sensors.cc:123 Found IMU temperature sensor.
2020-09-29 13:11:03.291 7647-7647/com.example.app I/native: android_sensors.cc:133 Using uncalibrated magnetometer.
2020-09-29 13:11:03.291 7647-7647/com.example.app I/native: android_sensors.cc:148 Using SENSOR_TYPE_LIGHT
2020-09-29 13:11:03.291 7647-7647/com.example.app I/native: android_sensors.cc:148 Using SENSOR_TYPE_PRESSURE
2020-09-29 13:11:03.291 7647-7647/com.example.app I/native: android_sensors.cc:148 Using SENSOR_TYPE_PROXIMITY
2020-09-29 13:11:03.291 7647-7647/com.example.app I/native: android_sensors.cc:148 Using SENSOR_TYPE_GRAVITY
2020-09-29 13:11:03.291 7647-7647/com.example.app I/native: android_sensors.cc:148 Using SENSOR_TYPE_ROTATION_VECTOR
2020-09-29 13:11:03.292 7647-7647/com.example.app I/native: android_sensors.cc:148 Using SENSOR_TYPE_GAME_ROTATION_VECTOR
2020-09-29 13:11:03.292 7647-7647/com.example.app I/native: android_sensors.cc:148 Using SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR
2020-09-29 13:11:03.292 7647-7647/com.example.app I/native: android_sensors.cc:148 Using SENSOR_TYPE_STEP_DETECTOR
2020-09-29 13:11:03.293 7647-7647/com.example.app I/native: android_platform_checks.cc:194 IsZeroRotationLandscape = false
2020-09-29 13:11:03.293 7647-7647/com.example.app I/native: create_pursuit_tracker.cc:20 AugmentedRegion downsample mode from Phenotype: false
2020-09-29 13:11:03.294 7647-7647/com.example.app I/native: app_version_util.cc:50 Package name: com.google.ar.core App version: 1.20.202550203
2020-09-29 13:11:03.294 7647-7647/com.example.app I/native: logger.h:28 DataSourceMetrics: CamerasInit: 41.875us
2020-09-29 13:11:03.294 7647-7647/com.example.app I/native: session_create_implementation_shared.cc:1228 CPU Image enable frame delay to compensate delay: false
2020-09-29 13:11:03.303 7647-7647/com.example.app I/native: config_helpers.cc:396 Legacy IMU sigma values are used
2020-09-29 13:11:03.303 7647-7647/com.example.app I/native: config_helpers.cc:349 Failed to find IMU intrinsic covariance matrix in profile for id: 100
2020-09-29 13:11:03.303 7647-7647/com.example.app I/native: config_helpers.cc:107 Does not find camera intrinsic covariance matrix in profile for id 0
2020-09-29 13:11:03.303 7647-7647/com.example.app I/native: config_helpers.cc:180 Does not find extrinsic covariance matrix in profile for IMU id 100
2020-09-29 13:11:03.304 7647-7647/com.example.app I/native: feature_matcher_and_filter.cc:91 Enabled the robustification to large-sized and fast-moving objects on this mono-camera device.
2020-09-29 13:11:03.307 7647-7647/com.example.app I/native: pose_confidence_estimator.cc:220 Pose confidence model loaded successfully
2020-09-29 13:11:03.381 7647-7647/com.example.app I/native: asset_manager_util.cc:59 Created global reference to asset manager.
2020-09-29 13:11:03.381 7647-7647/com.example.app I/native: session_create_implementation_shared.cc:1255 Normal detector created.
2020-09-29 13:11:03.404 7647-7647/com.example.app I/native: planar_target_tracking_manager.h:114 Config of PlanarTargetTrackingManager:
    -pose_refinement_with_detection_interval_ns: 0
    -min_interval_between_detections_ns: 500000000
    -filter_parallax: false
    -filter_result: true
    -multiple_targets: true
    -mini_detection: true
    -tracking_mode: 1
    -camera_id: 0
2020-09-29 13:11:03.412 7647-7647/com.example.app E/native: camera_config_manager.cc:750 UpdateBugFixes on CameraConfigManager is unimplemented!
2020-09-29 13:11:03.412 7647-7647/com.example.app W/com.example.ap: Accessing hidden method Landroid/media/Image;-><init>()V (greylist, linking, allowed)
2020-09-29 13:11:03.413 7647-7647/com.example.app I/third_party/arcore/ar/core/android/sdk/arimage_jni.cc: Loading AImage symbols
2020-09-29 13:11:03.414 7647-7647/com.example.app I/third_party/arcore/ar/core/android/sdk/image_metadata_jni.cc: Loading ACameraMetadata symbols
2020-09-29 13:11:03.418 7647-7647/com.example.app I/native: session.cc:480 Session::CheckAndWriteCurrentConfig returning OK.
2020-09-29 13:11:03.439 7647-7647/com.example.app I/Filament: FEngine (64 bits) created at 0x7728be3040 (threading is enabled)
2020-09-29 13:11:03.440 7647-7715/com.example.app D/Filament: Using ASurfaceTexture
2020-09-29 13:11:03.440 7647-7715/com.example.app D/Filament: FEngine resolved backend: OpenGL
2020-09-29 13:11:03.518 7647-7647/com.example.app I/native: session.cc:1081 Entering Session::Resume.
2020-09-29 13:11:03.519 7647-7647/com.example.app E/native: camera_config_manager.cc:750 UpdateBugFixes on CameraConfigManager is unimplemented!
2020-09-29 13:11:03.539 7647-7647/com.example.app I/CameraManagerGlobal: Connecting to camera service
2020-09-29 13:11:03.548 7647-7647/com.example.app I/native: android_sensors.cc:170 Starting thread.
2020-09-29 13:11:03.549 7647-7687/com.example.app I/native: android_camera.cc:762 [Camera=0; State=CLOSED] Reset cleanly got to CLOSED state.
2020-09-29 13:11:03.549 7647-7647/com.example.app I/native: cameras.cc:1142 Included camera stream {camera_id = "0", stream_index = 0} as feature extraction streams.
2020-09-29 13:11:03.549 7647-7647/com.example.app I/native: logger.h:28 DataSourceMetrics: kStartImageSubSystem: 1.064844ms
2020-09-29 13:11:03.549 7647-7647/com.example.app I/native: session.cc:1241 Session::ResumeWithAnalytics returning OK.
2020-09-29 13:11:03.550 7647-7722/com.example.app I/native: android_sensors.cc:43 Gyro min delay 2.5ms requesting 5ms
2020-09-29 13:11:03.579 7647-7722/com.example.app I/native: android_sensors.cc:43 Accel min delay 2.5ms requesting 5ms
2020-09-29 13:11:03.587 7647-7722/com.example.app I/native: android_sensors.cc:43 IMU Temperature min delay 200ms requesting 200ms
2020-09-29 13:11:03.600 7647-7670/com.example.app I/Gralloc4: mapper 4.x is not supported
2020-09-29 13:11:03.601 7647-7670/com.example.app W/Gralloc3: mapper 3.x is not supported
2020-09-29 13:11:03.609 7647-7670/com.example.app E/libc: Access denied finding property "vendor.gralloc.disable_ahardware_buffer"
2020-09-29 13:11:03.648 7647-7687/com.example.app I/native: logger.h:28 CameraMetrics: OpenCamera: 89.981884ms
2020-09-29 13:11:03.650 7647-7687/com.example.app I/native: camera_ndk_wrapper.cc:25 Loading Android NDK 28 symbols from libcamera2ndk.so
2020-09-29 13:11:03.651 7647-7687/com.example.app I/native: camera_ndk_wrapper.cc:45 Successfully loaded Android NDK 28 libcamera2ndk.so symbols.
2020-09-29 13:11:03.981 7647-7687/com.example.app I/native: logger.h:28 CameraMetrics: CreateCaptureSession: 330.649617ms
2020-09-29 13:11:03.983 7647-7687/com.example.app I/native: capture_request_utils.cc:142 This device does not support auto focus. Using fixed focus instead.
2020-09-29 13:11:03.983 7647-7687/com.example.app I/native: capture_request_utils.cc:206 Flash: ConfigureRequestFlashMode - OFF
2020-09-29 13:11:03.983 7647-7679/com.example.app I/native: cameras.cc:1313 Camera 0 changed state CLOSED->OPEN; Camera device opened successfully. i=0
2020-09-29 13:11:03.984 7647-7679/com.example.app I/native: cameras.cc:1313 Camera 0 changed state OPEN->CAPTURING; Started capture session. i=1
2020-09-29 13:11:03.984 7647-7687/com.example.app I/native: logger.h:28 DataSourceMetrics: kFirstGlCallback: 435.700356ms
2020-09-29 13:11:04.203 7647-7666/com.example.app W/Gralloc4: allocator 3.x is not supported
2020-09-29 13:11:04.204 7647-7666/com.example.app W/Gralloc3: allocator 3.x is not supported
2020-09-29 13:11:04.284 7647-7728/com.example.app I/native: logger.h:28 CameraMetrics: FirstCaptureComplete: 300.915707ms
2020-09-29 13:11:04.295 7647-7723/com.example.app I/native: timebase_helpers.cc:169 Timebase offset intialized to 0
2020-09-29 13:11:04.295 7647-7723/com.example.app I/native: logger.h:28 DataSourceMetrics: kFirstImageCallback: 747.137887ms
2020-09-29 13:11:04.309 7647-7701/com.example.app W/native: feature_matcher_and_filter_utils.cc:249 INVALID_ARGUMENT: integration window start at 0 Use identity R.
    
    
    --------- beginning of crash
2020-09-29 13:11:04.349 7647-7647/com.example.app A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8 in tid 7647 (com.example.app), pid 7647 (com.example.app)
2020-09-29 13:11:04.723 7647-7698/com.example.app I/native: bundle_adjustment_initializer.cc:591 Deterministic initialization
2020-09-29 13:11:04.738 7647-7698/com.example.app I/native: bundle_adjustment_initializer.cc:171 Intrinsic vector size of the camera 0 is 7
2020-09-29 13:11:04.762 7647-7698/com.example.app I/native: bundle_adjustment_initializer.cc:360 Initializer did not converge: Maximum number of iterations reached. Number of iterations: 18.
2020-09-29 13:11:04.762 7647-7698/com.example.app I/native: ba_initialization_helpers.h:164 Number of measurements used in BA initialization for temporal landmarks: 300
2020-09-29 13:11:04.763 7647-7698/com.example.app I/native: ba_initialization_helpers.h:166 Number of good measurements (i.e., reprojection errors <= 3 pixels) in BA initialization for temporal landmarks: 299
2020-09-29 13:11:04.776 7647-7707/com.example.app E/libc: Access denied finding property "ro.hardware.chipname"

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 23 (7 by maintainers)

Most upvoted comments

@zirman Yes, it’s actually fairly easy, you just need to create the cubemap texture and then call Texture.generatePrefilterMipmap(). This will do what cmgen does, except at runtime.

@prideout

I think https://github.com/google/filament/commit/732a6c08dea774379d8d092050c35fe4b977b03a is the offending commit.

mReflectionsTexture is uninitialized in IndirectLight.h and is only set if the indirect light is initialized with a reflection map (here). If no reflection map is provided, we dereference an invalid pointer when we do FIndirectLight::getReflectionHwHandle.

I can fix it by initializing mReflectionsTexture, but I’m not sure what getReflectionHwHandle should return if mReflectionsTexture is null.

Interesting. I’ll take a closer look