apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 44533] New: apr_dir_read segfaults
Date Tue, 04 Mar 2008 19:37:45 GMT

           Summary: apr_dir_read segfaults
           Product: APR
           Version: HEAD
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P3
         Component: APR
        AssignedTo: bugs@apr.apache.org
        ReportedBy: etienne.phillips@gmail.com


This code:
#include <stdio.h>
#include <apr_general.h>
#include <apr_file_io.h>

int main(int argc, const char *argv[])
        apr_pool_t *mp;

        apr_pool_create(&mp, NULL);

        apr_dir_t* dev_dir;
        apr_dir_open(&dev_dir, "/dev", mp);

        apr_finfo_t* fileinfo;

        while (apr_dir_read(fileinfo, 0, dev_dir) == APR_SUCCESS)

        return 0;


segfaults on line 17 (while apr_dir_read...) on Ubuntu 7.04 (kernel
2.6.20-15-generic) when compiled with gcc (GCC) 4.1.2 (Ubuntu 4.1.2-0ubuntu4).
This is on a VIA C7 x86 compatible processor.

The interesting bit of the crash, when run in gdb is:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1211336480 (LWP 7735)]
0xb7f77a82 in apr_dir_read () from /usr/lib/libapr-1.so.0
(gdb) bt
#0  0xb7f77a82 in apr_dir_read () from /usr/lib/libapr-1.so.0
#1  0x08048681 in main () at ../apr_testing.c++:17

This code runs perfectly on Mac OS X 10.4.11, when compiled with
i686-apple-darwin8-gcc-4.0.1, running on a MacBookPro 1,1 (Intel CoreDuo). I am
using the latest APR package on both platforms (apr-1.12).

Any ideas?

Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org

View raw message