Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emar: AssertionError while checking temporary module_xxxxxxxx.o #9733

Closed
Beuc opened this issue Oct 29, 2019 · 5 comments · Fixed by #9742

Comments

@Beuc
Copy link
Contributor

@Beuc Beuc commented Oct 29, 2019

$ rm -f Modules/?*_????????.o
$ ls Modules/
arraymodule.o    _collectionsmodule.o  datetimemodule.o    getbuildinfo.o     ld_so_aix     md5.o          _randommodule.o  sha512module.o  _struct.o         xxsubtype.o
binascii.o       config.c              errnomodule.o       getpath.o          main.o        operator.o     Setup            shamodule.o     symtablemodule.o  zipimport.o
bufferedio.o     config.o              fileio.o            iobase.o           mathmodule.o  posixmodule.o  Setup.config     socketmodule.o  textio.o          zlibmodule.o
bytesio.o        cPickle.o             _functoolsmodule.o  _iomodule.o        _math.o       pwdmodule.o    Setup.local      _sre.o          timemodule.o
_codecsmodule.o  cStringIO.o           gcmodule.o          itertoolsmodule.o  md5module.o   python.o       sha256module.o   stringio.o      _weakref.o
$ .../emsdk/upstream/emscripten/emar rc libpython2.7.a Modules/binascii.o  Modules/_struct.o  Modules/_collectionsmodule.o  Modules/operator.o  Modules/itertoolsmodule.o  Modules/timemodule.o  Modules/mathmodule.o Modules/_math.o  Modules/cStringIO.o  Modules/cPickle.o  Modules/bufferedio.o Modules/bytesio.o Modules/fileio.o Modules/iobase.o Modules/_iomodule.o Modules/stringio.o Modules/textio.o  Modules/_randommodule.o  Modules/_functoolsmodule.o  Modules/datetimemodule.o  Modules/zlibmodule.o  Modules/md5module.o Modules/md5.o  Modules/arraymodule.o  Modules/shamodule.o  Modules/sha256module.o  Modules/sha512module.o  Modules/socketmodule.o Modules/timemodule.o  Modules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/_weakref.o  Modules/zipimport.o  Modules/symtablemodule.o  Modules/xxsubtype.o
Traceback (most recent call last):
  File ".../emscripten/emar.py", line 105, in <module>
    sys.exit(run())
  File ".../emscripten/emar.py", line 76, in run
    assert not os.path.exists(full_newname)
AssertionError

With some tracing I get:

exists? Modules/binascii_e1264238.o
exists? Modules/_struct_4709fe13.o
exists? Modules/_collectionsmodule_d31e5a3f.o
exists? Modules/operator_a9b741ac.o
exists? Modules/itertoolsmodule_8ed21e2e.o
exists? Modules/timemodule_e6b2e3f7.o
exists? Modules/mathmodule_5ec8bd29.o
exists? Modules/_math_8f019ab2.o
exists? Modules/cStringIO_9f2c780d.o
exists? Modules/cPickle_e03ac4be.o
exists? Modules/bufferedio_f954c916.o
exists? Modules/bytesio_c9989f2d.o
exists? Modules/fileio_f8d1ffd7.o
exists? Modules/iobase_19186fba.o
exists? Modules/_iomodule_e98f97bb.o
exists? Modules/stringio_4205e3a9.o
exists? Modules/textio_32ac0406.o
exists? Modules/_randommodule_89c53773.o
exists? Modules/_functoolsmodule_2742052d.o
exists? Modules/datetimemodule_85095e27.o
exists? Modules/zlibmodule_970625cb.o
exists? Modules/md5module_6979bab2.o
exists? Modules/md5_070c090e.o
exists? Modules/arraymodule_1a07ce9b.o
exists? Modules/shamodule_7cf98c96.o
exists? Modules/sha256module_b27c1ae3.o
exists? Modules/sha512module_6bac5816.o
exists? Modules/socketmodule_4ac731fc.o
exists? Modules/timemodule_e6b2e3f7.o <error>

In addition, emar leaves all the module_xxxxxxxx.o around.

$ ls Modules/
arraymodule_1a07ce9b.o         config.c                   _functoolsmodule_2742052d.o  ld_so_aix              operator.o                sha512module_6bac5816.o  symtablemodule.o
arraymodule.o                  config.o                   _functoolsmodule.o           main.o                 posixmodule.o             sha512module.o           textio_32ac0406.o
binascii_e1264238.o            cPickle_e03ac4be.o         gcmodule.o                   _math_8f019ab2.o       pwdmodule.o               shamodule_7cf98c96.o     textio.o
binascii.o                     cPickle.o                  getbuildinfo.o               mathmodule_5ec8bd29.o  python.o                  shamodule.o              timemodule_e6b2e3f7.o
bufferedio_f954c916.o          cStringIO_9f2c780d.o       getpath.o                    mathmodule.o           _randommodule_89c53773.o  socketmodule_4ac731fc.o  timemodule.o
bufferedio.o                   cStringIO.o                iobase_19186fba.o            _math.o                _randommodule.o           socketmodule.o           _weakref.o
bytesio_c9989f2d.o             datetimemodule_85095e27.o  iobase.o                     md5_070c090e.o         Setup                     _sre.o                   xxsubtype.o
bytesio.o                      datetimemodule.o           _iomodule_e98f97bb.o         md5module_6979bab2.o   Setup.config              stringio_4205e3a9.o      zipimport.o
_codecsmodule.o                errnomodule.o              _iomodule.o                  md5module.o            Setup.local               stringio.o               zlibmodule_970625cb.o
_collectionsmodule_d31e5a3f.o  fileio_f8d1ffd7.o          itertoolsmodule_8ed21e2e.o   md5.o                  sha256module_b27c1ae3.o   _struct_4709fe13.o       zlibmodule.o
_collectionsmodule.o           fileio.o                   itertoolsmodule.o            operator_a9b741ac.o    sha256module.o            _struct.o

and more importantly leaves an incomplete .a archive, meaning running "make" again will make it look like a transient error.

Tested with 1.39.0 and TOT (upstream).

@Beuc

This comment has been minimized.

Copy link
Contributor Author

@Beuc Beuc commented Oct 29, 2019

Possibly related to #9653

@sbc100

This comment has been minimized.

Copy link
Collaborator

@sbc100 sbc100 commented Oct 29, 2019

Looks like you are asking to add Modules/timemodule.o to the archive twice on the command line.

We should handle this case however ar does I suppose. From a linking POV just ignore duplicates here seems like it would be the fine.

This will all go away once we remove fastcomp ... but we are not there yet sadly :(

@Beuc

This comment has been minimized.

Copy link
Contributor Author

@Beuc Beuc commented Oct 30, 2019

Good catch, I didn't spot the duplicate while skimming through the traces.
It's the pristine Python2 build system by the way.

@sbc100

This comment has been minimized.

Copy link
Collaborator

@sbc100 sbc100 commented Oct 30, 2019

Do you want to send a PR for this? Or should we assign someone else to fix it?

@Beuc

This comment has been minimized.

Copy link
Contributor Author

@Beuc Beuc commented Oct 30, 2019

Feel free to fix it!

sbc100 added a commit that referenced this issue Oct 30, 2019
Also, remove a try/catch block that was cleaning up even in the case
of an exception.  If an exception occurs its actually useful to leave
the temp files around to analyze the crash.

Fixes: #9733
sbc100 added a commit that referenced this issue Oct 30, 2019
Also, remove a try/catch block that was cleaning up even in the case
of an exception.  If an exception occurs its actually useful to leave
the temp files around to analyze the crash.

Fixes: #9733
@sbc100 sbc100 closed this in #9742 Oct 30, 2019
sbc100 added a commit that referenced this issue Oct 30, 2019
)

of an exception.  If an exception occurs its actually useful to leave
the temp files around to analyze the crash.

Fixes: #9733
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.