Posix semaphore blocked by Mac Store sandbox

Unity c# 空指针

lyo posted @ 2013年5月30日 22:37 in Coding with tags Unity android , 3184 阅读

在公司比较闲,让帮忙改一个奇怪的crash,没有任何log,才搞半天,发现是由于LoadLevelAsync 的Thread Loading,在乱七八糟的android机器上出现问题了,空指针,访问没有loading完的Additive场景里的东西。

下面的代码在Galaxy S4上直接crash,而且没有任何log,太恶心人了,如果项目代码一大堆,用最原始的排除法也让你累吐血

public class Boot : MonoBehaviour 
{
	class TestNULL
	{
		public void Test()
		{
			Debug.Log("########## Test");
		}
	}
	
	TestNULL _test = null;
	
	void Start () 
	{
		_test.Test(); //没有NullPointer异常?!
	}

整理了下,写了个Unity Plugin,准确定位空指针crash

void print_stack(void* ptr)
{
    ucontext_t *ucontext = (ucontext_t*)ptr;
    sigcontext& sig = ucontext->uc_mcontext;
    gprintf("reg[fp]: %p", sig.arm_fp);
    gprintf("reg[ip]: %p", sig.arm_ip);
    gprintf("reg[sp]: %p", sig.arm_sp);
    gprintf("reg[lr]: %p", sig.arm_lr);
    gprintf("reg[pc]: %p", sig.arm_pc);

    if(hasMono)
    {
        MonoDomain* domain = mono_get_root_domain();
        mono_thread_attach(domain);
        gprintf("mono trace:");
        gprintf("%s", mono_pmip((void*)sig.arm_pc));

        MonoJitInfo* jit = mono_jit_info_table_find(domain, (char*)sig.arm_pc);
        if(jit)
        {
            uint32_t code_offset = (uint32_t)((uint8_t*)sig.arm_pc - (uint8_t*)jit->code_start);
            MonoDebugSourceLocation* source = mono_debug_lookup_source_location (jit->method, code_offset, domain);
            if (source) gprintf("\t %s:%d", source->source_file, source->row);
        }
    }
}

void signal_handler(int signum, siginfo_t *info, void * ptr)
{
    if (info->si_addr == NULL) 
    {
        gprintf("================NullPointerException Begin====================");
        gprintf("\n");
        
        print_stack(ptr);
        
        gprintf("\n");
        gprintf("================NullPointerException End====================");
    } 
    else
    {
        gprintf("================UnKnownException Begin====================");
        gprintf("\n");
        
        print_stack(ptr);
        
        gprintf("\n");
        gprintf("================UnKnownException End====================");

    }
    signal(signum, SIG_DFL);
    //kill(getpid(), signum);
}
icyplayer 说:
2014年5月05日 06:12

问下,你在Unity3D Plugin用到的mono_thread_attach之类的函数,是下载了mono的头文件再编译的吗,是哪个版本呢

seo service london 说:
2024年2月21日 23:39

Good – I should certainly pronounce, impressed with your web site. I had no trouble navigating through all tabs as well as related info ended up being truly easy to do to access. I recently found what I hoped for before you know it in the least. Quite unusual. Is likely to appreciate it for those who add forums or something, site theme 

먹튀폴리스주소 说:
2024年2月26日 22:55

There are a handful of captivating elements over time inside the following paragraphs however I don’t recognize if I see they all middle to coronary coronary coronary heart. There’s a few validity however I maximum surely will take hold opinion till I take a look at into it further. Excellent article , thank you therefore we need a good buy greater! Added to FeedBurner as well

토토사이트추천 说:
2024年2月26日 22:57

Faast Pharmacy proudly serves as an official supplier of medical products, partnering with international pharmaceutical companies that deliver licensed medications worldwide. By establishing direct collaborations with manufacturers, we provide medications at wholesale prices, enabling our customers to save more than 100% off the original drug costs.

카지노탐구생활 说:
2024年2月26日 22:58

I exactly wanted to realize you all all once more. I do not recognize what I ought to have determined within the absence of the shape of strategies revealed by way of way of you at once on that industry. It had been a hard condition for my part, but , locating out this specialised manner you dealt with the trouble compelled me to leap for pride. I’m thankful in your assist and further pray you discover what a first-rate procedure you are constantly putting in coaching women and men through a weblog. Most possibly you’ve in no way come across everyone.

토토사이트순위 说:
2024年2月26日 23:01

I exactly wanted to realize you all all once more. I do not recognize what I ought to have determined within the absence of the shape of strategies revealed by way of way of you at once on that industry. It had been a hard condition for my part, but , locating out this specialised manner you dealt with the trouble compelled me to leap for pride. I’m thankful in your assist and further pray you discover what a first-rate procedure you are constantly putting in coaching women and men through a weblog. Most possibly you’ve in no way come across everyone.

토토사이트순위 说:
2024年2月26日 23:01

Last but not least, understand that cryptocurrency arbitrage is not really a guaranteed in full road to riches. It requires determination, continuous understanding, and a willingness to adapt. Show patience, keep disciplined, and always prioritize the protection of one's assets.

토토사이트 说:
2024年2月26日 23:49

I simply needed to make a quick comment as a way to express gratitude for you for anyone wonderful pointers you happen to be posting here. My time consuming internet investigation has right at the end of waking time been rewarded with good quality ways of present to my guests. I would state that many people readers are actually endowed to take place in an incredible network with the greatest marvellous those with useful hints. I am quite privileged to own used your webpages and look toward really more fabulous minutes reading here. Many thanks for a number of things.

파워볼 说:
2024年2月26日 23:50

The Gems Bonanza slot from the online slot site takes players into the sparkling world of shining diamonds and precious stones. Its richly colored graphic design and smooth animations create an exciting and engaging atmosphere. The game's reels are decorated with a variety of precious stones, including emeralds, sapphires, topaz, rubies, and amethysts. The beautiful background with bright colors adds a luxurious feel to this game.

ok토토먹튀검증 说:
2024年2月26日 23:52

I simply needed to make a quick comment as a way to express gratitude for you for anyone wonderful pointers you happen to be posting here. My time consuming internet investigation has right at the end of waking time been rewarded with good quality ways of present to my guests. I would state that many people readers are actually endowed to take place in an incredible network with the greatest marvellous those with useful hints. I am quite privileged to own used your webpages and look toward really more fabulous minutes reading here. Many thanks for a number of things.

안전놀이터추천 说:
2024年2月26日 23:54

I were venerated to reap a name from a chum as he determined the crucial guidelines shared at the internet page. Browsing your weblog post is a actual first rate enjoy. Thanks again for taking into account readers like me, and I want for you the best of achievements as being a expert area.

메이저놀이터 说:
2024年2月26日 23:54

There are pretty masses of facts that adheres to that to think about. That’s a super point to mention. I provide you with the thoughts above as wellknown concept however certainly there are simply questions such as the most effective you retrieve wherein maximum vital component will possibly be in honest excellent faith. I don?T determine if guidelines have emerged about items like that, but I comprehend your system is simply called an lower priced game. Both women and boys experience the impact of definitely a moment’s pride, for the the relaxation in their lives.

먹튀사이트조회 说:
2024年2月27日 00:37

BTW, and I choice we do not drag this too prolonged, but care to remind us genuinely what form of guns have been getting used on Kurds with the useful resource of Saddams military? To the track of hundreds of hundreds of dull Talk about re-written information

메이저사이트 说:
2024年2月27日 00:39

Well, the item is in fact the best on this worthw hile topic. I harmonise with your conclusions and will also virtually thirstily look forward to your drawing close updates. Just saying thank you will simply no longer certainly simply be sufficient, for the large lucidity for your writing. I clearly will at once grab your rss feed to live abreast of any kind of updates. Admirable work and plenty fulfillment in your commercial enterprise enterprize!

메이저놀이터 说:
2024年2月27日 00:40

After studies some of of the blog posts to your net web page now, and I truly like your way of taking walks a weblog. I bookmarked it to my bookmark net website online document and may be checking over again soon. Pls check my internet internet website as nicely and allow me comprehend what you agree with you studied.

토토사이트 说:
2024年2月27日 00:41

Great read, positive site, where did you get the information for this post? I've read a few of the articles on your website now and I really like your style. Thanks a million and please keep up the effective work.

메이저사이트 说:
2024年2月27日 00:46

Nice placed up. I discover some thing greater difficult on numerous blogs ordinary. Most normally it is stimulating to take a look at content from different writers and use a hint something from their internet site on line. I’d prefer to use some at the equal time as the use of content by myself weblog regardless of whether you do now not mind. Natually I’ll provide link for your net blog. Many thanks sharing.

토토사이트추천 说:
2024年2月27日 01:16

My plate is actual complete and your tryna deliver me greater food, boy what the fuck is incorrect wit’ you?!First-fee layout of factors you actually regular a B+ almost about effort and tough artwork. Where exactly you genuinely misplaced me personally became first on the facts. You recognize, they are saying, the devil is in the info… And it couldn’t be an awful lot greater correct right right here. Having stated that, allow me say to you what did supply the results. Your textual content is quite convincing and this might be the reason why I am making an attempt to be able to opine. I do no longer surely make it a everyday addiction of doing that. Second, whilst I can without difficulty word a leaps in reasoning you're making, I am virtually now not glad of exactly the way you appear to unite your facts which in turn help to make your very last result. For now I shall yield for your hassle however trust within the destiny you sincerely be a part of your statistics better.

카지노사이트목록 说:
2024年2月27日 01:17

Thanks a ton for your time and effort to have positioned these items together in this weblog. Janet and i moreover very masses desired your guidelines via your articles on high-quality matters. I realize which you have a whole lot of needs to your own software as a result the fact that you took all of the time much like you did to guide human beings similar to us with the resource of this text is likewise pretty valued.

카지노헌터 说:
2024年2月27日 01:17

I loved as a good buy as you’ll get preserve of finished right proper right here. The cartoon is tasteful, your authored trouble rely elegant. Though, you command get were given an edginess over which you preference be turning in the following. Ill truly come greater previously over again given that precisely the identical nearly hundreds often inner case you defend this increase.

เว็บไซท์ แทงบอลออนไล 说:
2024年2月27日 01:19

My plate is actual complete and your tryna deliver me greater food, boy what the fuck is incorrect wit’ you?!First-fee layout of factors you actually regular a B+ almost about effort and tough artwork. Where exactly you genuinely misplaced me personally became first on the facts. You recognize, they are saying, the devil is in the info… And it couldn’t be an awful lot greater correct right right here. Having stated that, allow me say to you what did supply the results. Your textual content is quite convincing and this might be the reason why I am making an attempt to be able to opine. I do no longer surely make it a everyday addiction of doing that. Second, whilst I can without difficulty word a leaps in reasoning you're making, I am virtually now not glad of exactly the way you appear to unite your facts which in turn help to make your very last result. For now I shall yield for your hassle however trust within the destiny you sincerely be a part of your statistics better.

먹튀검증업체 说:
2024年2月27日 01:19

“I surely needed to thank you very a great deal once more. I do now not recognise the things that I may have completed within the absence of the complete statistics discussed via you referring to my theme. This become a tough subject for my part, but coming across this professional method you treated it forced me to weep with happiness. I might be grateful for this assistance and for that reason pray you apprehend what a powerful job which you are doing teaching the mediocre ones through your websites. Probably you have by no means met absolutely everyone.”

검증사이트 说:
2024年2月27日 02:06

In the digital age, small payment cashing has become an important financial service. By choosing the right company and using their services carefully, users can have a safe and efficient cashing experience. This article aims to provide valuable information to help users use these services wisely.

메이저놀이터 说:
2024年2月27日 02:07

Faast Pharmacy proudly serves as an official supplier of medical products, partnering with international pharmaceutical companies that deliver licensed medications worldwide. By establishing direct collaborations with manufacturers, we provide medications at wholesale prices, enabling our customers to save more than 100% off the original drug costs.

토토사이트 说:
2024年2月27日 02:08

I exactly wanted to realize you all all once more. I do not recognize what I ought to have determined within the absence of the shape of strategies revealed by way of way of you at once on that industry. It had been a hard condition for my part, but , locating out this specialised manner you dealt with the trouble compelled me to leap for pride. I’m thankful in your assist and further pray you discover what a first-rate procedure you are constantly putting in coaching women and men through a weblog. Most possibly you’ve in no way come across everyone.

토토마트 说:
2024年2月27日 02:10

There are a handful of captivating elements over time inside the following paragraphs however I don’t recognize if I see they all middle to coronary coronary coronary heart. There’s a few validity however I maximum surely will take hold opinion till I take a look at into it further. Excellent article , thank you therefore we need a good buy greater! Added to FeedBurner as well

먹튀검증사이트 说:
2024年2月27日 02:10

Last but not least, understand that cryptocurrency arbitrage is not really a guaranteed in full road to riches. It requires determination, continuous understanding, and a willingness to adapt. Show patience, keep disciplined, and always prioritize the protection of one's assets.

메이저놀이터 说:
2024年2月27日 03:13

I were venerated to reap a name from a chum as he determined the crucial guidelines shared at the internet page. Browsing your weblog post is a actual first rate enjoy. Thanks again for taking into account readers like me, and I want for you the best of achievements as being a expert area.

메이저사이트 说:
2024年2月27日 03:14

I simply needed to make a quick comment as a way to express gratitude for you for anyone wonderful pointers you happen to be posting here. My time consuming internet investigation has right at the end of waking time been rewarded with good quality ways of present to my guests. I would state that many people readers are actually endowed to take place in an incredible network with the greatest marvellous those with useful hints. I am quite privileged to own used your webpages and look toward really more fabulous minutes reading here. Many thanks for a number of things.

토토검증사이트 说:
2024年2月27日 03:15

Im growing articles upon cancers, which may be some tips i used to be to start with assignment study for whilst My associate and i discovered your blog post post. There are usually limitless fitness problems available that people are commonly being stricken by, I had no idea! This may be sturdy details, many thank you.

메이저놀이터순위 说:
2024年2月27日 03:15

There are pretty masses of facts that adheres to that to think about. That’s a super point to mention. I provide you with the thoughts above as wellknown concept however certainly there are simply questions such as the most effective you retrieve wherein maximum vital component will possibly be in honest excellent faith. I don?T determine if guidelines have emerged about items like that, but I comprehend your system is simply called an lower priced game. Both women and boys experience the impact of definitely a moment’s pride, for the the relaxation in their lives.

먹튀마루 说:
2024年2月27日 03:15

I’ve learned a few vital matters via your put up. I’d in my opinion also like to mention that there may be a state of affairs that you may attain a mortgage and in no manner need a co-signer which includes a Fed Student Aid Loan. In case you have emerge as financing thru a everyday financial organization you then need to be prepared to have a co-signer organized that will help you. The creditors will possibly base their very personal selection the usage of a few factors however the best might be your credit score rating ratings. There are a few loan investors if you want to furthermore take a look at your artwork history and make a preference based totally totally on that but in almost all instances it's going to rely on your ratings.

카이소 说:
2024年2月27日 03:16

The Gems Bonanza slot from the online slot site takes players into the sparkling world of shining diamonds and precious stones. Its richly colored graphic design and smooth animations create an exciting and engaging atmosphere. The game's reels are decorated with a variety of precious stones, including emeralds, sapphires, topaz, rubies, and amethysts. The beautiful background with bright colors adds a luxurious feel to this game.

먹튀검증사이트 说:
2024年2月27日 03:18

The Gems Bonanza slot from the online slot site takes players into the sparkling world of shining diamonds and precious stones. Its richly colored graphic design and smooth animations create an exciting and engaging atmosphere. The game's reels are decorated with a variety of precious stones, including emeralds, sapphires, topaz, rubies, and amethysts. The beautiful background with bright colors adds a luxurious feel to this game.

안전토토사이트 说:
2024年2月27日 03:18

Nothing on this planet is while important being a parent when you have the effect of the lifestyle of another man. For your kids to have great results, you ought to make certain he has the many tools to achieve this entire world. Remember, the globe can always be cruel for you to anyone, the two adults along with children.

토토사이트추천 说:
2024年2月27日 03:51

After studies some of of the blog posts to your net web page now, and I truly like your way of taking walks a weblog. I bookmarked it to my bookmark net website online document and may be checking over again soon. Pls check my internet internet website as nicely and allow me comprehend what you agree with you studied.

먹튀검증업체 说:
2024年2月27日 03:52

BTW, and I choice we do not drag this too prolonged, but care to remind us genuinely what form of guns have been getting used on Kurds with the useful resource of Saddams military? To the track of hundreds of hundreds of dull Talk about re-written information

먹튀검증커뮤니티 说:
2024年2月27日 03:54

Nice placed up. I discover some thing greater difficult on numerous blogs ordinary. Most normally it is stimulating to take a look at content from different writers and use a hint something from their internet site on line. I’d prefer to use some at the equal time as the use of content by myself weblog regardless of whether you do now not mind. Natually I’ll provide link for your net blog. Many thanks sharing.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter