apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yuri V. Vishnevskiy" <yuri.vishnevs...@gmail.com>
Subject Crash in apr_file_close() (Win32)
Date Sat, 19 Sep 2009 16:34:34 GMT
Dear All,
I have a problem with using stdout stream opened by apr_file_open_stdout()  
function. If I open several stdout handlers in my program then it crashes  
when calls apr_file_close() function more than one time.

The following simple code reproduces such error:

int main(int a, char** b)
apr_pool_t * pool;
apr_file_t *file1, *file2;

  apr_pool_create(&pool, NULL);

  apr_file_open_stdout(&file1, pool);
  apr_file_open_stdout(&file2, pool);

  apr_file_puts("Hello World (1)\n", file1);
  apr_file_puts("Hello World (2)\n", file2);

  apr_file_close(file2); // <-- crash is here.



System: WinXP SP3, x86.
APR: 1.3.8
Compiler: Visual Studio 2008 SP1 (15.00.30729.01)

Is this bug or feature?

Yura Vishnevskiy

View raw message