Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the program crushed with empty file write error message. #297

Open
YQGong opened this issue Jun 7, 2024 · 2 comments
Open

the program crushed with empty file write error message. #297

YQGong opened this issue Jun 7, 2024 · 2 comments

Comments

@YQGong
Copy link

YQGong commented Jun 7, 2024

The program runs perfectly until I switch to a new computer with a 32-threads cpu(i9-13900HX) and windows10(version 19044.1288).

The command and the verbose error message looks like:

PoissonRecon.exe --in pcd_out.ply --envelope envelope_mesh.ply --out mesh_poisson.ply --verbose --threads 1
*************************************************************
*************************************************************
** Running Screened Poisson Reconstruction (Version 16.01) **
*************************************************************
*************************************************************
        --in pcd_out.ply
        --out mesh_poisson.ply
        --envelope envelope_mesh.ply
        --verbose
        --threads 1
Input Points / Samples: 356630 / 88844
# Read input into tree: 0.1 (s), 43.7 (MB) / 92.8 (MB)
#   Got kernel density: 0.0 (s), 0.0 (MB) / 92.8 (MB)
#     Got normal field: 0.1 (s), 59.5 (MB) / 92.8 (MB)
Point depth / Point weight / Estimated measure: 9.37992 / 1.86572e-06 / 0.665373
#               Initialized envelope constraints: 1.7 (s), 155.3 (MB) / 202.4 (MB)
#Initialized point interpolation constraints: 0.0 (s), 0.0 (MB) / 202.4 (MB)
#       Finalized tree: 0.1 (s), 70.9 (MB) / 202.4 (MB)
#  Set FEM constraints: 0.4 (s), 76.9 (MB) / 202.4 (MB)
#Set point constraints: 0.0 (s), 67.1 (MB) / 202.4 (MB)
All Nodes / Active Nodes / Ghost Nodes / Dirichlet Supported Nodes: 563497 / 563112 / 385 / 58957
Memory Usage: 67.0586 MB
Cycle[0] Depth[5/8]:    Updated constraints / Got system / Solved in:  0.002 /  0.023 /  0.005  (202 MB)        Nodes: 6309
Cycle[0] Depth[6/8]:    Updated constraints / Got system / Solved in:  0.005 /  0.015 /  0.005  (202 MB)        Nodes: 30302
Cycle[0] Depth[7/8]:    Updated constraints / Got system / Solved in:  0.013 /  0.051 /  0.026  (202 MB)        Nodes: 133059
Cycle[0] Depth[8/8]:    Updated constraints / Got system / Solved in:  0.001 /  0.140 /  0.056  (202 MB)        Nodes: 318052
# Linear system solved: 0.4 (s), 80.1 (MB) / 202.4 (MB)
Got average: 0.0 (s), 64.6 (MB) / 202.4 (MB)
Iso-Value: 0.485563 = 173166 / 356630
[ERROR] C:\Research\PoissonRecon\PoissonRecon\Src\MyMiscellany.h (Line 359)
        FileBackedReadWriteStream::FileDescription::FileDescription
        Failed to open file:

I found an old issue here but I'm not sure if this issue is relevant to mine:
#101

PS: I have tried 16.01 and 16.04 version PoissonRecon.exe. Adding a --threads 1 has no effect to this problem.

@YQGong
Copy link
Author

YQGong commented Jun 7, 2024

After replace _mktemp( fileName ); with an auto-increment integer string, the problem fixed. So I'm pretty sure the problem is the same as this one: #101

@mkazhdan
Copy link
Owner

mkazhdan commented Jun 7, 2024

I was recently informed that switching the code:
_mktemp( fileName );
fp = fopen( fileName , "w+b" );
if( !fp ) ERROR_OUT( "Failed to open file: " , fileName );

with:
errno_t err = tmpfile_s(&fp);
if (err != 0)
{
std::cerr << "tmpfile_s failed with error: " << err << std::endl;
ERROR_OUT("Failed to create a unique temporary file.");
}

resolves the problem. I have not had a chance to try it out yet (but I am also not generating the error).
Not sure why this is issue has started surfacing recently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants