mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Hardware > GPU Computing

Reply
 
Thread Tools
Old 2012-07-03, 02:12   #1464
apsen
 
Jun 2011

100000112 Posts
Default

Crashed again. Looks like it's 100% reproducible.
apsen is offline   Reply With Quote
Old 2012-07-03, 03:55   #1465
apsen
 
Jun 2011

13110 Posts
Default

Guys, do you close the lock file before trying to delete it?

I didn't look at the code but I think you are forgetting to close the file and then do something uncosher when you try to create it again.

Last fiddled with by apsen on 2012-07-03 at 03:55
apsen is offline   Reply With Quote
Old 2012-07-03, 04:39   #1466
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3×29×83 Posts
Default

Quote:
Originally Posted by apsen View Post
Guys, do you close the lock file before trying to delete it?

I didn't look at the code but I think you are forgetting to close the file and then do something uncosher when you try to create it again.
Like I posted above:
Code:
 //parse.c, line 86
#include <winsock2.h>
 
  #include <io.h>
 
  #include <share.h> //used for _sopen_s
 
  #undef close
 
  #define close _close
 
  #define sched_yield SwitchToThread
 
  #define MODE _S_IREAD | _S_IWRITE
 
  #define strncasecmp _strnicmp
 
 
 
  /* Everything from here to the next include is to make MSVS happy. */
 
  #define sscanf sscanf_s /* This only works for scanning numbers, or strings with a defined length (e.g. "%131s") */
 
 
 
  void strcopy(char* dest, char* src, size_t n) 
 
  {
 
    strncpy_s(dest, MAX_LINE_LENGTH+1, src, n);
 
  }
 
  FILE* _fopen(const char* path, const char* mode) 
 
  {
 
    FILE* stream;
 
    errno_t err = fopen_s(&stream, path, mode);
 
    if(err) return NULL;
 
    else return stream;
 
  }
 
  void _sprintf(char* buf, char* frmt, const char* string)
 
  { // only used in filelocking code
 
      sprintf_s(buf, 251, frmt, string);
 
  }
 
  int open_s(const char *filename, int oflag, int pmode)
 
  {
 
     int file_handle;
 
     errno_t err = _sopen_s( &file_handle, filename, oflag, _SH_DENYNO, pmode);
 
     if (err)
 
     {
 
         close (file_handle);
 
         return -1;
 
     }
 
     else return 0;
 
  }
 
  void _strcpy(char *dest, const char *src)
 
  {
 
      strcpy_s (dest, _countof(dest), src);
 
  }
Code:
//parse.c line 728
/*****************************************************************************/
 
/*      mfakto's file locking code                                           */
 
 
 
#define MAX_LOCKED_FILES 3
 
 
 
typedef struct _lockinfo
 
{
 
  int       lockfd;
 
  FILE *    open_file;
 
  char      lock_filename[256];
 
} lockinfo;
 
 
 
static unsigned int num_locked_files = 0;
 
static lockinfo     locked_files[MAX_LOCKED_FILES]; 
 
int unlock_and_fclose(FILE *f)
 
{
 
  unsigned int i, j;
 
  int ret = 0;
 
  #ifdef EBUG
 
  printf("unlock() called\n");
 
  #endif
 
 
 
  if (f == NULL) return -1;
 
 
 
  for (i=0; i<num_locked_files; i++)
 
  {
 
    if (locked_files[i].open_file == f)
 
    {
 
      ret = fclose(f);
 
      f = NULL;
 
      if (close(locked_files[i].lockfd) != 0) perror("Failed to close lockfile");
 
      if (remove(locked_files[i].lock_filename)!= 0) perror("Failed to delete lockfile");
 
      for (j=i+1; j<num_locked_files; j++)
 
      {
 
        locked_files[j-1].lockfd = locked_files[j].lockfd;
 
        locked_files[j-1].open_file = locked_files[j].open_file;
 
        _strcpy(locked_files[j-1].lock_filename, locked_files[j].lock_filename);
 
      }
 
      num_locked_files--;
 
      break;
 
    }
 
  }
 
  if (f)
 
  {
 
    fprintf(stderr, "File was not locked!\n");
 
    ret = fclose(f);
 
  }
 
  #ifdef EBUG
 
  printf("successfully unlocked\n");
 
  #endif
 
  return ret;
 
}
I know that flash changed it from what Bdot (the original developer of this code) had to make MSVS warnings go away. The most likely thing, it seems to me, is that somehow the changes broke it. I'll take a look through MSFT's library and see if I can spot something going wrong somewhere.
Dubslow is offline   Reply With Quote
Old 2012-07-04, 03:42   #1467
flashjh
 
flashjh's Avatar
 
"Jerry"
Nov 2011
Vancouver, WA

1,123 Posts
Default

To eliminate code change problems, if we can get a set of code without the changes to make MSVS happy, I can get it to compile so we can test the original code.
flashjh is offline   Reply With Quote
Old 2012-07-04, 04:28   #1468
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3·29·83 Posts
Default

Quote:
Originally Posted by flashjh View Post
To eliminate code change problems, if we can get a set of code without the changes to make MSVS happy, I can get it to compile so we can test the original code.
https://github.com/Bdot42/mfakto/blo.../filelocking.c

Alternately, try checking out r32, my initial Beta commit.
svn checkout svn://svn.code.sf.net/p/cudalucas/code/trunk -r 32

Last fiddled with by Dubslow on 2012-07-04 at 04:33
Dubslow is offline   Reply With Quote
Old 2012-07-04, 08:09   #1469
Bdot
 
Bdot's Avatar
 
Nov 2010
Germany

25516 Posts
Default

Quote:
Originally Posted by apsen View Post
Crashed again. Looks like it's 100% reproducible.
If it is reproducible, could you attach a debugger to it before it crashes? Or start it right out of a debugger? A stacktrace would certainly be of great help. If you can get the debug symbols for your build, then you can even look at the data / variables ...
Bdot is offline   Reply With Quote
Old 2012-07-04, 13:58   #1470
flashjh
 
flashjh's Avatar
 
"Jerry"
Nov 2011
Vancouver, WA

112310 Posts
Default

I uploaded a 3.2 x64 version with dubug info (hopefully). If someone could test the debug and let me know, I would appreciate it.
flashjh is offline   Reply With Quote
Old 2012-07-04, 14:40   #1471
Bdot
 
Bdot's Avatar
 
Nov 2010
Germany

3×199 Posts
Default

Quote:
Originally Posted by flashjh View Post
I uploaded a 3.2 x64 version with dubug info (hopefully). If someone could test the debug and let me know, I would appreciate it.
I can try.

apsen, can you give me the command line you used and your .ini / worktodo contents (if any)?
Bdot is offline   Reply With Quote
Old 2012-07-04, 15:45   #1472
Bdot
 
Bdot's Avatar
 
Nov 2010
Germany

3×199 Posts
Default

Quote:
Originally Posted by Bdot View Post
I can try.

apsen, can you give me the command line you used and your .ini / worktodo contents (if any)?
I can reproduce the abort - no need to send any ini/worktodo files.

The "debug" binary, unfortunately, contains no debug information that any of my debuggers could identify.

I tried downloading the source, but my svn client fails to pass the firewall for svn:// links, only http[s] works (via proxy). However, for all http requests to SF, all I get is "200 OK" instead of any file ...
Bdot is offline   Reply With Quote
Old 2012-07-04, 15:59   #1473
flashjh
 
flashjh's Avatar
 
"Jerry"
Nov 2011
Vancouver, WA

100011000112 Posts
Default

Quote:
Originally Posted by Bdot View Post
I can reproduce the abort - no need to send any ini/worktodo files.

The "debug" binary, unfortunately, contains no debug information that any of my debuggers could identify.

I tried downloading the source, but my svn client fails to pass the firewall for svn:// links, only http[s] works (via proxy). However, for all http requests to SF, all I get is "200 OK" instead of any file ...
When you build, what do you use to include debugging info? I use MSVS command line, so the /DEBUG doesn't work.

I've been trying to move the projects to the full MSVS, but I haven't spent a lot of time getting it to work yet.
flashjh is offline   Reply With Quote
Old 2012-07-04, 16:07   #1474
flashjh
 
flashjh's Avatar
 
"Jerry"
Nov 2011
Vancouver, WA

21438 Posts
Default

I posted a new version I compiled with /Zi for cl.exe. I'm using this page for the examples. Let me know if that one has debugging info.

I found that the original debugging info I incuded is for CUDA-GDB (and it's still there for now).

Last fiddled with by flashjh on 2012-07-04 at 16:09
flashjh is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Don't DC/LL them with CudaLucas LaurV Data 131 2017-05-02 18:41
CUDALucas / cuFFT Performance on CUDA 7 / 7.5 / 8 Brain GPU Computing 13 2016-02-19 15:53
CUDALucas: which binary to use? Karl M Johnson GPU Computing 15 2015-10-13 04:44
settings for cudaLucas fairsky GPU Computing 11 2013-11-03 02:08
Trying to run CUDALucas on Windows 8 CP Rodrigo GPU Computing 12 2012-03-07 23:20

All times are UTC. The time now is 14:47.


Fri Jul 7 14:47:35 UTC 2023 up 323 days, 12:16, 0 users, load averages: 1.54, 1.42, 1.20

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔