Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 614131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:04:44+00:00 2026-05-13T18:04:44+00:00

I’m working on integrating rLog with our code base, and I’m noticing a problem

  • 0

I’m working on integrating rLog with our code base, and I’m noticing a problem on Windows that I don’t have on linux. In a header file I have a static variable that gives me a “verbose” logging channel (one up from debug basically), defined thusly:

static RLogChannel *rlog_verbose = DEF_CHANNEL("verbose", Log_Debug);

There’s no problem with this on Linux, but on Windows I get an error as soon as the application starts.

I’ve tracked it down to this line in the rLog library:

RLogChannel *rlog::GetComponentChannel(const char *component, const char* path, LogLevel levl) {
...
if(!gRootChannel)
    gRootChannel = new RLogChannel( "", level );
...
}

The problem is that the call to new is returning a NULL pointer, which goes unchecked
and the program promptly crashes when it’s accessed. Are there rules related to allocating memory in a global context on Windows that I’m not away of?

Edit: I’m pretty sure this must be something related to the order of initialization of static objects. I wanted to be sure that I wasn’t missing something obvious re: memory allocation on Windows. Thanks all!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:04:44+00:00Added an answer on May 13, 2026 at 6:04 pm

    are you sure its returning null. It might be the whole static initializer thing. The order of static initializer invocations is not defined from file to file. If you have static code that is using rlog_verbose then gRootCHannel might well be NULL simply because the initializer hasn’t been called yet.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 375k
  • Answers 375k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer x = decimal.Decimal('8.00000000000000000000001') with decimal.localcontext() as ctx: ctx.prec=100000000000000000 ctx.rounding=decimal.ROUND_CEILING y… May 14, 2026 at 8:14 pm
  • Editorial Team
    Editorial Team added an answer Just add one to the second argument of your range… May 14, 2026 at 8:14 pm
  • Editorial Team
    Editorial Team added an answer For now I have decided to just use a simple… May 14, 2026 at 8:14 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.