IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

MATLAB Discussion :

erreur lors de la création d'un mapping


Sujet :

MATLAB

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Profil pro
    Inscrit en
    Juillet 2010
    Messages
    84
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2010
    Messages : 84
    Par défaut erreur lors de la création d'un mapping
    Bonjour,

    J'ai essayé de créé un fichier mapping pour transférer des données de grande taille, en utilisant la documentation de Mathworks à l'adresse ci-dessous:
    http://www.mathworks.com/company/new...emory_map.html

    Cependant une fois que j'ai mexé le fichier MMFile, et que j'exécute
    Matlab buggue et se ferme.

    J'ai essayé de voir quelles sont les lignes qui n'ont pas été exécutée et j'ai trouvé que c'est
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    		mxSetPr(plhs[0],hObj->getPointer());
    				mexPrintf("\tProblem 7 GetPointer.\n");
    		// Tell the mxArray the size of the data in the mem-map
    		mxSetN(plhs[0],hObj->getLength());
    				mexPrintf("\tProblem 8 getLength.\n");

    Visiblement il s'agit d'un problème sur le pointeur, n'est ce pas?

    Voici les messages d'erreur et le code

  2. #2
    Membre confirmé
    Profil pro
    Inscrit en
    Juillet 2010
    Messages
    84
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2010
    Messages : 84
    Par défaut
    quelques messages d'erreur:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    	Problem 1.
    	Problem 2.
    	Problem 5 nrhs!=1 persistent.
    	Problem 6 nrhs!=1 persistent.
     
     
    Abnormal termination at .\src\mem\alignment.cpp line 333:
    The pointer passed to 'vector_check' is invalid
    and does not appear to have come from any of the following routines:
      vector_malloc, vector_calloc, vector_realloc
      mxMalloc*, mxCalloc*, mxRealloc*
     
    This suggests one of the following has happened:
      - the pointer has already been freed
      - the pointer came from an incompatible allocator (e.g. new, malloc, utMalloc)
      - the pointer didn't come from any allocator (e.g. the stack, uninitialized memory)
      - a memory corruption destroyed the pointer or its header
     
    THIS DATA IS FOR INTERNAL DIAGNOSTIC PURPOSES ONLY
    PID:               4092
    NATIVE ALIGNMENT:  8 (0x8)
    REQ ALIGNMENT:     16 (0x10)
    ALIGNED POINTER:   1D050004
    REQ SIZE:          0 (0)
    HEADER ADDRESS:    1D04FFFC
    HEADER SIZE:       8 (0x8)
    HEADER DATA:       INACCESSIBLE
     
     
    Register State (captured):
      EAX = 00000000  EBX = 7887e734
      ECX = 00c2d704  EDX = 0f282b40
      ESP = 00c2d700  EBP = 00c2dccc
      ESI = 7888e74c  EDI = 78859114
     
      EIP = 787f8261  EFL = 00000246
     
       CS = 00c2001b   DS = 00c20023   SS = 0f260023
       ES = 0f260023   FS = 0000003b   GS = 00c20000
     
     
    Stack Trace (captured):
    [  0] 0x787f8261 C:/Program Files/MATLAB/R2010b/bin/win32/libmwfl.dll+00098913 ( fl::diag::stacktrace_base::format+006001 )
    [  1] 0x787f8423 C:/Program Files/MATLAB/R2010b/bin/win32/libmwfl.dll+00099363 ( fl::diag::terminate+000035 )
    [  2] 0x78801af9 C:/Program Files/MATLAB/R2010b/bin/win32/libmwfl.dll+00137977 ( fl::except::basic_exception::format+008265 )
    [  3] 0x78801c9b C:/Program Files/MATLAB/R2010b/bin/win32/libmwfl.dll+00138395 ( fl::except::basic_exception::format+008683 )
    [  4] 0x78801e2b C:/Program Files/MATLAB/R2010b/bin/win32/libmwfl.dll+00138795 ( fl::except::basic_exception::format+009083 )
    [  5] 0x7bce1c9a C:/Program Files/MATLAB/R2010b/bin/win32/libmx.dll+00007322 ( mxRemoveFromAllocList+000026 )
    [  6] 0x7bd180d9 C:/Program Files/MATLAB/R2010b/bin/win32/libmx.dll+00229593 ( mxArray_tag::set_pdata_untrusted+000025 )

  3. #3
    Membre confirmé
    Profil pro
    Inscrit en
    Juillet 2010
    Messages
    84
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2010
    Messages : 84
    Par défaut
    Voici le code:


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    // MMFile.cpp : Defines the initialization routines for the DLL.
    //
    #include "MMFile.h"
    #include "mex.h"
     
    static MMFile * hObj					= NULL;
    static bool initFlag					= true;
    static mxArray * persistent_array_ptr	= NULL;
    static double * memory_holder			= NULL;
     
    // *******************************************************************
    // MEX Interface.
    // *******************************************************************
    // MEX exit routine when MEX file is unloaded from process space.
    extern "C"
    void mexExitFunction(void) // This name needs to be exported?
    {
    		// We need to put back pointer to memory that MATLAB allocated so that 
    		// when it cleans up it does the correct thing.
    		mxSetPr(persistent_array_ptr,memory_holder);
    		mxSetN(persistent_array_ptr,1);
    		mxDestroyArray(persistent_array_ptr);
    }
     
    // *******************************************************************
    // MEX Interface.
    // *******************************************************************
    // MATLAB MAIN entry point.
    extern "C"
    void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) 
    {
        mexPrintf("\tProblem 1.\n");
    	// *******************************************************************
    	// Register the MEX exit function first time thru mex file
    	// Setup a persistent mxArray that we will us for passing data
    	// *******************************************************************
    	if (initFlag)
    	{
    		mexPrintf("\tProblem 2.\n");
    		mexAtExit(mexExitFunction);
    		persistent_array_ptr = mxCreateDoubleMatrix(1,1,mxREAL);
    		mexMakeArrayPersistent(persistent_array_ptr);
    		memory_holder = mxGetPr(persistent_array_ptr);
    		initFlag = false;
    	}
     
    	// *******************************************************************
    	// Error checking 
    	// *******************************************************************
    	// If the hObj does not exist then a problem caused us not to be 
    	// able to create mem-map file and we need to tell the user.
    	if (hObj==NULL)
    	{
    		mexPrintf("\tProblem createing Memory mapped file.\n");
    		mexPrintf("\tClear memeory and try again.\n");
    		nlhs=0;
    		plhs[0]=NULL;
    		return;
    	}
    	// Error checking on user past variables
    	if(nrhs!=1)
    	{
    		if ((nlhs !=1) | (nrhs > 1))
    		{
     
    			mexPrintf("Usage:\n");
    			mexPrintf("\tmmfile(data);\n");
    			mexPrintf("\tdata=mmfile();\n");
    			nlhs=0;
    			plhs[0]=NULL;
    			return;
    					mexPrintf("\tProblem 3 nrhs>1.\n");
    		}
    	}
     
    	// *******************************************************************
    	// Actual work of the MEX file.
    	// *******************************************************************
    	if (nrhs==1)
    	{  //   User wants to put data into memory map file
     
    		hObj->putData(mxGetPr(prhs[0]),mxGetNumberOfElements(prhs[0]));
    		mexPrintf("\tProblem 4 nrhs==1 putData.\n");
    	}
    	else // Or user wants to get data from memory mapped file.
    	{
    		mexPrintf("\tProblem 5 nrhs!=1 persistent.\n");
    		plhs[0]=persistent_array_ptr;
    		mexPrintf("\tProblem 6 nrhs!=1 persistent.\n");
    		// Notice that we pass back a pointer to the mem-map
    		// and we do not copy the data out of the point
    		mxSetPr(plhs[0],hObj->getPointer());
    				mexPrintf("\tProblem 7 GetPointer.\n");
    		// Tell the mxArray the size of the data in the mem-map
    		mxSetN(plhs[0],hObj->getLength());
    				mexPrintf("\tProblem 8 getLength.\n");
    	}
    }
     
    /* Main entry point for DLL loading and unloading */
    BOOL WINAPI DllMain (
    					HANDLE    hModule,
    					DWORD     dwFunction,
    					LPVOID    lpNot)
    {
        switch (dwFunction)
    	{
    		case DLL_PROCESS_ATTACH:
    			hObj = new MMFile();
    			break;
     
    		case DLL_PROCESS_DETACH:
    			delete hObj;
    			break;
     
    		default:
    			break;
    	}
     
        return true;
    }

Discussions similaires

  1. erreur lors d'une création de base
    Par LuckySoft dans le forum Oracle
    Réponses: 2
    Dernier message: 03/07/2006, 14h06
  2. Réponses: 4
    Dernier message: 21/02/2006, 16h47
  3. Réponses: 1
    Dernier message: 26/05/2005, 12h24
  4. message d'erreur lors de la création de la base
    Par ber_jp dans le forum PostgreSQL
    Réponses: 3
    Dernier message: 20/05/2004, 12h15
  5. message d'erreur lors de la création d'une base
    Par franculo_caoulene dans le forum MS SQL Server
    Réponses: 4
    Dernier message: 16/04/2004, 15h47

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo