Author Topic: Creating a new font crashes Unity 100% of the time  (Read 44813 times)

DrLoomis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Creating a new font crashes Unity 100% of the time
« on: November 16, 2012, 04:36:39 PM »
I have an atlas to which I've already added a material and two fonts.

I'm now trying to add a third font that's identical to the first two except that it was exported at a smaller font size. It's otherwise identical to the two existing fonts (exported from the same app, etc).

Whenever I try to create the font, it crashes Unity 100% of the time. I drag the txt and material file into the window, type in a name, select the existing atlas and hit Create Font. When I do that, Unity sits there for a bit and then I get the warning message about how the atlas has changed, so make sure to save the scene.

As soon as I hit OK on that, Unity crashes instantly. The crash reporter comes up, and I have to Force Quit Unity to exit. This has happened 5 times in a row. Trying to add the font in a new scene doesn't change the outcome.

Does anyone know what would make it crash like this?
« Last Edit: November 16, 2012, 04:55:40 PM by DrLoomis »

DrLoomis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: Creating a new font crashes Unity 100% of the time
« Reply #1 on: November 16, 2012, 04:41:31 PM »
I tried creating a new atlas and adding the font to that one. Still crashes.

DrLoomis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: Creating a new font crashes Unity 100% of the time
« Reply #2 on: November 16, 2012, 04:43:16 PM »
I just tried taking one of the fonts that was successfully added to the atlas a while ago and adding it to the new atlas. Unity crashes there, too.

It seems like NGUI is crashing Unity when trying to do anything font/atlas related, even when it's using data that has previously worked.

DrLoomis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: Creating a new font crashes Unity 100% of the time
« Reply #3 on: November 16, 2012, 04:46:54 PM »
The log doesn't seem to have anything useful in it. Here's the output from when I opened Unity and immediately tried to create a font in the new testing atlas:

  1. Unloading 439 unused Assets to reduce memory usage. Loaded Objects now: 1813. Operation took 109.655403 ms.
  2. System memory in use: 72.4 MB.
  3. EditorUpdateCheck: Response {updateinterval: '3600'} updateurl =  interval = 3600
  4. Updating Assets/TesterAtlas.png - GUID: d17e3a1d9fbea427893fa74420edfbfa...
  5.  done. [Time: 11.565005 ms]
  6. ----- Total AssetImport time: 0.281317s, Asset Import only: 0.270272s, CacheServerIntegrate only: 0.000000s, CacheMove: 0.000000s, CacheDelete: 0.000000s, CacheServer Download: 0.000000s [0 B, nan mb/s], CacheServer Hashing: 0.000000s [0 B, nan mb/s]
  7. Updating Assets/TesterAtlas.png - GUID: d17e3a1d9fbea427893fa74420edfbfa...
  8.  done. [Time: 6.298809 ms]
  9. ----- Total AssetImport time: 0.272106s, Asset Import only: 0.259189s, CacheServerIntegrate only: 0.000000s, CacheMove: 0.000000s, CacheDelete: 0.000000s, CacheServer Download: 0.000000s [0 B, nan mb/s], CacheServer Hashing: 0.000000s [0 B, nan mb/s]
  10. Updating Assets/TesterAtlas.png - GUID: d17e3a1d9fbea427893fa74420edfbfa...
  11.  done. [Time: 6.019996 ms]
  12. ----- Total AssetImport time: 0.515548s, Asset Import only: 0.505546s, CacheServerIntegrate only: 0.000000s, CacheMove: 0.000000s, CacheDelete: 0.000000s, CacheServer Download: 0.000000s [0 B, nan mb/s], CacheServer Hashing: 0.000000s [0 B, nan mb/s]
  13. Refresh, detecting if any assets need to be imported or removed ... 0.021527 seconds
  14. Updating Assets/TesterAtlas.png - GUID: d17e3a1d9fbea427893fa74420edfbfa...
  15.  done. [Time: 65.843689 ms]
  16. ----- Total AssetImport time: 0.476069s, Asset Import only: 0.460333s, CacheServerIntegrate only: 0.000000s, CacheMove: 0.000000s, CacheDelete: 0.000000s, CacheServer Download: 0.000000s [0 B, nan mb/s], CacheServer Hashing: 0.000000s [0 B, nan mb/s]
  17. Updating Assets/TesterAtlas.png - GUID: d17e3a1d9fbea427893fa74420edfbfa...
  18.  done. [Time: 9.430678 ms]
  19. ----- Total AssetImport time: 0.083749s, Asset Import only: 0.073681s, CacheServerIntegrate only: 0.000000s, CacheMove: 0.000000s, CacheDelete: 0.000000s, CacheServer Download: 0.000000s [0 B, nan mb/s], CacheServer Hashing: 0.000000s [0 B, nan mb/s]
  20. Unloading 43 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
  21.  
  22. Unloading 400 unused Assets to reduce memory usage. Loaded Objects now: 1778. Operation took 54.256817 ms.
  23. System memory in use: 76.8 MB.
  24. Receiving unhandled NULL exception
  25. Launching bug reporter
  26.  
  27. *** Launching bug reporter due to crashbug.
  28. Obtained 0 stack frames.

DrLoomis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: Creating a new font crashes Unity 100% of the time
« Reply #4 on: November 16, 2012, 04:55:12 PM »
I created a new project and imported only NGUI. With the exact same font (txt & png) I was able to create an atlas and create a font within that atlas. So the crashing is something to do with my project, not NGUI in general.

Are there any temp or cache files I can delete? Should I try reinstalling NGUI?

DrLoomis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: Creating a new font crashes Unity 100% of the time
« Reply #5 on: November 16, 2012, 04:59:39 PM »
One other bit of info: all of my working fonts and atlases were created a week or two ago. I've since upgraded NGUI to the latest version and also incorporated NGUI HUD Text. Other than the crash when creating a font, NGUI and NGUI HUD Text work perfectly with no errors or warnings.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Creating a new font crashes Unity 100% of the time
« Reply #6 on: November 16, 2012, 05:02:20 PM »
If you can send me your project, I will debug it directly from Unity's source code, and hopefully pinpoint the cause: support at tasharen.com.

Are your atlases set up as reference atlases?

DrLoomis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: Creating a new font crashes Unity 100% of the time
« Reply #7 on: November 16, 2012, 05:04:38 PM »
My project is over 2GB, and I'm not comfortable sending the whole thing out. Is there a subset of the project I can send to you that you can debug?

The atlas it's currently crashing on is set to normal, not reference.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Creating a new font crashes Unity 100% of the time
« Reply #8 on: November 16, 2012, 05:13:09 PM »
Yeah that's a bit too big. Have you tried updating it while in a brand-new scene, without any UI components present? The only thing I changed in this version from the previous ones, is that marking a reference atlas as dirty will make sure that both the reference atlas and the actual atlas it points to get marked as dirty when a change occurs.

DrLoomis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: Creating a new font crashes Unity 100% of the time
« Reply #9 on: November 16, 2012, 05:18:53 PM »
Yep, doing it in a brand new scene it still crashes, though I do have some prefabs that reference the atlases if that counts as having UI components present.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Creating a new font crashes Unity 100% of the time
« Reply #10 on: November 16, 2012, 05:23:36 PM »
Yeah looking at the code there is nothing odd happening, so it would be really nice to have a small repro case that I can debug directly within Unity running in the debugger. Is there any way you can reduce your project down to the smallest size possible, leaving only the UI atlas and the font you're trying to add?

DrLoomis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: Creating a new font crashes Unity 100% of the time
« Reply #11 on: November 16, 2012, 05:27:11 PM »
Yep, I'll give that a shot. Probably can't get to it until tomorrow, though.

lime-green.at

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 60
    • View Profile
Re: Creating a new font crashes Unity 100% of the time
« Reply #12 on: November 17, 2012, 12:25:44 PM »
I'm having the exact same problem, since i updated to the newest version of NGUI.
Edit: It gives me the info that i have to save the scene, when i click OK it crashes.
« Last Edit: November 17, 2012, 12:27:24 PM by axm0nky »

DrLoomis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: Creating a new font crashes Unity 100% of the time
« Reply #13 on: November 17, 2012, 12:56:36 PM »
So, I just inadvertently found a fix, or at least a workaround. I was going to strip down my project so I could zip it up and send it to ArenMook, so I first copy/pasted it to my desktop. I then went into the folder and deleted this group of files in the attached screenshot.

I was planning to then open the project and delete the rest of the files/prefabs/scenes from within Unity, just in case it needed to track the deletion for metadata or something. But first I decided to see one last time if I could create a font, so I did the same stuff I was doing yesterday and ... it worked just fine without crashing. Same data, same process, suddenly just working.

This was still in the copy project, so I went back to the main project and repeated the steps, just to see if something about copy/pasting the project had fixed the issue. So I deleted that set of files from the main project, tried to create a font, and ... it worked just fine.

So I have no idea why it worked, but deleting the group of files from that screenshot fixed the issue. I have no idea what those files do, so, uh, use this solution at your own risk I guess.

lime-green.at

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 60
    • View Profile
Re: Creating a new font crashes Unity 100% of the time
« Reply #14 on: November 17, 2012, 01:01:08 PM »
How that could fix it? (havent it tried yet) That files are just the project files for monodevelop / visual studio..
edit: not working for me.
edit²: not getting the crash with 2.2.3 of ngui @ newest 3.5.6f4 unity release.
« Last Edit: November 17, 2012, 01:29:06 PM by axm0nky »