Windows error 0x00000128, 296

Detailed Error Information


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

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 Code296 (0x0128)

Possible solutions


How to make a enum with values over max int allowed?


In C++11, you can specify the underlying type of the enum.

#include <cstdint>

enum VStates : uint64_t {
    // Values

On a side note, I recommend against calculating out all of those powers of two. You made an error in your calculations by writing a hex constant but giving it the digits of a base-10 numeral. However, rather than recalculating all of those, I recommend something like:

#include <cstdint>

enum VStates : uint64_t {
    DRY = 1ULL << 0,
    WET = 1ULL << 1,
    HOT = 1ULL << 2,
    COLD = 1ULL << 3,
    // etc.

Then you are sure not to make a mistake. The ULL suffix ensures that the literal is accepted as at least a 64-bit wide integer.

answered on Stack Overflow Nov 14, 2012 by David Stone

How to make a enum with values over max int allowed?


(Note: to make my answer complete I'll add in something I didn't take time to notice but others have pointed out: you're using the 0x prefix, which means your numbers would be interpreted as hexadecimal. They'd not actually be powers of two, and your bitflag tests would not have worked!)

If your enumerations are running out of control like this, don't use an enumerated type. Use something like a std::bitset. Then your enum can just be a simple numbered list of names for the positions of the bits in the set...and you won't be exhausting your enumeration space exponentially!

For example:

enum VState {
    /* ... */

bitset<VState_Max> state;

state[COLD] = true;
if (state[COLD]) {
    cout << "I am cold\n";

Now your enum is just small, maintainable numbers and you don't have to worry about being on a 64-bit platform or whatnot.

I note that you gave a value of "0" for NEUTRAL in your original example. If your intent was to have it be possible to use this in combination with other things...such as being able to be state = NEUTRAL | INVULNERABLE | SHADOW and individually test for NEUTRAL, that wouldn't have worked before. It will'd just keep it in the enumeration for indexing the bitset.

But if it intended as a name for "nothing set", then you would remove it from the enum and instead test for no bits set with:

if (state.none()) {
    // we are in the "NEUTRAL" state of nothing set...

...and if you wanted to set all the bits to false, you'd go with:

answered on Stack Overflow Nov 14, 2012 by HostileFork • edited Nov 14, 2012 by HostileFork

How to make a enum with values over max int allowed?


The enumeration has 31 non-zero values, so they can all fit in a 32-bit unsigned value. The problem is that the values here aren't bit-values. Either write them as decimal values (remove the 0x from the front) or write them as hexadecimal values (0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, etc.) I personally don't like it, but some people write this kind of constant with shifts: 1<<0, 1<<1, 1<<2, 1<<3, etc.

answered on Stack Overflow Nov 14, 2012 by Pete Becker

How to make a enum with values over max int allowed?


If you are using C++11, you can declare a strongly-typed enum with a defined type as unsigned long long (_int64 in Windows, though you should probably use the portable uint64_t), if that extends your range far enough.

Thanks to Joachim for a link to examples of C++11 enum usage: Strongly Typed Enums

answered on Stack Overflow Nov 14, 2012 by im so confused

using shared memory in cuda gives memory write error


You may find useful info on how to work with shared memory in this article. Focus especially on static shared memory and dynamic shared memory sections.

Based on above article you should find out that you are simply writing out of bounds of your array s, exactly as the error message says. To fix the issue you can:

  • either specify the size of shared memory array s at compile time, if you know it in advance, such as __shared__ float3 s[123456];
  • or use dynamically sized s array, thats basically what you are doing at the moment, but ALSO specify the third kernel launch parameter as CalcSTLDistance_Kernel<<<gridSize, blockSize, sharedMemorySizeInBytes>>>. In case you will be using an array of 123456 float3s then use int sharedMemorySizeInBytes = 123456 * sizeof(float3)
answered on Stack Overflow Aug 26, 2014 by Michal Hosala

Decoding flags are not working correctly


On further debugging I found the solution to my problem.

I had to adjust my DecodeImportFlags method:

void CImportOCLMAssignmentHistoryDlg::DecodeImportFlags()
    m_bImportOCLMChairman = (m_iImportFlags & ImportAssignment::OCLMChairman) ? TRUE : FALSE;
    m_bImportOCLMOpenPrayer = (m_iImportFlags & ImportAssignment::OCLMOpenPrayer) ? TRUE : FALSE;
    m_bImportOCLMClosePrayer = (m_iImportFlags & ImportAssignment::OCLMClosePrayer) ? TRUE : FALSE;
    m_bImportOCLMConductorCBS = (m_iImportFlags & ImportAssignment::OCLMConductorCBS) ? TRUE : FALSE;
    m_bImportOCLMReaderCBS = (m_iImportFlags & ImportAssignment::OCLMReaderCBS) ? TRUE : FALSE;
    m_bImportPTChairman = (m_iImportFlags & ImportAssignment::PTChairman) ? TRUE : FALSE;
    m_bImportPTHospitality = (m_iImportFlags & ImportAssignment::PTHospitality) ? TRUE : FALSE;
    m_bImportWTConductor = (m_iImportFlags & ImportAssignment::WTConductor) ? TRUE : FALSE;
    m_bImportWTReader = (m_iImportFlags & ImportAssignment::WTReader) ? TRUE : FALSE;

It m_iImportFlags & ImportAssignment::XXXXX returns the actual flag value. So I needed conditional testing so that the BOOL could be set correctly.

Update: These are the ways I now declare the flags:

enum ImportAssignment
    OCLMChairman     = 1,
    OCLMOpenPrayer   = 2,
    OCLMClosePrayer  = 4,
    OCLMConductorCBS = 8,
    OCLMReaderCBS    = 16,
    PTChairman       = 32,
    PTHospitality    = 64,
    WTConductor      = 128,
    WTReader         = 256*/
    None             = 0,
    OCLMChairman     = 1 << 0,
    OCLMOpenPrayer   = 1 << 1,
    OCLMClosePrayer  = 1 << 2,
    OCLMConductorCBS = 1 << 3,
    OCLMReaderCBS    = 1 << 4,
    PTChairman       = 1 << 5,
    PTHospitality    = 1 << 6,
    WTConductor      = 1 << 7,
    WTReader         = 1 << 8
answered on Stack Overflow Nov 19, 2016 by Andrew Truckle • edited Nov 19, 2016 by Andrew Truckle

Seg Fault in ARM Assembly


The answer to my question was actually really simple. Since ldr r0, =beagle_bone_0 loads the address of beagle_bone_0 into register 0 I can just manipulate beagle_bone_0 with that address.

Working test code:

    .syntax unified


beagle_bone_0:  .ascii  "Hello, world\n"


    .global main

    push    {ip, lr}

    ldr     r0, =beagle_bone_0
    mov     r1, #0x65
    strb    r1, [r0]

    bl      printf

    pop     {ip, pc}
answered on Stack Overflow Dec 7, 2014 by schmidt73

Decoding Stack Trace error


It looks to be related to your creation of a new SpeechRecognizer in the Loaded event of the MainPage.

answered on Stack Overflow Sep 26, 2013 by Matt Lacey

How to make a enum with values over max int allowed?


Use smaller numbers. An enum can only be as big as a long. The size of a long depends on the compiler, but a typical size is either 32 or 64 bits. I see some 10 digit hex numbers there, those are too big.

answered on Stack Overflow Nov 14, 2012 by Gabe Sechan

Stream from IP Camera very jittery on VLC


Because read is a blocking call, you should either manage non-blocking read or use a thread. But your kernel module doesn't seems to implement select/poll callback.

Then a first step could be to call the read outside from the live555 mainloop using an additionnal thread like this :

#include "DeviceSource.hh"
#include <GroupsockHelper.hh> // for "gettimeofday()"
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <pthread.h>

static uint8_t buf[131072];
int upp_stream; 
EventTriggerId DeviceSource::eventTriggerId = 0;
unsigned DeviceSource::referenceCount = 0;
pthread_t thid;
bool stop = false;

static void* thread(void* clientData) 
    DeviceSource* This = ((DeviceSource*)clientData);
    while (!stop) 
        if (This->isCurrentlyAwaitingData())
            ::read(upp_stream, buf, sizeof(buf));
            This->envir().taskScheduler().triggerEvent(DeviceSource::eventTriggerId, This);
    return NULL;

DeviceSource* DeviceSource::createNew(UsageEnvironment& env) { return new DeviceSource(env); }
DeviceSource::DeviceSource(UsageEnvironment& env):FramedSource(env) 
    if (referenceCount == 0) 
        upp_stream = open("/dev/upp",O_RDWR);
        pthread_create(&thid, NULL, thread, this);
        eventTriggerId = envir().taskScheduler().createEventTrigger(deliverFrame0);

DeviceSource::~DeviceSource(void) {
    if (referenceCount == 0) 
        pthread_join(thid, NULL);

        eventTriggerId = 0;

void DeviceSource::doGetNextFrame() {}

void DeviceSource::deliverFrame0(void* clientData) { ((DeviceSource*)clientData)->deliverFrame(); }
void DeviceSource::deliverFrame() 
    if (!isCurrentlyAwaitingData()) return; // we're not ready for the data yet
    //Bitwise Shift hex from buf[12] to buf[15] to get data count  
    unsigned int data_count2 = (buf[12] << 24)|(buf[13]<<16)|(buf[14]<<8)|buf[15];

    u_int8_t* newFrameDataStart = (uint8_t*)buf;
    unsigned newFrameSize = sizeof(buf);//f_size; 
    // Deliver the data here:
    if (newFrameSize > fMaxSize) 
        fFrameSize = fMaxSize;
        fNumTruncatedBytes = newFrameSize - fMaxSize;
        fFrameSize = newFrameSize;
    gettimeofday(&fPresentationTime, NULL); //chk this 
    memmove(fTo, newFrameDataStart, fFrameSize);

As you notice this simple sample doesnot read frame in background. This needs to implement a FIFO between the two threads.

It could be build using :

CPPFLAGS=-pthread LDFLAGS=-pthread make
answered on Stack Overflow Feb 1, 2015 by mpromonet • edited Feb 15, 2015 by mpromonet

uPP Device Driver is dropping data from buffer


In case you would like to submit the driver to upstream (which actually a right way to go), you probably may contact with TI guys who are working with DaVinci boards. I assume you already googled the link DaVinci Wiki.

Regarding to your driver it's hard to check due to its code style. Moreover you may check modern kernel APIs for stuff you are trying to program manually (voltage regulators, clocks, pin control, and so on). For many basic devices there are already drivers and setup. Also you have to describe you board configuration in device tree. Usually it means to create an additional (to the common) piece of configuration and put it under arch/arm/boot/dts/. There you may find da850 predefined data bases.

answered on Stack Overflow Jan 7, 2015 by 0andriy

Seg Fault in ARM Assembly


I ran and debugged your code. The line mov r0, beagle_bone_0 didn't even compile (on my compiler, at least). You want to load in r0 the address of beagle_bone. For this, you should use the adr pseudo-instruction, that is translated by the compiler in a pc-relative move (something like mov r0, [pc, #8]. You cannot use it this way. Probably your compiler translated it into something different.

So, to fix it, just replace the line mov r0, beagle_bone_0 by adr r0, beagle_bone_0.

Also the string was in the .text section which we cannot edit. So, I put beagle_bone_0 in the .data section.

answered on Stack Overflow Dec 7, 2014 by Paul92 • edited Dec 7, 2014 by user61382


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