Windows error 0x00000031, 49

Detailed Error Information

PHASE0_INITIALIZATION_FAILED[1]

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

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.
FlagsSeveritySuccess

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
OriginMicrosoft
NTSTATUSfalse
Reserved (X)false
FacilityCode0 (0x000)
NameFACILITY_NULL[2][3]
DescriptionThe default facility code.[2][3]
Error Code49 (0x0031)

Possible solutions

4

DLR Routing failure in Kannel in a situation where there is a separate receiver and transceiver bind

sms
sms-gateway
smpp
kannel

As I can see from log and configuration file, you use different smsc sections for transmitter and receiver connections.

So when Kannel tries to find original message it use smsc and message-id parameters. In your case smsc will have different values on submit_sm and deliver_sm processing.

To resolve it just set-up single smsc group with:

  1. both port and receive-port inside
  2. transceiver-mode = 0 parameter (mean transmitter/receiver mode)

Note: this port may be the same and often is the same on SMSC.

Example (part of configuration):

group=smsc
smsc=smpp
smsc-id=rx_tx_bind
interface-version=34
transceiver-mode = 0
host=smsc.host.was.here
port=TX_PORT
receive-port=RX_PORT
# other parameters here
answered on Stack Overflow Nov 29, 2011 by michael.bochkaryov
2

ctypes: Passing string by reference

python
ctypes

A direct translation of your C code would be more like:

from ctypes import *
x = windll.LoadLibrary("x.dll")
iProgSize = c_int(0)
szProgSize = create_string_buffer(50)
pszProgSize = c_char_p(addressof(szProgSize))
getAdmSize = x.GetAdmSize
getAdmSize.argtypes = [POINTER(c_int), POINTER(c_char_p), c_int]
status = getAdmSize(byref(iProgSize), byref(pszProgSize), 49)

Fake DLL I tested with:

typedef int X_ERROR;
typedef int INT;
typedef char CHAR;

#include <string.h>

__declspec(dllexport) X_ERROR __stdcall GetAdmSize(INT* piAdmSize, CHAR** chBuf, INT iBufSize)
{
    *piAdmSize = 5;
    strcpy_s(*chBuf,iBufSize,"abcd");
    return 1;
}

Results:

>>> x.iProgSize
c_long(5)
>>> x.pszProgSize
c_char_p('abcd')
>>> x.szProgSize.value
'abcd'
answered on Stack Overflow May 26, 2012 by Mark Tolonen
1

How to change a property class in sub class in Objective-C

objective-c

One thing you could do is declare a LineChartModel variable and not property and @synthesize dataModel to that ivar:

@interface LineChartViewController: ChartViewController {
     LineChartModel *_lineChartModel;
}
-(void)drawLine;
@end

@implementation LineChartViewController
synthesize dataModel = _lineChartModel;
....

So from the outside it looks like you have a ChartModel, but inside the class you have LineChartModel. You will have to apply changes to _lineCharModel directly inside your class.

HOWEVER this is NOT my definition of better OOP!!! There's clearly a fault with the design if you need to cast your variables in subclass.


Another option I discovered after pasting this code into the editor is just use self.variable (which by the way, you should've already been doing).

@interface ChartModel : NSObject
- (BOOL)chartModelhasData;
@end

@interface LineChartModel : ChartModel
- (UIColor *)getLineColor;
@end

@interface ChartViewController: UIViewController
@property (nonatomic, strong) ChartModel *dataModel;
- (void)layoutChartCanvas;
@end

@implementation ChartViewController
- (void)layoutChartCanvas {
    if ([self.dataModel chartModelhasData]) {
        self.view.hidden = NO;
    }
}
@end

@interface LineChartViewController : ChartViewController
// pay attension here, same name but a sub class of chartModel
@property (nonatomic, strong) LineChartModel *dataModel;
- (void)drawLine;
@end

@implementation LineChartViewController
- (void)drawLine {
    UIColor *color = [self.dataModel getLineColor];
    [self drawLine];
}
@end
answered on Stack Overflow Apr 10, 2015 by Lord Zsolt • edited Apr 10, 2015 by Lord Zsolt
1

How to change a property class in sub class in Objective-C

objective-c

Probably you want to say:

Can I change the class C of a property already declared in a base class in a subclass to a subclass of C?

This is the set-up

@interface PropertyClass : NSObject
@end

@interface PropertySubclass : PropertyClass
- (void)method;                              // Additional method
@end

@interface HolderClass : NSObject
@property PropertyClass *property;           // Property is of base class
@end

@implementation HolderClass
@end

@interface HolderSubclass : HolderClass
@property PropertySubclass *property;        // Property is of subclass
@end

I have no problem to access the property subclass' method in the holder's subclass:

@implementation HolderSubclass
- (void)useIt
{
  [self.property method]; // No error or warning
}
@end

In addition to my comment below, I suspect that something like this happens:

// Create a subclass' object
HolderSubclass *object1 = [HolderSubclass new]; 
…

// Refer this object from a reference that is typed to HolderClass
// **This applies to all usages of self inside @implementation HolderClass**
HolderClass *object2 = object1; // Of course more complex

id value = [object2 method]; // Error

This error is correct. If this is the error, it is solvable. But first we have to clarify that.


BTW: This has nothing to do with better OOP. First of all this is a problem of class based programming languages, not of object orientated programming languages. Second I cannot see that this set-up will break a rule of class based or object orientated programming, esp. it fulfills Liskov's rule.

http://en.wikipedia.org/wiki/Liskov_substitution_principle

answered on Stack Overflow Apr 10, 2015 by Amin Negm-Awad • edited Apr 10, 2015 by Amin Negm-Awad
1

FSharpTypeFunc.Specialize causing TypeLoadException

exception
f#

Sent it to fsbugs and received a reply that it's been fixed.

answered on Stack Overflow Jun 7, 2012 by Daniel
0

Inconsistent behaviour while testing a c++ application for performance

c++
exception
performance-testing
xerces-c

The exception you posted seems to be an access violation (0xc00000005). A C++ exception will not catch these unless you have structured exception handling turned on (SEH) when you built your application.

But the other issue is that you know what the exception is, so how do you fix it? That is a different thing altogether. From the looks of it, the xerces code is attempting to dereference a NULL pointer.

You should have handy a debuggable version of the xerces library (which comes with full source code), and attempt to duplicate the crash using that version. Then at least you can see exactly what is happening at the crash location and how it occurred.

answered on Stack Overflow Mar 21, 2014 by PaulMcKenzie • edited Mar 21, 2014 by PaulMcKenzie
0

ctypes: Passing string by reference

python
ctypes

Figured it out I think. I also had to specify the return type:

getAdmSize.restype = X_ERROR
answered on Stack Overflow May 25, 2012 by Baz
0

buffer overflow exploit experiment, unexpected result

c
security
buffer-overflow

In your exploit experiment you seem to have lost track of the order of buffers and variable.
Your output (together with variable declarations in the code) clearly shows:

  • buffer_two, size 8, address 0x...0c
  • buffer_one, size 8, address 0x...14
  • value , size 4, address 0x...1c

(Size of value is guess, but irrelevant, assuming it has the LSB on lowest byte address.)

When buffer_two overflows by 9 bytes, it will fill buffer_one completely, first byte of value with '1' == 49 and second byte of value with 0.

To repeat, all of that is, strictly speaking, UB and therefor wild guessing. But that is the normal environment of exploits, which you are probably aware of.

answered on Stack Overflow Oct 8, 2017 by Yunnosch
0

Linux syscall in vmlinux and virtual memory

linux
memory
linux-kernel
reverse-engineering
system-calls

The useless ret is a stub that is replaced by the right code once the memory has been mapped. The code of system calls maybe located to different places depending on some non-deterministic choices and once the memory address is known, the stub is replaced.

answered on Stack Overflow May 19, 2014 by Thomas Coudray
0

32-bit pointer overflow in 64-bit gcc code - fails in compile

pointers
gcc
compiler-errors
fortran
gfortran

I just ran into the same problem with GNU Fortran (GCC) 5.1.0 in a Mac running 10.11.5 but the solution offered by the OP did not work for me.

However, I did find a solution: after systematically pruning my rather pedestrian legacy code, I found that every array has to be explicitly filled with something. You can't start filling it within your code. I know it sounds silly, but once I initialized every "real" array (32 bit, it is legacy code) with 0.0 before I did any I/O or other work, it linked without complaint.

And, yes, as with the OP, my code worked until I changed the size of an array.

The reason why this worked may be in the contents of this bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63793 but I am not good enough to tell you how to come up with a better workaround. My only guess is that initializing every array at the beginning favors the GOT instead of the RIP. (When will this be fixed? I just don't know how to push this up the line and the bug report is dated 2014-11-09)

answered on Stack Overflow Jun 3, 2016 by HackerPhysicist

Comments

Leave a comment

(plain text only)

Sources

  1. https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/bug-check-code-reference2
  2. https://msdn.microsoft.com/en-us/library/cc231198.aspx
  3. winerror.h from Windows SDK 10.0.14393.0

User contributions licensed under CC BY-SA 3.0