Re: Strange Segmentation Fault



In article <pan.2006.06.22.18.01.59.226931@xxxxxxxxxxx>,
Tim Evers <devnull@xxxxxxxxxxx> wrote:
Es schrieb roberson@xxxxxxxxxxxxxxxxxx (Walter Roberson):

In article <pan.2006.06.22.17.36.45.448101@xxxxxxxxxxx>,
Tim Evers <devnull@xxxxxxxxxxx> wrote:

linux system, apache w. suexec, perl, graphviz (2.8).

A perl script calls the graphviz binary. This works perfectly in a console
but fails with a segfault when called under Apache/mod_cgi/perl

I think you'd better take this question to a linux newsgroup.
comp.lang.c only deals with matters that are expressible in standard C
but large parts of apache and suexec and perl require system-specific
extensions.

Thanks for the tip - I will do that, but all the Apache/Perl stuff ist not
problem specific and just presented "colorandi causa".

Ah? Then you've been able to reproduce the problem without using
apache or perl? Until you are able to create a test case that does
not rely on those factors, you cannot know whether they are
contributing to the problem or not.


This is a strace excerpt:
27137 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)

mmap() and mmap2() are not part of standard C.


[Off topic]
When you are running under apache mod_perl, you are going to have
libraries loaded into your address space that you would not otherwise
have loaded. Depending on where the system's memory allocator
places allocated memory relative to loaded libraries, that could
result there being a noticably smaller available allocatable space.
Are you checking all of your malloc()'s to see if they perhaps
return the NULL pointer?

Alternately, it is potentially a case not of running out of virtual
memory, but rather that the virtual memory gets located in a different
place when those libraries are loaded, and that the difference in
location is making visible a bug you have in using a bad pointer
or in accessing an array out of bounds.

So, are you *sure* that
"all the Apache/Perl stuff is not problem specific" ?
--
"law -- it's a commodity"
-- Andrew Ryan (The Globe and Mail, 2005/11/26)
.



Relevant Pages

  • [UNIX] Denial of Service in Apache HTTP Server 2.x
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... The Apache Software Foundation's HTTP Server Project is an effort to ... A memory leak in Apache server, allows a remote user to exhaust system ... Remote exploitation of a memory leak in the Apache HTTP Server causes the ...
    (Securiteam)
  • Re: packet drop with intel gigabit / marwell gigabit
    ... Attached is a shell script to watch mbuf usage in 1 second interval. ... If you do not see such memory problem, then you need to prepare to use ... when i stop apache it falls back to 0,1-0,2%, starting apache again and got ...
    (freebsd-performance)
  • Re: mod_php and Fast CGI
    ... even done any basic tuning of your apache. ... system could cope (memory wise) with a lot more then 300 concurrent ... I am thinking about using fastcgi as not all these 286 httpd process ... php, say 100 process, and let them share) ...
    (comp.lang.php)
  • Get mod_auth_oracle to work on Freebsd
    ... as we are moving from single server to multiple ... However, when I tried to restart apache with the new module, I've got the ... out of memory allocating callback ... error while loading shared libraries ...
    (freebsd-questions)