question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Xcode pauses inside JavaScriptCore when using the Chrome debugger

See original GitHub issue

I’m experimenting with realm and react native. I have the following RN code:

/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View
} from 'react-native';


var Realm = require('realm');

// Define your models and their properties
class Car {}
Car.schema = {
	name: 'Car',
	properties: {
		make:  'string',
		model: 'string',
		miles: 'int',
	}
};
class Person {}
Person.schema = {
	name: 'Person',
	properties: {
		name:    {type: 'string'},
		cars:    {type: 'list', objectType: 'Car'},
		picture: {type: 'data', optional: true}, // optional property
        birthday: {type: 'date'}
	}
};


Realm.Sync.User.login('http://localhost:9080', 'dd', 'xxxx', (error, user) => { console.log(error, user) });

export default class realmDBtest extends Component {

	constructor(props) {
		super(props);

		let user = Realm.Sync.User.current;

		this.realm = new Realm({
            schema: [Car, Person],
			sync: {
				user: user,
				url: 'realm://localhost:9080/~/cars',
			},
		});

		this.realm.addListener('change', () => {
			this.forceUpdate()
		});
	}

  render() {
	  let cars = this.realm.objects('Car').filtered('miles > 1000');


	  var carsOutput = cars.map(el => {
	    return (
	        <View>
              <Text>{el.make} - {el.model} - {el.miles}</Text>
            </View>
        )
      });

	  return (
      <View style={styles.container}>
          {carsOutput}
          <Text onPress={() => {
			  this.realm.write(() => {
                  let myCar = this.realm.create('Car', {
                      make: 'Honda',
                      model: 'Civic',
                      miles: 2000,
                  });
                  myCar.miles += 20; // Update a property value
              });
            }
          }>Add car </Text>

        <Text onPress={() => {
			console.log(this.realm.syncSession);
			}}>log session</Text>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
});

AppRegistry.registerComponent('realmDBtest', () => realmDBtest);

When I use the app for no apparent reason the app stalls and xcode is showing the following:

JavaScriptCore`JSC::Heap::releaseAccessSlow:
    0x108b62110 <+0>:   pushq  %rbp
    0x108b62111 <+1>:   movq   %rsp, %rbp
    0x108b62114 <+4>:   pushq  %r14
    0x108b62116 <+6>:   pushq  %rbx
    0x108b62117 <+7>:   movq   %rdi, %r14
    0x108b6211a <+10>:  movl   0x488(%r14), %eax
    0x108b62121 <+17>:  testb  $0x4, %al
    0x108b62123 <+19>:  je     0x108b62182               ; <+114>
    0x108b62125 <+21>:  leaq   0x488(%r14), %rbx
    0x108b6212c <+28>:  nopl   (%rax)
    0x108b62130 <+32>:  testb  $0x2, %al
    0x108b62132 <+34>:  jne    0x108b62194               ; <+132>
    0x108b62134 <+36>:  movl   %eax, %ecx
    0x108b62136 <+38>:  testb  $0x10, %al
    0x108b62138 <+40>:  jne    0x108b62150               ; <+64>
    0x108b6213a <+42>:  testb  $0x1, %al
    0x108b6213c <+44>:  jne    0x108b62170               ; <+96>
    0x108b6213e <+46>:  andl   $-0x5, %ecx
    0x108b62141 <+49>:  lock   
    0x108b62142 <+50>:  cmpxchgl %ecx, (%rbx)
    0x108b62145 <+53>:  jne    0x108b6217c               ; <+108>
    0x108b62147 <+55>:  jmp    0x108b62183               ; <+115>
    0x108b62149 <+57>:  nopl   (%rax)
    0x108b62150 <+64>:  andl   $-0x11, %ecx
    0x108b62153 <+67>:  lock   
    0x108b62154 <+68>:  cmpxchgl %ecx, (%rbx)
    0x108b62157 <+71>:  jne    0x108b6217c               ; <+108>
    0x108b62159 <+73>:  movq   %r14, %rdi
    0x108b6215c <+76>:  callq  0x108b621a0               ; JSC::Heap::finalize()
    0x108b62161 <+81>:  movq   %rbx, %rdi
    0x108b62164 <+84>:  callq  0x108fa08a0               ; WTF::ParkingLot::unparkAll(void const*)
    0x108b62169 <+89>:  jmp    0x108b6217c               ; <+108>
    0x108b6216b <+91>:  nopl   (%rax,%rax)
    0x108b62170 <+96>:  andl   $-0x7, %ecx
    0x108b62173 <+99>:  orl    $0x2, %ecx
    0x108b62176 <+102>: lock   
    0x108b62177 <+103>: cmpxchgl %ecx, (%rbx)
    0x108b6217a <+106>: je     0x108b62188               ; <+120>
    0x108b6217c <+108>: movl   (%rbx), %eax
    0x108b6217e <+110>: testb  $0x4, %al
    0x108b62180 <+112>: jne    0x108b62130               ; <+32>
    0x108b62182 <+114>: int3   
->  **0x108b62183 <+115>: popq   %rbx**
    0x108b62184 <+116>: popq   %r14
    0x108b62186 <+118>: popq   %rbp
    0x108b62187 <+119>: retq   
    0x108b62188 <+120>: movq   %rbx, %rdi
    0x108b6218b <+123>: popq   %rbx
    0x108b6218c <+124>: popq   %r14
    0x108b6218e <+126>: popq   %rbp
    0x108b6218f <+127>: jmp    0x108fa08a0               ; WTF::ParkingLot::unparkAll(void const*)
    0x108b62194 <+132>: int3   
    0x108b62195 <+133>: nopw   %cs:(%rax,%rax)

I can continue with the program execution and the app doesn’t crash, but it’s extremely annoying and I wonder what all this means and would it affect an app in production?

Also what I noticed is that my app doesn’t update when I do an update on the remote Database. Basically my change event is not triggered, but if I relaunch the app - I have the correct data.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:36 (10 by maintainers)

github_iconTop GitHub Comments

9reactions
jeremyongcommented, Jul 28, 2017

I’m seeing this as well. Makes debugging a realm-enabled app very difficult

4reactions
esuttoncommented, Jul 4, 2018

@scottwio Sadly, I had to largely abandon Chrome debugging.

When developing new features for my app, I must add (and then remember to remove) many console.log statements, then use adb logcat or xcode to develop and debug. It is a significant hit on efficient development.

A single package ( realm ) prevents efficient Chrome debugging of anything.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chrome 'paused in debugger' issue - Stack Overflow
One possible cause, it that you've enabled the "pause on exceptions" (the little stop-sign shaped icon with the pause (||) symbol with in...
Read more >
WebKit | Apple Developer Forums
I'm trying to open a DMG file in Google Chrome and it opens to crazy gibberish and freezes Google Chrome. Oddly, it downloads...
Read more >
Firebase Apple SDK Release Notes - Google
Added support for returning the current session ID with sessionID() . Added support for simulating a match for on-device conversion measurement in debug...
Read more >
Development Workflow - NativeScript Docs
--debug-brk - Prepares, builds and deploys the application package on a device or in an emulator, and stops at the first JavaScript line...
Read more >
ti-inspector - npm
Debug Appcelerator Titanium apps in Chrome DevTools. Latest version: 0.1.2, last published: 8 years ago. Start using ti-inspector in your ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found