Debian Bug report logs - #698760
magic: Excess newlines in distribution .tech files break their parseability

version graph

Package: magic; Maintainer for magic is Roland Stigge <stigge@antcom.de>; Source for magic is src:magic.

Reported by: Ильяс Гасанов <torso.nafi@gmail.com>

Date: Wed, 23 Jan 2013 10:51:01 UTC

Severity: important

Tags: upstream

Found in version magic/7.5.229-1

Fixed in version 7.5.230-1

Done: Roland Stigge <stigge@antcom.de>

Bug is archived. No further changes may be made.

Forwarded to tim@opencircuitdesign.com

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Roland Stigge <stigge@antcom.de>:
Bug#698760; Package magic. (Wed, 23 Jan 2013 10:51:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ильяс Гасанов <torso.nafi@gmail.com>:
New Bug report received and forwarded. Copy sent to Roland Stigge <stigge@antcom.de>. (Wed, 23 Jan 2013 10:51:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Ильяс Гасанов <torso.nafi@gmail.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: magic: Excess newlines in distribution .tech files break their parseability
Date: Wed, 23 Jan 2013 14:47:10 +0400
[Message part 1 (text/plain, inline)]
Package: magic
Version: 7.5.229-1
Severity: important

Dear Maintainer,

I have detected an errant behavior at magic loadtime when process
technology files are being parsed. Particularly, there are error
messages about DRC rule syntax violations, for example:

        /usr/lib/x86_64-linux-gnu/magic/sys/scmos.tech: line 4493:
        section drc:
                Rule type "edge4way" usage: edge4way layers1 layers2
        distance okTypes cornerTypes cornerDistance why [plane]
        /usr/lib/x86_64-linux-gnu/magic/sys/scmos.tech: line 4494:
        section drc:
                Bad DRC rule type "N-Well width must be at least 10
        (MOSIS rule #1.1)"
        Valid rule types are:
        angles, edge, edge4way, exact_overlap, extend, no_overlap,
        overhang, rect_only, spacing, stepsize, surround, width,
        widespacing, area, maxwidth, cifstyle, cifwidth, cifspacing,
        cifarea, cifmaxwidth, rectangle.

After that I have observed these files in /usr/lib/<arch>/magic/sys/ and
diagnosed that they have redundant line breaks at logged positions.
During the design process many design rule checks are not performed due
to this.

This issue has been detected in both Debian testing and experimental
package trees. Furthermore, the files listed at magic official site do
not have such syntax violations and work just ok:

http://opencircuitdesign.com/magic/tech.html

In the attachment there is a log extracted from wish stderr stream at
magic startup.



-- System Information:
Debian Release: 7.0
  APT prefers testing
  APT policy: (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=ru_RU.utf8, LC_CTYPE=ru_RU.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages magic depends on:
ii  libc6     2.13-37
ii  libx11-6  2:1.5.0-1
ii  tcl8.5    8.5.11-2
ii  tk8.5     8.5.11-2

magic recommends no packages.

Versions of packages magic suggests:
ii  irsim  9.7.78-1

-- no debconf information
[magic.log (text/x-log, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#698760; Package magic. (Wed, 23 Jan 2013 13:21:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roland Stigge <stigge@antcom.de>:
Extra info received and forwarded to list. (Wed, 23 Jan 2013 13:21:03 GMT) Full text and rfc822 format available.

Message #10 received at 698760@bugs.debian.org (full text, mbox):

From: Roland Stigge <stigge@antcom.de>
To: tim@opencircuitdesign.com
Cc: torso.nafi@gmail.com, 698760@bugs.debian.org
Subject: Re: Bug#698760: magic: Excess newlines in distribution .tech files break their parseability
Date: Wed, 23 Jan 2013 14:16:55 +0100
Hi Tim,

at Debian, a certain build issue of magic was found:

Consider building scmos.tech, built like this, according to the log:

[...]
make[4]: Entering directory `/build/buildd-magic_7.5.220-1-amd64-6X73cI/magic-7.5.220/scmos/cif_template'
../../scripts/mkdirs objs
mkdir objs
rm -f objs/CIFin
gcc -E -x c -DSTANDARD cifin.c | sed -e "/^#/D" -e "s/(gen )/(gen)/" -e "s/(nowell )/(nowell)/" -e "s/(nwell )/(nwell)/" -e "s/(pwell )/(pwell)/" > objs/CIFin
rm -f objs/CIFout
gcc -E -x c -DSTANDARD cifout.c | sed -e "/^#/D" -e "s/(gen )/(gen)/" -e "s/(nowell )/(nowell)/" -e "s/(nwell )/(nwell)/" -e "s/(pwell )/(pwell)/" > objs/CIFout
rm -f objs/IBMCIFin
gcc -E -x c -DIBM cifin.c | sed -e "/^#/D" -e "s/(gen )/(gen)/" -e "s/(nowell )/(nowell)/" -e "s/(nwell )/(nwell)/" -e "s/(pwell )/(pwell)/" > objs/IBMCIFin
rm -f objs/IBMCIFout
gcc -E -x c -DIBM cifout.c | sed -e "/^#/D" -e "s/(gen )/(gen)/" -e "s/(nowell )/(nowell)/" -e "s/(nwell )/(nwell)/" -e "s/(pwell )/(pwell)/" > objs/IBMCIFout
rm -f objs/TMCIFin
gcc -E -x c -DTIGHTMETAL cifin.c | sed -e "/^#/D" -e "s/(gen )/(gen)/" -e "s/(nowell )/(nowell)/" -e "s/(nwell )/(nwell)/" -e "s/(pwell )/(pwell)/" > objs/TMCIFin
rm -f objs/TMCIFout
gcc -E -x c -DTIGHTMETAL cifout.c | sed -e "/^#/D" -e "s/(gen )/(gen)/" -e "s/(nowell )/(nowell)/" -e "s/(nwell )/(nwell)/" -e "s/(pwell )/(pwell)/" > objs/TMCIFout
rm -f objs/SUBCIFin
gcc -E -x c -DSUBMICRON cifin.c | sed -e "/^#/D" -e "s/(gen )/(gen)/" -e "s/(nowell )/(nowell)/" -e "s/(nwell )/(nwell)/" -e "s/(pwell )/(pwell)/" > objs/SUBCIFin
rm -f objs/SUBCIFout
gcc -E -x c -DSUBMICRON cifout.c | sed -e "/^#/D" -e "s/(gen )/(gen)/" -e "s/(nowell )/(nowell)/" -e "s/(nwell )/(nwell)/" -e "s/(pwell )/(pwell)/" > objs/SUBCIFout
make[4]: Leaving directory `/build/buildd-magic_7.5.220-1-amd64-6X73cI/magic-7.5.220/scmos/cif_template'
/usr/bin/m4 minimum.tech.m4 > minimum.tech
/usr/bin/m4 gdsquery.tech.m4 > gdsquery.tech
gcc -E -x c -I./extract_template -DV5 -DSTANDARD scmos.tech.in > scmos.tech
[...]

Now, looking at source and resulting files:

scmos.tech.in:
=================================================================
[...]
/* ---------------------------------------------------------------- */
/*                              Well                                */
/* ---------------------------------------------------------------- */

/* 1.1 */
/*  Now use "edge" for width DRC... A test only for rule1           */
/*  Other rules may follow in the near future...                    */
#ifdef SUBMICRON
    edge4way (~nwell)/w nwell 12 nwell nwell 12\
        "N-Well width must be at least 12 (MOSIS rule #1.1)"
    edge4way (~pwell)/w pwell 12 pwell pwell 12\
        "P-Well width must be at least 12 (MOSIS rule #1.1)"
#else
    edge4way (~nwell)/w nwell 10 nwell nwell 10\
        "N-Well width must be at least 10 (MOSIS rule #1.1)"
    edge4way (~pwell)/w pwell 10 pwell pwell 10\
        "P-Well width must be at least 10 (MOSIS rule #1.1)"
#endif
[...]
=================================================================

scmos.tech:

=================================================================
[...]
# 960 "scmos.tech.in"
    edge4way (~nwell)/w nwell 10 nwell nwell 10
 "N-Well width must be at least 10 (MOSIS rule #1.1)"
    edge4way (~pwell)/w pwell 10 pwell pwell 10
 "P-Well width must be at least 10 (MOSIS rule #1.1)"
[...]
=================================================================

Looks like the gcc (4.7.2-5 in Debian) preprocessor just discards the "\"
line endings instead of interpreting as line continuations, resulting in
broken resulting files, as reported below.

Is this a known issue?

Please see also http://bugs.debian.org/698760 and please tell how we
can help debugging this.

Thanks in advance,

Roland



On 01/23/2013 11:47 AM, Ильяс Гасанов wrote:
> Package: magic
> Version: 7.5.229-1
> Severity: important
> 
> Dear Maintainer,
> 
> I have detected an errant behavior at magic loadtime when process
> technology files are being parsed. Particularly, there are error
> messages about DRC rule syntax violations, for example:
> 
>         /usr/lib/x86_64-linux-gnu/magic/sys/scmos.tech: line 4493:
>         section drc:
>                 Rule type "edge4way" usage: edge4way layers1 layers2
>         distance okTypes cornerTypes cornerDistance why [plane]
>         /usr/lib/x86_64-linux-gnu/magic/sys/scmos.tech: line 4494:
>         section drc:
>                 Bad DRC rule type "N-Well width must be at least 10
>         (MOSIS rule #1.1)"
>         Valid rule types are:
>         angles, edge, edge4way, exact_overlap, extend, no_overlap,
>         overhang, rect_only, spacing, stepsize, surround, width,
>         widespacing, area, maxwidth, cifstyle, cifwidth, cifspacing,
>         cifarea, cifmaxwidth, rectangle.
> 
> After that I have observed these files in /usr/lib/<arch>/magic/sys/ and
> diagnosed that they have redundant line breaks at logged positions.
> During the design process many design rule checks are not performed due
> to this.
> 
> This issue has been detected in both Debian testing and experimental
> package trees. Furthermore, the files listed at magic official site do
> not have such syntax violations and work just ok:
> 
> http://opencircuitdesign.com/magic/tech.html
> 
> In the attachment there is a log extracted from wish stderr stream at
> magic startup.
> 
> 
> 
> -- System Information:
> Debian Release: 7.0
>   APT prefers testing
>   APT policy: (500, 'testing'), (1, 'experimental')
> Architecture: amd64 (x86_64)
> Foreign Architectures: i386
> 
> Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores)
> Locale: LANG=ru_RU.utf8, LC_CTYPE=ru_RU.utf8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
> 
> Versions of packages magic depends on:
> ii  libc6     2.13-37
> ii  libx11-6  2:1.5.0-1
> ii  tcl8.5    8.5.11-2
> ii  tk8.5     8.5.11-2
> 
> magic recommends no packages.
> 
> Versions of packages magic suggests:
> ii  irsim  9.7.78-1
> 
> -- no debconf information




Added tag(s) upstream. Request was from Roland Stigge <stigge@antcom.de> to control@bugs.debian.org. (Wed, 23 Jan 2013 13:30:05 GMT) Full text and rfc822 format available.

Set Bug forwarded-to-address to 'tim@opencircuitdesign.com'. Request was from Roland Stigge <stigge@antcom.de> to control@bugs.debian.org. (Wed, 23 Jan 2013 13:30:07 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Roland Stigge <stigge@antcom.de>:
Bug#698760; Package magic. (Wed, 23 Jan 2013 15:57:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tim Edwards <tim@opencircuitdesign.com>:
Extra info received and forwarded to list. Copy sent to Roland Stigge <stigge@antcom.de>. (Wed, 23 Jan 2013 15:57:07 GMT) Full text and rfc822 format available.

Message #19 received at 698760@bugs.debian.org (full text, mbox):

From: Tim Edwards <tim@opencircuitdesign.com>
To: Roland Stigge <stigge@antcom.de>
Cc: torso.nafi@gmail.com, 698760@bugs.debian.org
Subject: Re: Bug#698760: magic: Excess newlines in distribution .tech files break their parseability
Date: Wed, 23 Jan 2013 10:53:05 -0500
Hello Roland,

> Looks like the gcc (4.7.2-5 in Debian) preprocessor just discards the "\"
> line endings instead of interpreting as line continuations, resulting in
> broken resulting files, as reported below.
>
> Is this a known issue?
>
> Please see also http://bugs.debian.org/698760 and please tell how we
> can help debugging this.

Yes, this is a known issue.

I corrected it in one place, which is scmos/Makefile.  If you look
at that file, the lines of the type

	sed -e 's/\\/\\\\/' scmos.tech.in > scmos.tech.out

Are meant to add an extra backslash for each backslash in the file,
so that the preprocessor will remove only one of them, and keep the
rest.

This is clearly a bug in the preprocessor, and I was hoping it would
be fixed quickly, but apparently not.

The ideal solution would be to convert all the magic techfile input
files to m4 format, but it was a time-consuming task and I have never
done it.  Barring that, the proper solution would be to have the
configure script detect the preprocessor and handle the cases.  But
it may be okay to put the double-backslash in, as I think magic will
properly handle input with a double backslash if the preprocessor
does not convert it.

After fixing the Makefile in the scmos directory, I was unaware that
the Makefile in scmos/cif_template was also causing problems.

So tentatively, I think a good solution is to add the -e 's/\\/\\\\/'
line to SED_CMD in cif_template/Makefile.  I think this will solve
the problem.
					Regards,
					Tim

+--------------------------------+-------------------------------------+
| Dr. R. Timothy Edwards (Tim)   | email: tim@opencircuitdesign.com    |
| Open Circuit Design, Inc.      | web:   http://opencircuitdesign.com |
| 22815 Timber Creek Lane        | phone: (301) 528-5030               |
| Clarksburg, MD 20871-4001      | cell:  (240) 401-0616               |
+--------------------------------+-------------------------------------+



Information forwarded to debian-bugs-dist@lists.debian.org, Roland Stigge <stigge@antcom.de>:
Bug#698760; Package magic. (Wed, 23 Jan 2013 16:03:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tim Edwards <tim@opencircuitdesign.com>:
Extra info received and forwarded to list. Copy sent to Roland Stigge <stigge@antcom.de>. (Wed, 23 Jan 2013 16:03:06 GMT) Full text and rfc822 format available.

Message #24 received at 698760@bugs.debian.org (full text, mbox):

From: Tim Edwards <tim@opencircuitdesign.com>
To: Roland Stigge <stigge@antcom.de>
Cc: torso.nafi@gmail.com, 698760@bugs.debian.org
Subject: Re: Bug#698760: magic: Excess newlines in distribution .tech files break their parseability
Date: Wed, 23 Jan 2013 10:57:59 -0500
[Message part 1 (text/plain, inline)]
Hello Roland,

   I just noticed that this bug report was concerning magic-7.5.  In
that case, you will probably need the file scmos/Makefile from the
magic-8.0 distribution (attached), because it has the other
corrections that are needed to avoid stripping backslashes in the
techfiles.

   Please let me know what works, and I will correct the distribution
source code.
					Regards,
					Tim

+--------------------------------+-------------------------------------+
| Dr. R. Timothy Edwards (Tim)   | email: tim@opencircuitdesign.com    |
| Open Circuit Design, Inc.      | web:   http://opencircuitdesign.com |
| 22815 Timber Creek Lane        | phone: (301) 528-5030               |
| Clarksburg, MD 20871-4001      | cell:  (240) 401-0616               |
+--------------------------------+-------------------------------------+
[Makefile (text/plain, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#698760; Package magic. (Wed, 23 Jan 2013 17:09:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roland Stigge <stigge@antcom.de>:
Extra info received and forwarded to list. (Wed, 23 Jan 2013 17:09:03 GMT) Full text and rfc822 format available.

Message #29 received at 698760@bugs.debian.org (full text, mbox):

From: Roland Stigge <stigge@antcom.de>
To: torso.nafi@gmail.com, 698760@bugs.debian.org
Subject: Re: Bug#698760: magic: Excess newlines in distribution .tech files break their parseability
Date: Wed, 23 Jan 2013 18:07:50 +0100
Hi Ilias,

On 01/23/2013 11:47 AM, Ильяс Гасанов wrote:
> Package: magic
> Version: 7.5.229-1
> Severity: important
> 
> Dear Maintainer,
> 
> I have detected an errant behavior at magic loadtime when process
> technology files are being parsed. Particularly, there are error
> messages about DRC rule syntax violations, for example:
> 
>         /usr/lib/x86_64-linux-gnu/magic/sys/scmos.tech: line 4493:
>         section drc:
>                 Rule type "edge4way" usage: edge4way layers1 layers2
>         distance okTypes cornerTypes cornerDistance why [plane]
>         /usr/lib/x86_64-linux-gnu/magic/sys/scmos.tech: line 4494:
>         section drc:
>                 Bad DRC rule type "N-Well width must be at least 10
>         (MOSIS rule #1.1)"
>         Valid rule types are:
>         angles, edge, edge4way, exact_overlap, extend, no_overlap,
>         overhang, rect_only, spacing, stepsize, surround, width,
>         widespacing, area, maxwidth, cifstyle, cifwidth, cifspacing,
>         cifarea, cifmaxwidth, rectangle.
> 
> After that I have observed these files in /usr/lib/<arch>/magic/sys/ and
> diagnosed that they have redundant line breaks at logged positions.
> During the design process many design rule checks are not performed due
> to this.
> 
> This issue has been detected in both Debian testing and experimental
> package trees. Furthermore, the files listed at magic official site do
> not have such syntax violations and work just ok:
> 
> http://opencircuitdesign.com/magic/tech.html
> 
> In the attachment there is a log extracted from wish stderr stream at
> magic startup.

Thank you for your report!

The upstream author already reported back that this is a known issue and
provided a fix. To test if it really solves the issue completely, I
would like to check your exact process.

So can you please describe the complete actions w/ magic to reproduce
the issue?

Thanks in advance,

Roland



Information forwarded to debian-bugs-dist@lists.debian.org, Roland Stigge <stigge@antcom.de>:
Bug#698760; Package magic. (Wed, 23 Jan 2013 20:03:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ильяс Гасанов <torso.nafi@gmail.com>:
Extra info received and forwarded to list. Copy sent to Roland Stigge <stigge@antcom.de>. (Wed, 23 Jan 2013 20:03:03 GMT) Full text and rfc822 format available.

Message #34 received at 698760@bugs.debian.org (full text, mbox):

From: Ильяс Гасанов <torso.nafi@gmail.com>
To: 698760@bugs.debian.org
Subject: Re: Bug#698760: magic: Excess newlines in distribution .tech files break their parseability
Date: Wed, 23 Jan 2013 23:58:24 +0400
Hello, and thank you for responding.

В Срд, 23/01/2013 в 18:07 +0100, Roland Stigge пишет:
> Hi Ilias,
> 
> On 01/23/2013 11:47 AM, Ильяс Гасанов wrote:
> > Package: magic
> > Version: 7.5.229-1
> > Severity: important
> > 
> > Dear Maintainer,
> > 
> > I have detected an errant behavior at magic loadtime when process
> > technology files are being parsed. Particularly, there are error
> > messages about DRC rule syntax violations, for example:
> > 
> >         /usr/lib/x86_64-linux-gnu/magic/sys/scmos.tech: line 4493:
> >         section drc:
> >                 Rule type "edge4way" usage: edge4way layers1 layers2
> >         distance okTypes cornerTypes cornerDistance why [plane]
> >         /usr/lib/x86_64-linux-gnu/magic/sys/scmos.tech: line 4494:
> >         section drc:
> >                 Bad DRC rule type "N-Well width must be at least 10
> >         (MOSIS rule #1.1)"
> >         Valid rule types are:
> >         angles, edge, edge4way, exact_overlap, extend, no_overlap,
> >         overhang, rect_only, spacing, stepsize, surround, width,
> >         widespacing, area, maxwidth, cifstyle, cifwidth, cifspacing,
> >         cifarea, cifmaxwidth, rectangle.
> > 
> > After that I have observed these files in /usr/lib/<arch>/magic/sys/ and
> > diagnosed that they have redundant line breaks at logged positions.
> > During the design process many design rule checks are not performed due
> > to this.
> > 
> > This issue has been detected in both Debian testing and experimental
> > package trees. Furthermore, the files listed at magic official site do
> > not have such syntax violations and work just ok:
> > 
> > http://opencircuitdesign.com/magic/tech.html
> > 
> > In the attachment there is a log extracted from wish stderr stream at
> > magic startup.
> 
> Thank you for your report!
> 
> The upstream author already reported back that this is a known issue and
> provided a fix. To test if it really solves the issue completely, I
> would like to check your exact process.
> 
> So can you please describe the complete actions w/ magic to reproduce
> the issue?
> 
> Thanks in advance,
> 
> Roland

I started using magic in my study work only recently, so I can't yet
figure out any specific details about this issue. As I said previously,
the error messages appear at startup, while during the process certain
DRC checks are not applied.

For example, the size of borderspace around NMOS elements within n-well,
as well as minimum distances between polysilicon and diffusion-to-metal
contacts are not checked at all when those .tech files are loaded. What
I did is I tried to reproduce the stuff from a lecture on YouTube, and
also to do some experiments with more complex FET logic using irsim.

Here is the video lecture which I was using in my work:

http://www.youtube.com/watch?v=D32woicgdRk

Sincerely,

Ilyas Gasanov




Marked as fixed in versions 7.5.230-1. Request was from Roland Stigge <stigge@antcom.de> to control@bugs.debian.org. (Fri, 25 Jan 2013 10:33:09 GMT) Full text and rfc822 format available.

Marked Bug as done Request was from Roland Stigge <stigge@antcom.de> to control@bugs.debian.org. (Fri, 25 Jan 2013 10:33:12 GMT) Full text and rfc822 format available.

Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sat, 23 Feb 2013 07:27:34 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Apr 16 17:12:00 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.