NAP 0.3.0 Napkin crashing


#1

I downloaded the latest (0.3.0) NAP version for MacOS and I’m having Napkin crashes with Segmentation fault: 11.

Steps to reproduce:

  • In demos/copystamp run regenerate
  • Open the generated Xcode project and run the target copystamp
  • Go to bin and run napkin
  • In Napkin go to Open File and try to open the copystamp.json

After that Napkin crashes.

Here’s the log:

Last login: Wed Sep 11 21:43:51 on ttys007
/Users/rumori/Downloads/NAP-0.3.0-macOS/demos/copystamp/bin/Clang-x86_64-Debug/napkin ; exit;
MacBook-Pro:~ rumori$ /Users/rumori/Downloads/NAP-0.3.0-macOS/demos/copystamp/bin/Clang-x86_64-Debug/napkin ; exit;
[debug] Logging to file: /Users/rumori/Downloads/NAP-0.3.0-macOS/demos/copystamp/bin/Clang-x86_64-Debug/log/napkin_2019-09-11_21-44-28_170.log
[fine] Loading theme: /Users/rumori/Downloads/NAP-0.3.0-macOS/demos/copystamp/bin/Clang-x86_64-Debug/resources/themes/gray/theme.json
[fine] Loading theme: /Users/rumori/Downloads/NAP-0.3.0-macOS/demos/copystamp/bin/Clang-x86_64-Debug/resources/themes/napkin/theme.json
[fine] Loading theme: /Users/rumori/Downloads/NAP-0.3.0-macOS/demos/copystamp/bin/Clang-x86_64-Debug/resources/themes/native/theme.json
[debug] Using settings file: /Users/rumori/Downloads/NAP-0.3.0-macOS/demos/copystamp/bin/Clang-x86_64-Debug/napframework/Napkin.ini
[fine] Setting theme: Napkin
[info] Loading 'file:///Users/rumori/Downloads/NAP-0.3.0-macOS/demos/copystamp/data/copystamp.json'
[debug] Loaded module mod_napdatabase v0.2.0
[debug] Loaded module mod_serial v0.2.0
[debug] Loaded module mod_napartnet v0.2.0
[debug] Loaded module mod_napapiwebsocket v0.2.0
[debug] Loaded module mod_napimgui v0.2.0
[debug] Loaded module mod_napmath v0.2.0
[debug] Loaded module mod_napparametergui v0.1.0
[debug] Loaded module mod_napinput v0.2.0
[debug] Loaded module mod_naposc v0.2.0
[debug] Loaded module mod_napapp v0.2.0
[debug] Loaded module mod_napparameter v0.1.0
[debug] Loaded module mod_napvideo v0.2.0
[debug] Loaded module mod_napetherdream v0.2.0
[debug] Loaded module mod_napsvg v0.2.0
[debug] Loaded module mod_napmidi v0.2.0
[debug] Loaded module mod_naprender v0.2.0
[debug] Loaded module mod_napfont v0.2.0
[debug] Loaded module mod_napscene v0.2.0
[debug] Loaded module mod_napapi v0.2.0
[debug] Loaded module mod_napwebsocket v0.2.0
[debug] Loaded module mod_napsdlinput v0.2.0
[debug] Loaded module mod_nappython v0.2.0
[debug] Loaded module mod_napaudio v0.2.0
[debug] Loaded module mod_napcameracontrol v0.2.0
[debug] Loaded module mod_napyoctopuce v0.2.0
Segmentation fault: 11
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

Let me know if I’m doing something wrong, I’m trying to create a module for my project and the copystamp demo seems to be a good example of that.

Thanks.


#2

Hi,

What confuses me is the number of modules napkin is trying to load. copystamp only has these module dependencies:

image

I see midi, api, python etc. Those modules are not required by the application. Are old compiled modules lingering around? We have tested the all the demos together with napkin before release.


#3

Can you try any of the other demo’s and see if this problem persists?


#4

Pitching in, can you also try to clear your bin directory and start from scratch, see if that makes a difference?
Reason: Napkin will just load all the modules currently available to the project. We are working on doing sparse module loads based on the currently loaded document, but it needs some refactoring. This should make debugging these situations easier.

FYI, I tested both the package and latest mainline. So I too suspect it’s just loading an incompatible binary(module)


#5

This was a fresh download and build.
Now I tried to clean the build folder and also deleted everything in DerivedData just to make sure nothing is cached, but the issue still persists.
I will compile the other demos now and report back.


#6

Tried Helloworld and Multiwindow:

  • all of them build and run fine, just like Copystamp did
  • when opening Napkin and then opening the associated app structure file (helloworld.json, multiwindow.json respectively) they both work fine, no crashes
  • I still see all those modules loaded though
  • my feeling is that copystamp has an additional project module and that might be the difference between these demos, but that’s just a guess
/Users/rumori/Downloads/NAP-0.3.0-macOS/demos/multiwindow/bin/Clang-x86_64-Debug/napkin ; exit;
MacBook-Pro:~ rumori$ /Users/rumori/Downloads/NAP-0.3.0-macOS/demos/multiwindow/bin/Clang-x86_64-Debug/napkin ; exit;
[debug] Logging to file: /Users/rumori/Downloads/NAP-0.3.0-macOS/demos/multiwindow/bin/Clang-x86_64-Debug/log/napkin_2019-09-12_11-23-43_812.log
[fine] Loading theme: /Users/rumori/Downloads/NAP-0.3.0-macOS/demos/multiwindow/bin/Clang-x86_64-Debug/resources/themes/gray/theme.json
[fine] Loading theme: /Users/rumori/Downloads/NAP-0.3.0-macOS/demos/multiwindow/bin/Clang-x86_64-Debug/resources/themes/napkin/theme.json
[fine] Loading theme: /Users/rumori/Downloads/NAP-0.3.0-macOS/demos/multiwindow/bin/Clang-x86_64-Debug/resources/themes/native/theme.json
[debug] Using settings file: /Users/rumori/Downloads/NAP-0.3.0-macOS/demos/multiwindow/bin/Clang-x86_64-Debug/napframework/Napkin.ini
[fine] Setting theme: Napkin
[info] Loading 'file:///Users/rumori/Downloads/NAP-0.3.0-macOS/demos/multiwindow/data/multiwindow.json'
[debug] Loaded module mod_napdatabase v0.2.0
[debug] Loaded module mod_serial v0.2.0
[debug] Loaded module mod_napartnet v0.2.0
[debug] Loaded module mod_napapiwebsocket v0.2.0
[debug] Loaded module mod_napimgui v0.2.0
[debug] Loaded module mod_napmath v0.2.0
[debug] Loaded module mod_napparametergui v0.1.0
[debug] Loaded module mod_napinput v0.2.0
[debug] Loaded module mod_naposc v0.2.0
[debug] Loaded module mod_napapp v0.2.0
[debug] Loaded module mod_napparameter v0.1.0
[debug] Loaded module mod_napvideo v0.2.0
[debug] Loaded module mod_napetherdream v0.2.0
[debug] Loaded module mod_napsvg v0.2.0
[debug] Loaded module mod_napmidi v0.2.0
[debug] Loaded module mod_naprender v0.2.0
[debug] Loaded module mod_napfont v0.2.0
[debug] Loaded module mod_napscene v0.2.0
[debug] Loaded module mod_napapi v0.2.0
[debug] Loaded module mod_napwebsocket v0.2.0
[debug] Loaded module mod_napsdlinput v0.2.0
[debug] Loaded module mod_nappython v0.2.0
[debug] Loaded module mod_napaudio v0.2.0
[debug] Loaded module mod_napcameracontrol v0.2.0
[debug] Loaded module mod_napyoctopuce v0.2.0
[debug] Looking for '/Users/rumori/Downloads/NAP-0.3.0-macOS/demos/multiwindow/bin/Clang-x86_64-Debug/config.json'...

EDIT: one more thing I should add:
Napkin in itself opens fine, it’s only crashing when I try to open the copystamp.json file.
After that saves the last opened file in the napkin.ini so from then on it crashes every time.


#7

Thanks for the run-through!

If it is related to project specific modules it’s worth building the linetrace and videomodulation demo. Both use app specific modules to add app specific functionality. But my feeling is that this is not related to app-specific modules, worth a try.

What version of MacOS and XCode are your running? Both me and Bas tested the package and the demo on the latest MacOS (Mojave 10.14.6) and XCode 10.3 and did not run into the same issue. That makes it extra hard to debug. If you have access to source it’s worth compiling the demo from source to see if it persists.

Another thing worth trying out is to package the demo by running:

./package -nz

This will create a package from the demo including napkin. Try launching napkin from that directory and loading the json file from the data folder in that directory. This would be a good comparison, since all the .dylibs in that directory are included and napkin should source them only from that directory.

I noticed that on OSX, when building a demo or project from xcode all available dylibs are sourced into Napkin, regardless of what is specified in the application configuration. As @bas mentioned, this is something we need to look at as it does not occur on Windows, but isn’t directly related to your problem because other demos source them all just fine!


#8

Looking over your log I think it’s a compiler mis-match. All the default pre-compiled NAP modules are loaded fine, the last one is probably the app-specific module that is compiled on your machine, next to the executable. The app might run fine but napkin isn’t able to inspect the module itself.

We will also look into better error-handling regarding module loading in Napkin.


#9

Thank you guys for your prompt replies.

It was an Xcode version problem.
I was still under the impression that I should keep 10.1 for NAP projects and didn’t think of updating for 0.3.0.
Once I updated, and did switch to the new Xcode version with xcode-select everything started working properly.

I should have run check_build_environment when I downloaded the new version. It correctly said “Xcode installed”: FAIL, which even though is a bit confusing would give me a hint.
(had Xcode 10.1, Xcode 10.2 installed but not Xcode 10.3)

As a side note: based on the docs I guess check_build_environment could also be updated to accept Mojave now.

Thanks for the help.


#10

Glad this is sorted.

We will adjust the check_build_environment script and update documentation to reflect changes.