Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: DrLoomis on November 16, 2012, 04:36:39 PM

Title: Creating a new font crashes Unity 100% of the time
Post by: DrLoomis 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?
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: DrLoomis on November 16, 2012, 04:41:31 PM
I tried creating a new atlas and adding the font to that one. Still crashes.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: DrLoomis 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.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: DrLoomis 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.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: DrLoomis 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?
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: DrLoomis 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.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: ArenMook 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?
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: DrLoomis 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.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: ArenMook 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.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: DrLoomis 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.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: ArenMook 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?
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: DrLoomis on November 16, 2012, 05:27:11 PM
Yep, I'll give that a shot. Probably can't get to it until tomorrow, though.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: lime-green.at 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.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: DrLoomis 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.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: lime-green.at 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.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: ArenMook on November 17, 2012, 09:03:05 PM
I was forwarded a Unity crash report on the issue, and it's... bizzarre. The crash occurs in a strange part of the code with no call stack to trace. I'll keep digging and narrow it down though.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: ArenMook on November 17, 2012, 09:48:53 PM
The stack trace proved to be pretty useless, but I did narrow down the steps that cause it to crash at least... and it has something to do with a dialog window being open. I simply removed the dialog window, and the problem went away. 2.2.6c has the fix.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: lime-green.at on November 18, 2012, 03:32:38 AM
Yeah, i submitted an error log some days ago, but i didnt expect that they are going to forward it to you. Great job, ill upgrade my project up to the newest version of NGUI and edit that post to make sure you know if it worked or not.

Regards
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: ArenMook on November 18, 2012, 04:52:15 AM
I work at Unity, so no reason for them not to. :)
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: lime-green.at on November 18, 2012, 05:22:55 AM
Ah, thats nice. You should suggest them to build in NGUI into Unity, so nobody ever has to deal with the ridiculous built-in gui system of unity ;)
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: seattlefella on December 02, 2012, 10:55:26 PM
I am also having the crashing problem 100% of the time;  very simple project under 50 meg.;  NGUI version 2.2.6  I do not see a 2.2.6C on the unity asset store.  Does version C fix the problem?  Or was there some other action that made it go away for the other users.  Many thanks,
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: ArenMook on December 03, 2012, 10:39:39 AM
Yes 2.2.6c fixes it. The asset store has C.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: renderhjs on February 12, 2013, 12:05:01 AM
I have version 2.2.7c but I too started to get every time crashes when creating a font, basically after pressing the create button Unity crashes

(http://farm9.staticflickr.com/8391/8467458650_7abb0f9fa7_o.jpg)

This didn't used to happen when I started with the project. This is frustrating because I depend on the NGUI scripts to use fonts.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: renderhjs on February 12, 2013, 12:06:53 AM
I fixed it,
at least if I close all other nGui panels it doesn't crash anymore. I think the crash is related to other panels not updating correctly.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: renderhjs on February 12, 2013, 08:00:17 PM
Today it keeps happening even though I close all the NGui panels  >:(

Maybe I am just guessing randomly, but when I did hide any NGUI ui in the viewport (move camera away) it did work this time. Still it worries me because I will have to deal with more fonts in the next few days and weeks and if it keeps crashing I need to look into a serious fix.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: ArenMook on February 13, 2013, 01:50:50 PM
There are no crashes using the latest version of NGUI in either Unity 3.5.X nor 4.X, so I can't comment much on this one.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: renderhjs on February 25, 2013, 02:31:59 AM
I had again consistent crashes today (4x in a row)  >:( there is seriously something broken in NGUI, I have the latest version of NGUI and an up to date Unity 4 pro.
The only way it worked in the end was to close any NGui panels, create or go to a empty scene and then create the font. Please fix this, as it makes working with multiple fonts almost impossible and Unity highly unstable.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: ArenMook on February 25, 2013, 06:15:43 AM
Unless you provide clear steps I can follow to reproduce it, there is nothing I can do. As far as I know, you are the only one experiencing this issue.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: sintua on February 25, 2013, 11:39:42 PM
He's not the only one. I have a fresh install of Unity, fresh install of NGUI, and a fresh Scene and the exact same problem happens to me.

Whenever I try to create a font with Font Maker, I click create the font and it opens the atlas changed dialogue. i click ok, get a spinning wheel for a second, and unity crashes. This happens EVERY time.

However, if I create the same font WITHOUT selecting an atlas, it works fine, every time.
I can then select that font and the atlas I want, and "replace the font", and it *seems* to add it to the proper atlas without any fuss.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: ArenMook on February 26, 2013, 07:20:29 AM
Atlas changed dialog? There is no atlas changed dialog. This was removed a long time ago.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: sintua on February 26, 2013, 04:33:07 PM
Atlas changed dialog? There is no atlas changed dialog. This was removed a long time ago.

Haha, ok so the problem is something else... The asset store apparently wasn't actually updating my NGUI package despite directly telling it to do so. Still on 2.2.6B... Sorry about that :P
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: ArenMook on February 26, 2013, 07:46:10 PM
"B" in 2.2.6B stands for "BUG" :P
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: dubbreak on March 07, 2013, 05:27:27 PM
I'm seeing this in 3.5.7f6 with ngui 2.3.4. It was crashing every time I attempted to create the font (and resulted in a corrupted atlas that I have to update all my graphics in order to fix).

I finally got it to work by creating a new scene that contains nothing before attempting to create the font.

I checked the crash files and nothing useful in there. The scene I had loaded uses ngui extensively though (as in I should probably be using a sprite solution for some of it instead  ;D).. so maybe that's part of the issue. The atlas texture is 2048x2048.

When I attempted in in a bare scene it was really quick and in the scene where it crashes it grinds for a decent amount of time before it crashes.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: DrLoomis on April 17, 2013, 09:23:41 PM
Still seeing this with 2.5.1 in Unity 3.5.7f6.

Creating fonts in a new scene does seem to help; in my primary gameplay scene I created two fonts successfully and then kept crashing on the third one (i.e. quit, reopen, try the same thing, crash again, wash, rinse, repeat). In a new scene, I was able to create the remainder of my fonts without issue.

It crashed the first time in 2.3.6, so I checked for a new version, updated to 2.5.1 and still got the crash (this was all in my main gameplay scene). So nothing between 2.3.6 and 2.5.1 seems to have affected it. The crash is still lurking. I reported the crashes through the automated bug reporter.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: DrLoomis on April 17, 2013, 09:26:12 PM
The rampant crashing completely corrupted my font atlas.

Now I have to go add them all back to the atlas one by one, and possibly recreate them all. Awesome.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: dubbreak on May 03, 2013, 05:02:33 PM
Yeah, still happening to me. It was working fine in a new scene until I had to delete then reimport a font (think I accidentally exported it as 8 bit at first so it was goofy). After deleting it from the atlas and deleting the prefab I tried to reimport and it crashed and continues to crash if I try to create a font.

Time to try the empty scene again. It corrupted my atlas of course, so I had to 'update' all my sprites again. Pain to say the least. Kind of kills my productivity to say the least. Not a good way to keep motivated on a Friday afternoon..oh well....
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: DrLoomis on June 10, 2013, 04:43:02 PM
Still seeing this.

OS X 10.8.4
Unity 3.5.7f6
NGUI 2.6.2

Any hope of a fix?
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: ArenMook on June 10, 2013, 11:25:19 PM
Without steps to reproduce, there is nothing I can do as I don't encounter this issue. Any additional info besides "still seeing this" would be helpful.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: DrLoomis on June 11, 2013, 12:38:00 PM
I gave you all the information I could (repro steps and the log file) when I reported the bug seven months ago. A number of other users have also seen the bug and shared information in the thread, and in your own previous posts you said you'd tracked it down to at least one thing (which I guess has since rebroken). Perhaps re-reading the full thread will jog your memory or provide clues.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: ArenMook on June 11, 2013, 12:54:21 PM
The report was for a completely different issue that was caused by a popup dialog that got fixed a long time ago. I do not experience any issues with the current workflow, and know no steps to reproduce with the latest version.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: dubbreak on August 28, 2013, 10:01:34 PM
I don't think the steps to reproduce are going to be helpful since they are basically, "Make a font, like normal." Then sometimes it will crash, sometimes it won't. I can see if I can cut down an existing project into something smaller I can upload that will reliably reproduce the issue. Currently even the workaround of opening a new scene isnt' working (still crashes in a new scene).

Biggest issue is that the atlas ends up corrupted after the crash (despite not saving the scene). The fix for that is to select all the graphics in the atlas and do a "add/update all". This is the biggest problem for me. Crashing is livable (it's Unity, it crashes), but the having to rebuild the atlas is a pita. Then I'm crossing my fingers it won't happen on the next attempt.

I'll try to make a smaller project and upload it to some web hosting so you can attempt to reproduce it.

Title: Re: Creating a new font crashes Unity 100% of the time
Post by: bbfy on May 21, 2017, 05:30:00 AM
same for me with attached font.
Title: Re: Creating a new font crashes Unity 100% of the time
Post by: dubbreak on May 23, 2017, 02:39:47 PM
The workaround I found that works every time is to open up Unity fresh before importing a font.

It definitely was an issue if my computer had slept then woke up but I think also if I had Unity open for a long time.

In any case, closing Unity, opening then selecting my scene and importing worked fine every time.