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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:06:06+00:00 2026-05-16T20:06:06+00:00

(this was asked on ffmpeg-devel list, but counted way offtopic, so posting it here).

  • 0

(this was asked on ffmpeg-devel list, but counted way offtopic, so posting it here).

ffmpeg.c loads multiple .c’s, that are using log.c’s av_log -> av_log_default_callback function, that uses fputs;

void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl)
{
...
snprintf(line, sizeof(line), "[%s @ %p] ", (*parent)->item_name(parent), parent);
... call to colored_fputs

Screen output:

static void colored_fputs(int level, const char *str){

...
fputs(str, stderr);

// this causes sigsegv just by fopen()
FILE * xFile;
xFile = fopen('yarr', 'w');
//fputs(str, xFile);fclose(xFile); // compile me. BOOM!
av_free(xFile); // last idea that came, using local free() version to avoid re-creatio

Each time, when fopen is put into code, it gives a segmentation fault of unknown reason. Why this kind of thing may happen here? Maybe due to blocking main I/O?

What are general ‘blockers’ that should be investigated in such a situation? Pthreads (involved in code somewhere)?

  • 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-16T20:06:07+00:00Added an answer on May 16, 2026 at 8:06 pm

    fopen takes strings as arguments, you’re giving it char literals

     xFile = fopen('yarr', 'w');
    

    Should be

    xFile = fopen("yarr", "w");
    if(xFile == NULL) {
      perror("fopen failed");
      return;
    }
    

    The compiler should have warned about this, so make sure you’ve turned warning flags on (remeber to read them and fix them)

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

Sidebar

Related Questions

(I asked this question in another way , and got some interesting responses but
I asked this question before, Here however I think I presented the problem poorly,
I asked this question a while back but now I'm looking to implement an
I asked this question: Serial Port (rs232) in Mono for multiple platforms and this
I originally asked this question on RefactorMyCode , but got no responses there... Basically
I asked this Can I automate creating a .NET web application in IIS? a
I've asked this question to the forums on the Mootools website and one person
I was asked this question in a job interview. The interviewer and I disagreed
I was asked this question during an interview. They're both O(nlogn) and yet most
I get asked this question a lot and I thought I'd solicit some input

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.