#2749: WVUThorns: sprintf use violates standard
Reporter: Erik Schnetter
Status: new
Milestone:
Version:
Type: bug
Priority: minor
Component: EinsteinToolkit thorn
Comment (by Roland Haas):
alternatively \(if one needs control over formatting\) one can use something like:
```
snprintf(buffer+strlen(buffer), sizeof(buffer) - strlen(buffer), "...", particle_u4U0[which_particle])
```
where one leaves out the first “buffer” \(and its “%s”\).
Alternatively, if this, as I suspect, is written to a file anyway, just use multiple `fprintf` calls which do use buffering anyway so will typically only write \(to a file\) in 1k or so chunks. If this is ASCII file IO, then any optimization on the code part is premature anyway since IO \(and the binary to ASCII conversion\) will be the slow parts anyway \(well unless one plasters the code with many many malloc/new/string/osstream object creations that is\).
--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2749/wvuthorns-sprintf…
#2695: Inclusion of AsterX in the Einstein Toolkit
Reporter: Jay Kalinani
Status: new
Milestone: ET_2023_11
Version:
Type: enhancement
Priority: minor
Component: EinsteinToolkit thorn
Comment (by tootle):
@{557058:088051f9-5b94-4b5e-bfbe-71137030b9c1} No problem
--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2695/inclusion-of-aste…
#2695: Inclusion of AsterX in the Einstein Toolkit
Reporter: Jay Kalinani
Status: new
Milestone: ET_2023_11
Version:
Type: enhancement
Priority: minor
Component: EinsteinToolkit thorn
Comment (by Samuel Cupp):
Also, @{5accca1cc8c4282b41e130e4} , if anyone else should be listed as contributors on the release please let me know and make sure to double-check those lists when they come out. There’s been some issues in the past regarding people not getting listed because the release managers weren’t informed that there were additional code authors. “Contributor” here generally means major contributors to the AsterX thorns, similar to paper authorship.
--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2695/inclusion-of-aste…
#2695: Inclusion of AsterX in the Einstein Toolkit
Reporter: Jay Kalinani
Status: new
Milestone: ET_2023_11
Version:
Type: enhancement
Priority: minor
Component: EinsteinToolkit thorn
Comment (by Samuel Cupp):
@{5e5fc4216e8fdd0cd81720ad} Hey Samuel. Are you still willing to review AsterX? If so, I’ll send out an email with info \(though you’ve gone through this process recently\) to you and Jay.
--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2695/inclusion-of-aste…
#2749: WVUThorns: sprintf use violates standard
Reporter: Erik Schnetter
Status: new
Milestone:
Version:
Type: bug
Priority: minor
Component: EinsteinToolkit thorn
Comment (by Samuel Cupp):
@{5bae587b96242d2e2b6110a4}
--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2749/wvuthorns-sprintf…
#2752: Parameter file parser generates illegal (?) C code
Reporter: Erik Schnetter
Status: new
Milestone:
Version:
Type: bug
Priority: major
Component: Cactus
I see this warnings when building the autogenerated Cactus bindings:
```
/Users/eschnett/Cactus/configs/sim-debug/bindings/Parameters/TwoPunctures_BBHSF_Parameters.c: In function 'CCTKi_BindingsCreateTwoPunctures_BBHSFParameters':
/Users/eschnett/Cactus/configs/sim-debug/bindings/Parameters/TwoPunctures_BBHSF_Parameters.c:193:116: warning: unknown escape sequence: '\p'
193 | "Exponent delta for conformal decomposition of the scalar field \phi = \psi^delta \bar\phi",
| ^
/Users/eschnett/Cactus/configs/sim-debug/bindings/Parameters/TwoPunctures_BBHSF_Parameters.c:193:116: warning: unknown escape sequence: '\p'
/Users/eschnett/Cactus/configs/sim-debug/bindings/Parameters/TwoPunctures_BBHSF_Parameters.c:193:116: warning: unknown escape sequence: '\p'
```
It seems that a parameter description in a ccl file contains latex code, and the parameter file parse does not properly escape backslashes when generating C strings for them.
--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2752/parameter-file-pa…
#2751: EHFinder: Array reference out of bounds
Reporter: Erik Schnetter
Status: new
Milestone:
Version:
Type: bug
Priority: minor
Component:
Building EHFinder I see this warning:
```
/Users/eschnett/Cactus/arrangements/EinsteinAnalysis/EHFinder/src/EHFinder_IsoSurface_optimized.F90:448:10:
445 | do j=241,257
| 2
......
448 | a(j,i)=b9(i,jj)
| 1
Warning: Array reference at (1) out of bounds (257 > 256) in loop beginning at (2)
```
--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2751/ehfinder-array-re…
#2750: HTTPD: Array access out of bounds
Reporter: Erik Schnetter
Status: new
Milestone:
Version:
Type: bug
Priority: minor
Component: EinsteinToolkit thorn
Building HTTPD I see these warnings:
```
In function 'StringSetToBuffer',
inlined from 'StringSetToBuffer' at /home/eschnetter/Cactus/arrangements/CactusConnect/HTTPD/src/SString.c:268:1,
inlined from 'StringSetToCString' at /home/eschnetter/Cactus/arrangements/CactusConnect/HTTPD/src/SString.c:226:10:
/home/eschnetter/Cactus/arrangements/CactusConnect/HTTPD/src/SString.c:273:7: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
273 | strncpy( s->chars, buf, len );
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/eschnetter/Cactus/arrangements/CactusConnect/HTTPD/src/SString.c: In function 'StringSetToCString':
/home/eschnetter/Cactus/arrangements/CactusConnect/HTTPD/src/SString.c:226:10: note: length computed here
226 | return StringSetToBuffer( s, c_string, strlen( c_string ) );
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
and
```
In function 'String_Copy',
inlined from 'StringInsert' at /home/eschnetter/Cactus/arrangements/CactusConnect/HTTPD/src/SString.c:396:26:
/home/eschnetter/Cactus/arrangements/CactusConnect/HTTPD/src/SString.c:125:3: warning: 'memcpy' offset [0, 2] is out of the bounds [0, 0] [-Warray-bounds=]
125 | memcpy( s->line_end, other->line_end, LINE_END_BUFSIZE
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
126 | * sizeof( SSCHAR ) );
| ~~~~~~~~~~~~~~~~~~~~
```
These look serious.
--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2750/httpd-array-acces…
#2749: WVUThorns: sprintf use violates standard
Reporter: Erik Schnetter
Status: new
Milestone:
Version:
Type: bug
Priority: minor
Component: EinsteinToolkit thorn
I see these warnings when building WVUThorns:
```
/Users/eschnett/Cactus/arrangements/WVUThorns_Diagnostics/particle_tracerET/src/file_output_routines.C: In function 'void particle_tracerET_file_output_ascii(cGH*)':
/Users/eschnett/Cactus/arrangements/WVUThorns_Diagnostics/particle_tracerET/src/file_output_routines.C:143:14: warning: 'sprintf' argument 3 overlaps destination object 'buffer' [-Wrestrict]
143 | sprintf(buffer, "%s %e %e %e %e", buffer, particle_u4U0[which_particle], particle_u4U1[which_particle], particle_u4U2[which_particle], particle_u4U3[which_particle]);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/eschnett/Cactus/arrangements/WVUThorns_Diagnostics/particle_tracerET/src/file_output_routines.C:154:14: warning: 'sprintf' argument 3 overlaps destination object 'buffer' [-Wrestrict]
154 | sprintf(buffer, "%s %e %e %e %e", buffer, particle_u4D0[which_particle], particle_u4D1[which_particle], particle_u4D2[which_particle], particle_u4D3[which_particle]);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/eschnett/Cactus/arrangements/WVUThorns_Diagnostics/particle_tracerET/src/file_output_routines.C:132:12: warning: 'sprintf' argument 3 overlaps destination object 'buffer' [-Wrestrict]
132 | sprintf(buffer, "%s %e %e %e", buffer, particle_position_x[which_particle], particle_position_y[which_particle], particle_position_z[which_particle]);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
COMPILING WVUThorns_Diagnostics/particle_tracerET/src/Interpolate_velocities_at_particle_positions.C
```
The C/C\+\+ standards do not allow writing the buffer to itself \(although this is a convenient way to append to a string\).
Since this is C\+\+ code I suggest to use `std::ostringstream` instead.
--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2749/wvuthorns-sprintf…
#2695: Inclusion of AsterX in the Einstein Toolkit
Reporter: Jay Kalinani
Status: new
Milestone: ET_2023_11
Version:
Type: enhancement
Priority: minor
Component: EinsteinToolkit thorn
Comment (by Samuel Cupp):
Hi @{5e5fc4216e8fdd0cd81720ad} . Thanks for offering to help. We asked Bruno’s group but haven’t heard back yet. If they do respond soon, I would see whether AsterX or SpaceTimeX is in more need of a second reviewer and ask you to help with that. If we don’t hear anything back, Jay and I would greatly appreciate you reviewing AsterX.
--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2695/inclusion-of-aste…