Opened 13 years ago
Closed 8 years ago
#7232 closed defect (fixed)
fix tachyon segfault introduced by #6542
Reported by:  was  Owned by:  was 

Priority:  major  Milestone:  sage6.4 
Component:  graphics  Keywords:  tachyon 
Cc:  mhampton, niles  Merged in:  
Authors:  Frédéric Chapoton  Reviewers:  KarlDieter Crisman, Niles Johnson 
Report Upstream:  N/A  Work issues:  
Branch:  f8cb975 (Commits, GitHub, GitLab)  Commit:  f8cb9754f8ac01164e98fc11fa731a0b66ab0648 
Dependencies:  Stopgaps: 
Description (last modified by )
This pretty much says it all:
sage: a = 1 sage: b = 0 sage: c = 0 sage: sage: f = lambda t: ((a*c*cos(t)  b*sin(t))/sqrt(a^2+b^2), (b*c*cos(t) + ....: a*sin(t))/sqrt(a^2+b^2), cos(t)*sqrt(a^2+b^2)) sage: t = Tachyon(camera_center=(0,0,0)) sage: t.texture('t') sage: t.light((20,20,40), 0.2, (1,1,1)) sage: t.parametric_plot(f,0,2*pi,'t',min_depth=6) sage: sage: t.show() sh: line 1: 2214 Segmentation fault tachyon /Users/wstein/.sage//temp/flat.local/2161//tmp_2.dat format PNG o /Users/wstein/.sage//temp/flat.local/2161//tmp_1.png > /dev/null
Note, that this was I think caused by #6542.
Attachments (2)
Change History (26)
comment:2 Changed 12 years ago by
 Cc mhampton added
 Report Upstream set to N/A
comment:3 Changed 9 years ago by
(Still) Reproducible with Sage 5.8.beta3... :)
comment:4 Changed 9 years ago by
Interestingly, it segfaults after having read the whole input file (and also with just one thread):
(sagesh) $ tachyon tachyonexample.dat +V numthreads 1 format PNG o tachyonexample.png Tachyon Parallel/Multiprocessor Ray Tracer Version 0.98.9 Copyright 19942010, John E. Stone <john.stone@gmail.com>  Scene Parsing Time: 0.0052 seconds CPU Information: Node 0: 2 CPUs, CPU Speed 1.00, Node Speed 2.00 Name: sleepless Total CPUs: 2 Total Speed: 2.000000 Scene contains 514 objects. Global bounds: 0.1 1.1 1.1 > 0.1 1.1 1.1 Creating top level grid: X:12 Y:12 Z:12 Grid: X: 12 Y: 12 Z: 12 Cells: 1728 Obj: 513 Obj/Cell: 0.297 Scene contains 1 nongridded objects Allocating Image Buffer. Preprocessing Time: 0.0088 seconds Segmentation fault: 0% complete
(But the segfault actually completes. ;) )
Changed 9 years ago by
Tachyon input file for the example given in the ticket's description. (Plain text)
Changed 9 years ago by
Tachyon input file generated by the example in sage/plot/plot3d/tachyon.py
, around line 490 (as of Sage 5.8.beta3). (Plain text)
comment:5 Changed 9 years ago by
Tachyon seems to bomb out on the original example in the limit as camera_center>(0,0,0). Then, from tachyon.py viewdir=(0,0,0), which may not make sense; although on other examples I've tried when camera_center and viewdir are the zero vector then Tachyon returns an empty image. For the given example using
t = Tachyon(camera_center=(1.e30,1.e30,1.e30))
does give, a not very interesting, image. How small vector_center can be and not cause Tachyon to bomb out my be hardware/software specific. With
t = Tachyon(camera_center=(3,3,0))
I get an image similar to the parametric_plot() output. This sounds like a Tachyon bug.
comment:6 followup: ↓ 7 Changed 9 years ago by
Just built Sage 5.8.rc0 on a Linux x86 box (Pentium4 Prescott, GCC 4.7.2), and there testing sage/interfaces/tachyon.py
doesn't give a (silent) segfault, but instead:
Tachyon Parallel/Multiprocessor Ray Tracer Version 0.98.9 Copyright 19942010, John E. Stone <john.stone@gmail.com>  Scene Parsing Time: 0.0002 seconds Scene contains 1 objects. Preprocessing Time: 0.0000 seconds Rendering Progress: 100% complete Ray Tracing Time: 0.0523 seconds writetgaregion: file ptr out of range!!! Image I/O Time: 0.0036 seconds
(One only sees this with verbose
.)
comment:7 in reply to: ↑ 6 Changed 9 years ago by
Replying to leif:
Just built Sage 5.8.rc0 on a Linux x86 box (Pentium4 Prescott, GCC 4.7.2), and there testing
sage/interfaces/tachyon.py
doesn't give a (silent) segfault, but [...]
Ooops, perhaps more importantly, verbosely testing sage/plot/plot3d/tachyon.py
doesn't show any errors.
comment:8 Changed 9 years ago by
... after 75+ minutes CPU time, this Tachyon is still at 0% rendering progress for the example from the description ... 8/
comment:9 Changed 9 years ago by
... while the example from the doctest renders quick and well.
comment:10 Changed 9 years ago by
 Milestone changed from sage5.11 to sage5.12
comment:11 Changed 9 years ago by
 Milestone changed from sage6.1 to sage6.2
comment:12 Changed 8 years ago by
 Milestone changed from sage6.2 to sage6.3
comment:13 Changed 8 years ago by
 Keywords tachyon added
comment:14 Changed 8 years ago by
 Branch set to u/chapoton/7232
 Commit set to be9cf5a30a96fdde6628b0d5d173762cf78db1c3
comment:15 Changed 8 years ago by
 Status changed from new to needs_review
comment:16 Changed 8 years ago by
 Cc niles added
comment:17 Changed 8 years ago by
 Commit changed from be9cf5a30a96fdde6628b0d5d173762cf78db1c3 to 29b7beb39447ccf297b3abeabfb8e564623c331e
Branch pushed to git repo; I updated commit sha1. New commits:
29b7beb  Rebasing on 6.3.rc1

comment:18 Changed 8 years ago by
 Commit changed from 29b7beb39447ccf297b3abeabfb8e564623c331e to f8cb9754f8ac01164e98fc11fa731a0b66ab0648
Branch pushed to git repo; I updated commit sha1. New commits:
f8cb975  trac #7232 oops, mistake in merge, now corrected

comment:19 Changed 8 years ago by
 Milestone changed from sage6.3 to sage6.4
comment:20 followup: ↓ 21 Changed 8 years ago by
I think this is a reasonably way to handle this given how long it's been, and a good doctest, but a brief reminder here about what the default camera center and look at are might be helpful.
comment:21 in reply to: ↑ 20 Changed 8 years ago by
Replying to kcrisman:
I think this is a reasonably way to handle this given how long it's been, and a good doctest, but a brief reminder here about what the default camera center and look at are might be helpful.
Actually, I think I like the error message better the way it is. Listing the defaults will be hard to maintain (in the unlikely case that they change later), unless we print them from some attribute. But that makes printing the error depend on successfully determining the value of the attribute, making it slower and more prone to error itself. I think the error message currently gives all the necessary information with a minimum of overhead and complication.
Maybe as a compromise, if necessary, print "see init method for default values" ?
comment:22 Changed 8 years ago by
 Status changed from needs_review to positive_review
Actually, I think I like the error message better the way it is. Listing the defaults will be hard to maintain (in the unlikely case that they change later), unless we print them from some attribute. But that makes printing the error depend on successfully determining the value of the attribute, making it slower and more prone to error itself. I think the error message currently gives all the necessary information with a minimum of overhead and complication.
Fair enough, okay.
Maybe as a compromise, if necessary, print "see init method for default values" ?
Well, it's actually in the Tachyon?
documentation, not even just init, so I think then you've convinced me this is fine.
comment:23 Changed 8 years ago by
 Reviewers set to KarlDieter Crisman, Niles Johnson
comment:24 Changed 8 years ago by
 Branch changed from u/chapoton/7232 to f8cb9754f8ac01164e98fc11fa731a0b66ab0648
 Resolution set to fixed
 Status changed from positive_review to closed