www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1337] New: Internal error: eh.c 41 - alloca & synchronized(this)

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1337

           Summary: Internal error: eh.c 41 - alloca & synchronized(this)
           Product: D
           Version: 1.018
          Platform: PC
               URL: http://paste.dprogramming.com/dpz51jpz.php
        OS/Version: Linux
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: a.panek brainsware.org


It seems like the combination of memory allocated with stdc's alloca() function
and synchronized(this) [as shown in the outcommented code in the paste] cause
an internal error in eh.c.

Neither a D-way copy ..

    synchronized (this)
        list[] = queueList;

..nor a memcpy..

    synchronized (this)
        memcpy (list.ptr, queueList.ptr, len * (QueueFile*).sizeof);

fixed this error.

It has been worked around via creating a synchronized copy method to perform
the same action.


-- 
Jul 12 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1337






Please provide a complete reproducible sample.


-- 
Jul 12 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1337


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug yahoo.com.au
            Summary|Internal error: eh.c 41 -   |ICE(eh.c) No test case
                   |alloca & synchronized(this) |





Original title was:
Internal error: eh.c 41 - alloca & synchronized(this)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 26 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1337


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID





As this has been open for 2 years without anyone providing a complete test
case, I'm closing this as invalid. Reopen if you have a test case.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 10 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1337






PDT ---
This can be a test case, I didn't check it for 1.018, it works on 2.031.

---
struct QueueFile{ int size,channel; }
class A
{
   QueueFile[] queueList;
   final synchronized void copy (QueueFile[] dst, QueueFile src[])
   {
      dst[] = src;
   }
   final void watchdog ()
   {
      auto len = queueList.length;
      auto list = (cast(QueueFile*) alloca(len * QueueFile.sizeof))[0..len];

      // clone the list of queues to avoid stalling everything
      //copy (list, queueList);

      synchronized (this)
         memcpy (list.ptr, queueList.ptr, len * (QueueFile*).sizeof);
         //list[] = queueList;

      foreach (q; list)
      {
         if (q.size)
             writeln (q.channel);
         //if (q.isDirty)
         //{
         //    q.flush;
         //    log.info ("flushed "~q.channel.name~" to disk");
         //}
      }
   }
}
---

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 10 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1337


Brad Roberts <braddr puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |braddr puremagic.com
         Resolution|INVALID                     |





PDT ---
Reopening so the new code can be looked at.  However...

Term clarification 'it works on 2.031'?  Does that mean that it compiles
successfully or unsuccessfully?  If unsuccessfully, with the same error?  If
it's not the same error, please include the current error message.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 10 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1337






PDT ---
compiles successfully

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 13 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1337


Brad Roberts <braddr puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |INVALID





PDT ---
Reclosing.

If the new example code compiles, then it's not exactly a repro case for the
bug, unless it failed to compile with an older version of the code.  Without
good info, I agree with Don's assessment.. might as well close it as an invalid
bug report.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 27 2009