Ask a Question related to UNIX Programming, Design and Development.
-
Liam Darragh Whalen #1
call to close causing Segmentation fault
I'm calling close on a valid file descriptor, I've added a check with
select to make sure the file descriptor is valid, and it is causing a
Segmentation fault.
Whenever I comment out the call to close I no longer get the
Segmentation fault. The code uses SSL to open the connect and the
problem occurs right after a call to
SSL_read fails. The wierd thing is it doesn't cause the Segmentation
fault right away. It first returns from the function calling the
close() and prints a message then the
Segmentation fault happens. I know it is the close that is doing it
though because the Segmentation fault goes away when I comment out the
close() call.
Anybody every come accross something like this?
Liam
Liam Darragh Whalen Guest
-
#17281 [Com]: session_encode is causing segmentation fault
ID: 17281 Comment by: miguelangel dot gonzalez at itesm dot mx Reported By: rubens_gomes at hotmail dot com Status: ... -
#26020 [Opn->Bgs]: preg_replace causing segmentation fault
ID: 26020 Updated by: sniper@php.net Reported By: coldrain at workingonit dot org -Status: Open +Status: ... -
#26020 [Fbk->Opn]: preg_replace causing segmentation fault
ID: 26020 User updated by: coldrain at workingonit dot org Reported By: coldrain at workingonit dot org -Status: ... -
#26020 [Opn]: preg_replace causing segmentation fault
ID: 26020 User updated by: coldrain at workingonit dot org Reported By: coldrain at workingonit dot org Status: Open... -
#26020 [NEW]: preg_replace causing segmentation fault
From: coldrain at workingonit dot org Operating system: Linux PHP version: Irrelevant PHP Bug Type: PCRE related Bug... -
Jens.Toerring@physik.fu-berlin.de #2
Re: call to close causing Segmentation fault
Liam Darragh Whalen <lwhalen@cabletv.on.ca> wrote:
Probably the segmentation fault has really nothing to do with the> I'm calling close on a valid file descriptor, I've added a check with
> select to make sure the file descriptor is valid, and it is causing a
> Segmentation fault.
> Whenever I comment out the call to close I no longer get the
> Segmentation fault. The code uses SSL to open the connect and the
> problem occurs right after a call to
> SSL_read fails. The wierd thing is it doesn't cause the Segmentation
> fault right away. It first returns from the function calling the
> close() and prints a message then the
> Segmentation fault happens. I know it is the close that is doing it
> though because the Segmentation fault goes away when I comment out the
> close() call.
close() call but some memory corruption happening somewhere else
in your program. You probably have written past the end of an array
or to memory locations that have not been allocated to your process.
This often leads to segfaults at seemingly random and unrelated places,
e.g. in some libc function calls. I would recommend to get a memory
checker (valgrind, purify or one of the many other) and/or switching
on the memory checker build into newer glibc's (if you have it) by
compiling with the -DLIBC_MDEBUG flag.
Regards, Jens
--
_ _____ _____
| ||_ _||_ _| [email]Jens.Toerring@physik.fu-berlin.de[/email]
_ | | | | | |
| |_| | | | | | [url]http://www.physik.fu-berlin.de/~toerring[/url]
\___/ens|_|homs|_|oerring
Jens.Toerring@physik.fu-berlin.de Guest
-
David Schwartz #3
Re: call to close causing Segmentation fault
"Liam Darragh Whalen" <lwhalen@cabletv.on.ca> wrote in message
news:3F03D58B.71E3BA62@cabletv.on.ca...
Troubleshoot! Compile with symbols, get a core dump, run 'gdb'.> I'm calling close on a valid file descriptor, I've added a check with
> select to make sure the file descriptor is valid, and it is causing a
> Segmentation fault.
DS
David Schwartz Guest



Reply With Quote

