Windows error 0x0000004C, 76

Detailed Error Information


This is a Blue Screen of Death stop code. More information is available in the Knowledge Base article Bug Check 0x4C: FATAL_UNHANDLED_HARD_ERROR.

HRESULT analysis[2]

This is probably not the correct interpretation of this error. The Win32 error above is more likely to indicate the actual problem.

This code indicates success, rather than an error. This may not be the correct interpretation of this code, or possibly the program is handling errors incorrectly.

Reserved (R)false
Reserved (X)false
FacilityCode0 (0x000)
DescriptionThe default facility code.[2][3]
Error Code76 (0x004c)

Possible solutions


iphone app crashes: work fine in development but when downloaded from itunes it crashes


When you say launched in AppleStore, do you mean from iTunes or do you mean it's been published by Apple already?

If you mean from iTunes and is an adhoc build have you checked your entitlements.plist? Another stackoverflow question about entitlements

If it is actually approved and on AppStore you can take a look at the crash logs generated by using the technique here.

How to get crash logs

Another possibility is if you're connecting with a real device for the first time and have a slow or intermittent connection and you're using a synchronous launch you may find that the IOS system is killing your app as it's taking > 10 seconds to respond so it's assumed it's crashed.

Not sure if any of this will help as we could really do with more details on the crash. E.g. does it work 100% in simulator, does it work from launching in Xcode, is it an debug/release/adhoc/distribution build, have you tried NSLog messages to narrow down where it's crashing?

answered on Stack Overflow Mar 4, 2011 by sradforth • edited May 23, 2017 by Community

How to build a multidimensional dictionary


You can build a multidimensional dictionary by letting values of a dictionary be another dictionary. For example, you could have a dictionary that you can access like this:

value = d["target K"]["product B"][1]


d = {"target J":{"product A":{0:"example01"}, "product B":{1:"example02"}}, 
     "target K":{"product B":{1:"example03"}}}

Also, btw, I took the "1", etc, out of quotes, as integers will work as dictionary keys.

The main restriction on dictionaries is that the keys must be hashable, in particular, not be dictionaries, but here they keys are either strings or integers, so it will work.

answered on Stack Overflow Jul 31, 2013 by tom10

Failure to get call stack in a debug build C++


Those errors are indicative of hardware exceptions due to an attempt on your part to access memory that your process cannot read or write. In particular, it looks like you are directly or indirectly attempting to access some element 76 bytes from the address referred to by some pointer, but that pointer is in fact null (thus the access violation reading location 0x0000004c).

Your debug information may not be invalid in any way, you simply may legitimately be in some code inside nt.dll -- for example, if you passed a null pointer to a Windows API function that does not permit them. If you don't have symbols loaded for nt.dll, you won't get a useful call stack.

It's also possible the access violation's coming from a bad pointer you passed that wasn't used until some callback was invoked by the Windows API, which might explain why you don't see your code anywhere in the stack frame.

Enabling break-on-throw in the VS IDE (Debug -> Exceptions, check the boxes for relevant exception types) can help you break earlier when this occurs, but may not help diagnosing the problem if it's legitimately not directly from your code.

You can also use structured exception handling to integrate these exceptions and C++'s exceptions for catching purposes. You may also want to look in to using a symbol server to get the symbols for the Windows DLLs.

answered on Stack Overflow Feb 25, 2013 by Josh Petrie

CREATE ASSEMBLY fails with "Unable to resolve token"


My testing indicates that the issue here is how the reference to the BigInteger Class Library is specified. Looking at the PaillierExt.csproj file, it shows the reference as including the version info:

<Reference Include="BigInteger, Version=, Culture=neutral, processorArchitecture=MSIL">

However, the ElGamalExt.csproj file shows the reference (for the same DLL) as being just the name of the DLL:

<Reference Include="BigInteger">

It appears that the default behavior for references in Database Projects is that the reference, if given a version #, is implied Version Specific = false, whereas in a Class Library, if the reference is given a version #, Version Specific is implied as true. In this case it might help to explicitly set the reference to Specific Version = false.

I was able to get all 3 of these projects to build and load successfully by copying the source code (the original that didn't work, not the updated code that moved things around) into 3 newly created Class Library projects. I copied things like Project GUID and references into the new .csproj files, but not the specific version info on that particular reference. I was then able to create a Database Project and a SQLCLR object that referenced the PaillierExt and ElGamalExt methods. Everything worked as expected.

I believe this also explains why it worked when the Assembly was registered as PERMISSION_SET = UNSAFE: it could very well be that the specific version info and implied Specific Version = true property are a recommendation to the CLR that is followed when Assemblies are either SAFE or EXTERNAL_ACCESS, but setting them to UNSAFE allows for by-passing that stated preference.

P.S. I'm not sure if this matters, but another difference from what I normally do is that in the AssemblyInfo.cs file, the AssemblyVersion attribute is using a * for the build #. I did not find that to be a complicating factor here, but if someone is still having an issue after removing the version specific info from the reference, then try replacing the * with a static value. The reason is that if the version # needs to be "specific", then it probably doesn't help to have part of the version # change on each build ;-).

Details regarding the tests, etc can be found in the discussion.

answered on Stack Overflow Sep 26, 2016 by Solomon Rutzky

Using sed and awk together to create replacement maps


There probably is a more-sophisticated answer to your question than given here (for example, doing the whole process with a single awk, python, or perl program), but until that answer appears you can automate your current process by using eval as below.

You say you are “printing out the sed command to use next, then manually copying and pasting the command and executing it”. Suppose XYZ is the pipeline that generates and prints the sed command. Instead of using XYZ to print/copy/paste, use it to create the sed command to execute, and then use eval to execute the command:

eval $SEDCOM

An example: If we say
t="echo do do do; echo da da da"
the resulting output is
do do do; echo da da da
but if we instead say
eval $t
the output is
do do do
da da da


uninitialized pointer of structure to the function


If you do not want to allocate the pointer in the main function, you have two possible solutions:

Solution 1

Do not pass the healthcare_table pointer to the load_healthcare_table() function, but rather return the initialized pointer from the function itself. Something along these lines:

int main() {
    healthcare_table *records;
    int step = 1;
    records = load_healthcare_table(&step);
    return 0;

In this case your load_healthcare_table() function would be:

healthcare_table* load_healthcare_table(int* step) {
    healthcare_table *table;
    table = (healthcare_table*)malloc(sizeof(healthcare_table));
    // Fill table here
    return table;

Important note In this case make sure you do not create the table locally to the load_healthcare_table() function. This would destroy the table once the function returns, resulting in garbage data. A function should never return a pointer to its local data. So the following example would be wrong:

healthcare_table* load_healthcare_table(int* step) {
    healthcare_table table;
    // Fill table here
    return &table;

Solution 2

Pass a pointer to a pointer of the healthcare_table to the function load_healthcare_table(). It would look something along these lines:

int main() {
    healthcare_table *records;
    int step = 1;
    return 0;

In this case, the load_healthcare_table() function will be:

void load_healthcare_table(healthcare_table** t, int* step ) {
    *t = (healthcare_table*)malloc(sizeof(healthcare_table));
    // Fill table here


As suggested by Ajay Brahmakshatriya: Sticking to standard C notion of local variables rather than going into stack terminologies.

answered on Stack Overflow May 19, 2017 by Brian Zammit • edited May 19, 2017 by Brian Zammit

uninitialized pointer of structure to the function


Although there is no use in passing an uninitialized pointer to a function, then it could be useful to pass an unallocated pointer as long as:

  • the pointer has been initialized to be a null-pointer.
  • the function either uses realloc() to reallocate memory for the pointer or check if it is a null-pointer before using malloc().
  • the function returns the pointer.

example code snippet (assuming the struct a_struct is defined):

a_struct *a_funct(a_struct *p);
int main(void)
    struct a_struct *p_a_struct = NULL;
    p_a_struct = a_funct(p_a_struct);
    return 0;

a_struct *a_funct(a_struct *p)
    // Does some stuff to find how many records p should point to.
    p = realloc(p, sizeof a_struct * number_of_records);
    // Check p for error.
    // Do more stuff?
    return p;

Or you could pass a pointer to a pointer to the function as has been mentioned in other answers.

answered on Stack Overflow May 19, 2017 by SiggiSv

Failure to get call stack in a debug build C++


Your exception isn't being caught, so it's moving up the call stack all the way to main and terminating your app.


If a matching handler (or ellipsis catch handler) cannot be found for the current exception, the predefined terminate run-time function is called.

There's usually an option to allow you to pause debugging when an exception is thrown.

How to: Break When an Exception is Thrown (Visual Studio 2012)

You could also have a catch statement at top level and examine the exception (.what() often gives an description) when you catch it.

Update: You most likely can't catch this exception because it's an Access violation (not a C++ exception, but the pause should still work afaik). If you're on Windows you could use SEH to catch it.

answered on Stack Overflow Feb 25, 2013 by CiscoIPPhone

iphone app crashes: work fine in development but when downloaded from itunes it crashes


Hopfully you have kept the dSym file for that particular build you submitted to iTunes.

You should then be able to open the crashlog in Xcode and have it symbolicate the crashlog lines like

Bagainfly 0x000020de 0x1000 + 4318
Bagainfly 0x00002074 0x1000 + 4212

into something meaningful in your code. Hopefully it will point you to the exact line in your app that is crashing.

Another problem is however that you are only seeing the tip of the iceberg. The crash reports available to you from Apple is heavily filtered. So if you are seeing crash reports in your developer account it means that your users are really getting hit heavy with the problem.

I can recommend a github project that will allow your users to directly send crash reports to you. This way you will get immediate notification when thigs start to go wrong and hopefully before your users start to abandon your app. You can grab the code here:

answered on Stack Overflow Mar 4, 2011 by Claus Broch

Not getting output in first Y86 program


There is a classic problem with the program: Lack of new-line in the ys file, causing YAS to misbehave.

The first problem is due to an error in YAS. If you look in the yo file produced by YAS you will see that the last .long 0 statement never gets defined. You will probably also see that the first line opcode in the yo file is 0x00, i.e. nop (when YAS encounter a final instruction without an associated newline, it wraps it around, screwing up the yo file)

This means that you loose the first irmovl Array, %edx (it becomes some sort of nonsense, probably 0x00000000, i.e. 4 nops,) and so you write the first read character x'30' (ascii for '0') to the location pointd to by edx (which is probably 0x00000000,) is in the first instruction (which was 4 nops -- remember that you read a character, but it ends up in a 4 byte register and is saved as such.) So you are writing 0x00000000 to and address that was 0x00000000, which to YIS means that the register was not changed and therefore it is not shown in the "Changes to Memory" dump section.

You repeat this with the second read, writing 0x00000001 in the second word (overwriting the instruction in that location,) and with the third read, writing 0x00000002 in the third word (overwriting the instruction in that location.)

Now, of course, you are completely hosed! You reset the pointer to the array (using edx,) and attempt to print the content, but Array(0), Array(4), and Array(8) contains 0x00000000, because that is what you defined it as (using your .long 4 statements for Array(0) and Array(4) and automatically for Array(8) since the default set-up for undefined memory in Y86 is 0x00000000. And so, the program prints x'00' (because you print one character from a 4 byte word,) which, of course, is junk.

You will note that this fits with the dump from YIS. eax does not show as it is unchanged from 0x00000000, its initial value. edx and edi look A-OK, with edi pointing to Array(8). The only memory that has changed is the second and third word of the program (which have been overwritten with 0x00000001 and 0x00000002, respectively)

So, in summary. YAS makes a mistake. You must overcome this problem by adding a new-line after the last .long 0 statement. YIS misleads you because, critically!, it does not throw exceptions when you overwrite code with data.

answered on Stack Overflow Nov 8, 2012 by pajacobsen • edited Nov 8, 2012 by Andrew Barber


Leave a comment

(plain text only)


  3. winerror.h from Windows SDK 10.0.14393.0

User contributions licensed under CC BY-SA 3.0