P-Code Generation Segmentation Fault

1 Ansicht (letzte 30 Tage)
D G
D G am 8 Mai 2012
Kommentiert: Frank Drop am 16 Okt. 2014
Hello!
I am running a script to recursively generate p-code. This has been working fine up until 2012a, but now it gives a segmentation fault on a single specific file every time I try to run it for a certain application.
Is there something that I need to update along with MATLAB? What could cause this?
Thanks

Akzeptierte Antwort

Sean de Wolski
Sean de Wolski am 8 Mai 2012
Bearbeitet: Sean de Wolski am 14 Okt. 2014

Weitere Antworten (2)

Frank Drop
Frank Drop am 14 Okt. 2014
I am having exactly the same issues. I am recursively walking through a number of folders and pcode'ing their content. The first run works, the second time I run the code (within a MATLAB session) I get a segmentation error. After restarting MATLAB I can run the code once, and then I get a segmentation error again.
  1 Kommentar
Sean de Wolski
Sean de Wolski am 14 Okt. 2014
Frank, what is the result of the following after the first run?
op = fopen('all')
If anything is open, if you
fclose all
Does the crash still happen?

Melden Sie sich an, um zu kommentieren.


Frank Drop
Frank Drop am 15 Okt. 2014
Bearbeitet: Frank Drop am 15 Okt. 2014
After I run the recursive function I do op = fopen('all') which gives an empty array as result:
op =
[]
Then before rerunning I do
fclose all
But the problem persist.
I did some more tests with the function. Basic functionality is:
function recursivePCode(sourceFolder,destinationFolder)
cd(destinationFolder); % The function moves to the folder where the p code should reside.
pcode(sourceFolder); % Creates the p functions and stores it in destinationFolder
for all subfolders in destinationFolder
recursivePCode(sourceFolder/subfolder_n,destinationFolder/subfolder_n);
end
end
Now, if I run:
recursivePCode('D:\sourceFolder','D:\destinationFolder');
recursivePCode('D:\sourceFolder','D:\destinationFolder');
recursivePCode('D:\sourceFolder','D:\destinationFolder');
It will give a segmentation error during the second recursivePCode call. However, if I run...
recursivePCode('D:\sourceFolder','D:\destinationFolder1');
recursivePCode('D:\sourceFolder','D:\destinationFolder2');
recursivePCode('D:\sourceFolder','D:\destinationFolder3');
... all is fine. It seems overwriting the existing pcode is the problem. So now I attempt to delete the existing p-files in the destination folder before running pcode(), but the problem still persists.
The pcode function appears to crash on p-coding a classdef folder called '@CacheProcessData5'.
  5 Kommentare
Sean de Wolski
Sean de Wolski am 15 Okt. 2014
If you can create a minimal working example, please send it to MathWorks Tech Support so that they can pass it along to development. Unless it's in a custom MEX file, a bug in your code should not cause a segv.
Frank Drop
Frank Drop am 16 Okt. 2014
I just tried reproducing the problem, but even without deleting the files in the destination folder, the problem does not arise anymore.
I am guessing now that it (also) had something to do with the fact that the destination folder is a shared network folder (shared in the windows network) and perhaps other PCs had a lock on this folder or something like that? If the problem comes back I will post again.
Are segmentation errors more likely on old installations or perhaps sensitive to updates to the JVM? I've once ran into segmentation errors all of a sudden (no change to the matlab code) when I first ran the particular code on a certain morning (java updates are automatically installed here at work during night time). I traced this segmentation error down to a
load('somematfile.mat')
statement, which would load a variable 'd' to the function workspace, after which the function would operate on d. The segmentation error disappeared after adding
d = [];
on the line before the load statement.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by