z88dk forums

z80 Development Kit

You are not logged in.

#1 2012-05-27 16:19:59

pscust
Member
Registered: 2011-06-23
Posts: 18

[z88dk-dev] z80asm causes failure of nightly builds

z80asm causes failure of nightly builds:

z80asm -d -ns -nm -Mo -x./z88net_clib @./z88net.lst
*** glibc detected *** z80asm: double free or corruption (!prev): 0x0000000002510680 ***

I need to reproduce the problem to be able to solve it.

My environment is MS Visual C++ 2010, MinGW gcc 3.4.5 and Cygwin gcc 3.4.4, all on Windows 7.
The 5510 test cases of the z80asm test suite all pass in z80asm compiled with these 3 compilers.

The z88dk/build.sh runs to completion in cygwin without the error experienced in the nightly builds. I have tested the snapshot z88dk-20120527.tgz

What OS / GCC versions are used in the nightly builds?

Any ideas on how to reproduce the problem?

Thanks in advance,
Paulo



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl0424 … /50122263/

Offline

 

#2 2012-05-29 20:57:45

pscust
Member
Registered: 2011-06-23
Posts: 18

Re: [z88dk-dev] z80asm causes failure of nightly builds

BUG FOUND!

Closing a closed filehandle is OK in Windows but crashes in Linux. Will be fixed soon.

Paulo



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl0424 … /50122263/

Offline

 

#3 2012-05-29 21:49:13

stefano
Administrator
Registered: 2007-07-16
Posts: 696

Re: [z88dk-dev] z80asm causes failure of nightly builds

>BUG FOUND!

Well done !
I just got the error reproduced on my linux box and I was just logging in to notify it.


" *** glibc detected *** z80asm: double free or corruption "  ..I was going to point my finger on "malloc/free" stuff, they are often causing bad surprises.



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl0424 … /50122263/

Offline

 

#4 2012-05-30 07:06:17

pscust
Member
Registered: 2011-06-23
Posts: 18

Re: [z88dk-dev] z80asm causes failure of nightly builds

I set up a Debian virtual machine in VirtualBox to be able to reproduce and fix it. Version 1.1.16 checked-in yesterday has the fix.

The test case for the -d option caused the failure to occur, so it was very easy to detect the cause and the fix the crash.

The test suite still fails miserably on Linux. I'm going through the failed test cases to fix. Up to now I only found problems in the assumptions that the test scripts make on the environment (Linux does not have . in the PATH by default, %p output in printf is different in Win32 and Linux).

Regards,
Paulo



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl0424 … /50122263/

Offline

 

#5 2012-05-30 21:01:10

stefano
Administrator
Registered: 2007-07-16
Posts: 696

Re: [z88dk-dev] z80asm causes failure of nightly builds

For your information, ATM any gcc version, including CygWin fails in the last linking phase.

Linux example:

zcc +zx -lndos -create-app dstar.c
(...)
z80asm -a -m -Mo -L/usr/local/share/z88dk/lib/clibs -I/usr/local/share/z88dk/lib -oa.bin -indos  -izx_clib  -iz80_crt0  /tmp/tmpXXTJT5HW.opt /tmp/tmpXXSMsSmt.o
Segmentation fault
Key to filenames:
/tmp/tmpXXSMsSmt.o = dstar.c


Please don't get it as a claim, take your time and keep on the good job.



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl0424 … /50122263/

Offline

 

#6 2012-06-05 23:31:09

pscust
Member
Registered: 2011-06-23
Posts: 18

Re: [z88dk-dev] z80asm causes failure of nightly builds

For your information, ATM any gcc version, including CygWin fails in the last linking phase.

Thanks for the report. Problem found and solved in 1.1.17, and test script BUG_0020.t added to check that is is still solved with any future changes.

The problem was caused by an unknown identifier in the false branch of an IF-ENDIF construct.
It was introduced in version 1.1.14 when I removed the hard coded IDs of IF, ELSE, ENDIF ids in ParseIdent.

Please let me know of any other issues.

Regards,
Paulo



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl0424 … /50122263/

Offline

 

#7 2012-07-08 17:46:50

stefano
Administrator
Registered: 2007-07-16
Posts: 696

Re: [z88dk-dev] z80asm causes failure of nightly builds

Paulo, a z80asm bug seems to be popping out on the ZX Spectrum related thread:
"My computer has 64 bits architecture and z80asm.exe refuses to work, so i overwrite it from lastest (ver 1.9) binaries."

Probalby it is known, but I thought to tell it, you might be interested in catching a beta tester..  tongue



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl0424 … /50122263/

Offline

 

#8 2012-10-25 15:34:16

stefano
Administrator
Registered: 2007-07-16
Posts: 696

Re: [z88dk-dev] z80asm causes failure of nightly builds

Still onto z80asm (new version) and 64 bit platforms.
It took me quite a bit to track the bug, but I made it !
Quick workaround, revert modlink.c to use the original 'readlong' function in place of the new 'fgetl_err'.
All the file stuff should, in my opinion, be revised to be sure it is endian safe and correctly behavong in the different CPU environments.
I discovered that the Windows X64 platform still considers the long and ulong type as a 32bit value, while gcc moved to 64 bit types, so watch out !



------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct

Offline

 

#9 2012-10-28 16:39:50

stefano
Administrator
Registered: 2007-07-16
Posts: 696

Re: [z88dk-dev] z80asm causes failure of nightly builds

>Bug found!
>
>I finally managed to have a 64-bit FreeBSD running in VirtualBox.
>
>On a 64 bit architecture the value 0xFFFFFFFF is a positive integer, valued 4294967295, but the code is >spread with comparisons with -1 (0xFFFFFFFF in a 32 bit integer).
>
>Probably the easiest solution is to sign-extend the long value in the fgetl_err() function, instead of trying to find all the -1 comparisons. I'll have a try at this.
>
>Regards,
>Paulo

Great news !
Thanks of your effort, I was relly looking forward it smile
Call me crazy but I'd really like to keep this new z80asm version as the official one, no matter if it is a bit buggy..
Remember Sourceforge is letting the subscribed developers to access to a 64bit Lunix session via SSH whic can be used for further tests.  I found a linux box to do further experiments somewhere else, so please commit your fix as soon as you think it is ready, I'll be glad to help with testing.



------------------------------------------------------------------------------
WINDOWS 8 is here.
Millions of people.  Your app in 30 days.
Visit The Windows 8 Center at Sourceforge for all your go to resources.
http://windows8center.sourceforge.net/
join-generation-app-and-make-money-coding-fast/

Offline

 

#10 2012-10-29 15:22:42

stefano
Administrator
Registered: 2007-07-16
Posts: 696

Re: [z88dk-dev] z80asm causes failure of nightly builds

>I've committed the change to CVS in file.c, sign-extending the values read by fgetl_err().
>
>Please send your feed-back.
>
>Regards,
>Paulo

Much better  smile
There's only one thing I'd still like to check: at the first try I forgot to set the ZCCCFG folder and fired a lib recompilation.
As usual it stopped in .../libsrc/stdio/z88/, creating few ".err" files.
I couldn't go ahead until I removed those files myself: they were all read-only and z80asm claimed not being able to write over them.
..  does anyone have clues ?   I'll try again and let you know if I discover what was going on.



------------------------------------------------------------------------------
The Windows 8 Center - In partnership with Sourceforge
Your idea - your app - 30 days.
Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/

Offline

 

#11 2012-10-30 16:25:00

stefano
Administrator
Registered: 2007-07-16
Posts: 696

Re: [z88dk-dev] z80asm causes failure of nightly builds

Did not get to the same problem again.
I have the strange feeling that z80asm behaves in a slightly different way while building the libraries but sure it is fast yikes



------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson