POV-Ray : Newsgroups : povray.unofficial.patches : compiling megapov.. Server Time
16 Apr 2024 08:25:05 EDT (-0400)
  compiling megapov.. (Message 1 to 6 of 6)  
From: Shihan
Subject: compiling megapov..
Date: 10 Nov 2006 11:30:01
Message: <web.4554a7fdf42c2ca769dedb9b0@news.povray.org>
I'm running on amd64 with fedora core 5 and having not much fun with
megapov.

I've got povray 3.6.1 on the system (compiled from source) and im trying to
do the same with megapov 1.2.1 but not having much luck.

I finally figured out I had to add povray's library directives to megapov's
ini file, but now its just crashing out when trying to render bear.pov:

  0:00:00 Creating bounding slabs
  0:00:00 Creating vista bufferSegmentation fault
[xxxx@xxxxx scenes]$

Theres not much in terms of documentation for compiling (megapov) from
sources, so have I missed something important?


Post a reply to this message

From: Nicolas Calimet
Subject: Re: compiling megapov..
Date: 10 Nov 2006 17:25:17
Message: <4554fc4d$1@news.povray.org>
>   0:00:00 Creating bounding slabs
>   0:00:00 Creating vista bufferSegmentation fault

	Try the following and report the output:

./configure COMPILED_BY=you --enable-debug
make
gdb unix/megapov
run scenes/bear.pov
backtrace

	- NC


Post a reply to this message

From: Shihan
Subject: Re: compiling megapov..
Date: 11 Nov 2006 01:30:01
Message: <web.45556d01bb14a4e969dedb9b0@news.povray.org>
Nicolas Calimet <pov### [at] freefr> wrote:
> >   0:00:00 Creating bounding slabs
> >   0:00:00 Creating vista bufferSegmentation fault
>
>  Try the following and report the output:
>
> ./configure COMPILED_BY=you --enable-debug
> make
> gdb unix/megapov
> run scenes/bear.pov
> backtrace
>
>  - NC

Here ya go:
  0:00:01 Creating vista buffer
Program received signal SIGSEGV, Segmentation fault.
0x00000038ec873cb0 in strlen () from /lib64/libc.so.6
(gdb) bt
#0  0x00000038ec873cb0 in strlen () from /lib64/libc.so.6
#1  0x00000038ec85dcae in fputs () from /lib64/libc.so.6
#2  0x00000000004407a6 in pov::POV_Std_Display_Init (w=Variable "w" is not
available.
) at userdisp.cpp:66
#3  0x0000000000423c42 in pov::FrameRender () at rendctrl.cpp:554
#4  0x0000000000423e4a in pov::FrameLoop () at rendctrl.cpp:329
#5  0x000000000041e0b5 in povray_cooperate () at povray.cpp:571
#6  0x0000000000408dd5 in main (argc=3, argv=0x7fffd321da88) at
unix.cpp:3010
(gdb)


Post a reply to this message

From: George Pantazopoulos
Subject: Re: compiling megapov..
Date: 11 Nov 2006 02:35:00
Message: <web.45557c1abb14a4e9c0bad8570@news.povray.org>
> Nicolas Calimet <pov### [at] freefr> wrote:
> > >   0:00:00 Creating bounding slabs
> > >   0:00:00 Creating vista bufferSegmentation fault
> >
> >  Try the following and report the output:
> >
> > ./configure COMPILED_BY=you --enable-debug
> > make
> > gdb unix/megapov
> > run scenes/bear.pov
> > backtrace
> >
> >  - NC
>
> Here ya go:
>   0:00:01 Creating vista buffer
> Program received signal SIGSEGV, Segmentation fault.
> 0x00000038ec873cb0 in strlen () from /lib64/libc.so.6
> (gdb) bt
> #0  0x00000038ec873cb0 in strlen () from /lib64/libc.so.6
> #1  0x00000038ec85dcae in fputs () from /lib64/libc.so.6
> #2  0x00000000004407a6 in pov::POV_Std_Display_Init (w=Variable "w" is not
> available.
> ) at userdisp.cpp:66
> #3  0x0000000000423c42 in pov::FrameRender () at rendctrl.cpp:554
> #4  0x0000000000423e4a in pov::FrameLoop () at rendctrl.cpp:329
> #5  0x000000000041e0b5 in povray_cooperate () at povray.cpp:571
> #6  0x0000000000408dd5 in main (argc=3, argv=0x7fffd321da88) at
> unix.cpp:3010
> (gdb)

I had a similar problem with one of my megapov_xrs_server users on amd64
with Fedora Core 5. I got some important clues using gdb and though I
didn't get all the way to the root of the problem, in my case, just
providing -D on the command line was an acceptable workaround (since the
server never should have a render display).

Hope this helps,
George
http://www.gammaburst.net


Post a reply to this message

From: Nicolas Calimet
Subject: Re: compiling megapov..
Date: 11 Nov 2006 07:59:45
Message: <4555c941$1@news.povray.org>
> #0  0x00000038ec873cb0 in strlen () from /lib64/libc.so.6
> #1  0x00000038ec85dcae in fputs () from /lib64/libc.so.6
> #2  0x00000000004407a6 in pov::POV_Std_Display_Init (w=Variable "w" is not
> available.
> ) at userdisp.cpp:66

	OK, the problem was introduced in megapov and is simple to fix.
Edit the file source/userdisp.cpp and change the line 65 from:
	char *s = NULL;
to
	char *s = "";
and the segmentation fault should go away.  Do the same at lines 97 and 117.

	Even better, as the AVOID_EMPTY_STRING_WARNING megapov patch is quite
ugly IMHO, you may apply the following *untested* patch (the code should work,
but I cannot verify whether it will fill its purpose of avoiding a compiler
warning).  Paste the following into  patchfile  and apply the patch as:

patch -p0 < patchfile


% cat patchfile
--- userdisp.cpp.bak    2005-08-23 21:20:33.000000000 +0200
+++ userdisp.cpp        2006-11-11 13:57:09.000000000 +0100
@@ -62,8 +62,7 @@
    Prev_X = 0;
    Prev_Y = 0;
    #ifdef AVOID_EMPTY_STRING_WARNING
-    char *s = NULL;
-    fprintf(stderr, "%s", s);
+    fprintf(stderr, "%s", "");
    #else
      fprintf(stderr, "");
    #endif
@@ -94,8 +93,7 @@
  void POV_Std_Display_Close()
  {
    #ifdef AVOID_EMPTY_STRING_WARNING
-    char *s = NULL;
-    fprintf(stderr, "%s", s);
+    fprintf(stderr, "%s", "");
    #else
      fprintf(stderr, "");
    #endif
@@ -114,8 +112,7 @@
      Prev_Y++;

    #ifdef AVOID_EMPTY_STRING_WARNING
-    char *s = NULL;
-    fprintf(stderr, "%s", s);
+    fprintf(stderr, "%s", "");
    #else
      fprintf(stderr, "");
    #endif


	Hope this helps,
	- NC


Post a reply to this message

From: Shihan
Subject: Re: compiling megapov..
Date: 11 Nov 2006 09:15:01
Message: <web.4555dac4bb14a4e969dedb9b0@news.povray.org>
Nicolas Calimet <pov### [at] freefr> wrote:
> > #0  0x00000038ec873cb0 in strlen () from /lib64/libc.so.6
> > #1  0x00000038ec85dcae in fputs () from /lib64/libc.so.6
> > #2  0x00000000004407a6 in pov::POV_Std_Display_Init (w=Variable "w" is not
> > available.
> > ) at userdisp.cpp:66
>
>  OK, the problem was introduced in megapov and is simple to fix.
> Edit the file source/userdisp.cpp and change the line 65 from:
>  char *s = NULL;
> to
>  char *s = "";
> and the segmentation fault should go away.  Do the same at lines 97 and 117.
>
>  Even better, as the AVOID_EMPTY_STRING_WARNING megapov patch is quite
> ugly IMHO, you may apply the following *untested* patch (the code should work,
> but I cannot verify whether it will fill its purpose of avoiding a compiler
> warning).  Paste the following into  patchfile  and apply the patch as:
>
> patch -p0 < patchfile
>
>
> % cat patchfile
> --- userdisp.cpp.bak    2005-08-23 21:20:33.000000000 +0200
> +++ userdisp.cpp        2006-11-11 13:57:09.000000000 +0100
> @@ -62,8 +62,7 @@
>     Prev_X = 0;
>     Prev_Y = 0;
>     #ifdef AVOID_EMPTY_STRING_WARNING
> -    char *s = NULL;
> -    fprintf(stderr, "%s", s);
> +    fprintf(stderr, "%s", "");
>     #else
>       fprintf(stderr, "");
>     #endif
> @@ -94,8 +93,7 @@
>   void POV_Std_Display_Close()
>   {
>     #ifdef AVOID_EMPTY_STRING_WARNING
> -    char *s = NULL;
> -    fprintf(stderr, "%s", s);
> +    fprintf(stderr, "%s", "");
>     #else
>       fprintf(stderr, "");
>     #endif
> @@ -114,8 +112,7 @@
>       Prev_Y++;
>
>     #ifdef AVOID_EMPTY_STRING_WARNING
> -    char *s = NULL;
> -    fprintf(stderr, "%s", s);
> +    fprintf(stderr, "%s", "");
>     #else
>       fprintf(stderr, "");
>     #endif
>
>
>  Hope this helps,
>  - NC

Yes, this does indeed work, as does the -D. With the patch, -D is no longer
required.

Thanks heaps guys!


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.