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 8177881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:37:59+00:00 2026-06-06T23:37:59+00:00

How to diagnose log log function error, that is when negative value is returned:

  • 0

How to diagnose log log function error, that is when negative value is returned:

/*
 * Send a formatted string to the log, used like printf(fmt,...)
 */
int __android_log_print(int prio, const char *tag,  const char *fmt, ...);

Thank you!

  • 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-06-06T23:38:00+00:00Added an answer on June 6, 2026 at 11:38 pm

    Short answer: check errno.

    Long answer: There appear two reasons __android_log_print can return a negative value. The first is if it’s unable to open any of the log files for writing (/dev/log/main, /dev/log/radio, or /dev/log/events). The second is if the write() system call returns a negative number.

    After __android_log_print returns a negative value, is errno set? If so, its value should give you some information about what went wrong. If errno is zero, your log call probably wound up in __write_to_log_null and you should investigate your program’s ability to open those /dev/log files.

    If errno is set, it’s possible that it was set when trying to open the log files. You should be able to isolate this case by setting errno = 0, then calling __android_log_bug_write with a bad log_id (first argument). For this to be useful, it’ll need to be the first call to any of the logging functions – otherwise the file opening stage will have been and gone. Obviously this is only necessary if errno is set to something that could have been at write time or at open time.

    This answer comes to you courtesy of system/core/liblog/logd_write.c.

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

Sidebar

Related Questions

I'm trying to diagnose a WCF service that is self-hosted in a relatively simple
I'm having an issue that I think is simple to diagnose, but I can't
I've got a native C++ application that I need to profile to diagnose performance
I am trying to diagnose an error in my cookies, but the names of
How can I diagnose apk install issues? I have an app that compiles and
Please could someone help diagnose this tiny problem that shouldn't be one - trying
I'm seeing a relatively strange (and hard to diagnose) error with a combination of
I have a website running a basic ASP.NET application that is mostly used from
I need a way to record the function stack trace in a debug log
I'm helping someone diagnose some slowness with their RoR applications. I'm not that deep

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.