Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by demid · Jan 09, 2014 at 01:52 PM · androidshadercrash

Shader.WarmupAllShaders FATAL EXCEPTION [UnityMain]

Hi there!

I'm experiencing a crash on my game launch. It happened on one unlucky day on my HTC Incredible S and I have no idea how to deal with it so far. Previously the game started and working on this phone just fine (on Android 2.3.5). After unknown circumstances it started to block the phone completely to full system hang and subsequent device reboot. After installing previous versions of the game which definitely were working nothing changed. I decided to make a factory reset - no effect again! Then I updated to Android 4.0.4 and the game still crashes. However, on a latter Android I'm able to view a crash report and observe there this fatal error: java.lang.Error: FATAL EXCEPTION [UnityMain] Unity version : 4.3.2f1 Device model : HTC HTC Incredible S Device fingerprint: htc_wwe/htc_vivo/vivo:4.0.4/IMM76D/398875.1:user/release-keys

 Caused by: java.lang.Error: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 042e2b50
 Build fingerprint: 'htc_wwe/htc_vivo/vivo:4.0.4/IMM76D/398875.1:user/release-keys'
 Revision: '128'
 pid: 30308, tid: 30323, name: UnityMain >>> com.[MY_PACKAGE_NAME] <<<
 r0 55120240 r1 042e2b50 r2 0000009c r3 0000009c
 r4 00000000 r5 042e2b50 r6 028015d0 r7 0000000c
 r8 00000000 r9 01c02de0 sl 0000003c fp 534453fc
 ip 00000001 sp 52f9e394 lr 532e831c pc 400bdf28 cpsr 0000000b
 
 at libc.0000df28(Native Method)
 at [heap].00dc75ac(Native Method)
 at Shader.WarmupAllShaders(Native Method)
 at ... [my C# code]

Any ideas what can cause the problem? Shader.WarmupAllShaders is required to abort a jittery game start.

Update: if I comment out Shader.WarmupAllShaders() call then the game starts and works fine. But I need to mention here that I did not change shaders for a long time before the bug came out. The only thing I did is updated Unity. But another interesting thing here is that I've tried to install and run APK files build with older Unity versions. As I said, these game versions were 100% working before on the same Android version which were used originally to run these APKs. What I did with my test phone is just installed/removed some apps from Google Play. And my phone is not rooted, it had a stock Android version.

Update 2: it seems that the crash happens on a wide range of Adreno GPU family:

  • HTC Desire X (Adreno 203)

  • HTC Incredible S (Adreno 205)

  • HTC One S (Adreno 225)

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image tanoshimi · Jan 09, 2014 at 02:04 PM 1
Share

So if you comment out the call to WarmupAllShaders() in your code, the game is jittery but doesn't crash? Sounds like you've got an erroneous shader somewhere.

avatar image demid · Jan 09, 2014 at 06:13 PM 0
Share

@tanoshimi, To be more specific, if I comment out WarmupAllShaders() then the game runs with a freeze on first objects instantiation. After that the game runs O$$anonymous$$. But the whole purpose of this method is to avoid such hiccups. I wonder why it fails because it should only warmup only combinations of those shaders which the game actually uses. But the game runs just fine so all used shader combinations are rendered without any problems. Yes I have some libraries using custom shaders but there are 55 shaders included in my project totally and I can not simply remove them one by one to deter$$anonymous$$e which one fails. Any ideas on a reliable warmup?

avatar image Graham-Dunnett ♦♦ · Jan 10, 2014 at 01:53 PM 0
Share

Why can't you remove them one by one? Sure it's a pain. But it might help you locate the problem.

avatar image demid · Jan 10, 2014 at 01:58 PM 0
Share

Well, on my slow environment each test will take away about 10 $$anonymous$$. If the shader will be spotted on a halfway then it would totally consume about 4 hours of investigation.. oops! Edit: I'm using NGUI and saw a post about shader issues on Adreno. However, I'm not using hard clipping. Anyway, I checked the game in all different aspects and all used shaders are working properly. As WarmupAllShaders() should warmup only currently used shaders I don't get the idea why it does not work.

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Jason-King · Apr 25, 2014 at 11:09 PM

We were getting the same crash due to WarmupAllShaders. It is specific to clip and alphatest calls within the shaders for Adreno devices.

Adding this answer for archival purposes of linking clip/alphatest/adreno to WarmupAllShaders.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image demid · Apr 25, 2014 at 11:27 PM 0
Share

Yes, Adreno GPU with these kinds of shaders is the reason. But how we can efficiently nail down the troublesome shader without removing them one by one? I'm not a shader specialist and I have several libraries with 55 shaders total - too much to go on with this approach.

avatar image Jason-King · Apr 25, 2014 at 11:46 PM 0
Share

Sorry, I ended up commenting out all the uses of clip or alphatest in all of my shaders. It says that it only warms up the shaders that are already loaded (via assets located somewhere in the scene). But I suspect (I have no proof) it does more than that because we use a limited set of shaders in the entirety of our game assets. Without WarmupAllShaders the game ran fine from start to finish, but with WarmupAllShaders suddenly some hidden asset now has the broken shader - uh, no - and I know this because I've gone through every material being used in the game.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Android Crash, waitForCondition(LockCondition) 0 Answers

EGL_BAD_ATTRIBUTE on adreno-based android devices 2 Answers

Problem with shaders on Android? 1 Answer

Why Do Android Devices Hate This Shader? 2 Answers

Unity3D Android plugins and SIGSEGV 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges