Ok I added the try/except block and I think it went into the except part 
but I can't see it; the print function does not write into the Visual 
Studio output window. So I tried to run the link command (emcc.bat with all 
the same parameters) and it still doesn't print the error in the console. 
How do I get this print function to write in the console (or VS output 
window) ?

On Wednesday, October 29, 2014 11:10:30 AM UTC-4, Bruce Mitchener wrote:
>
> Sure.
>
> Around that block of code, wrap it in a try / except block:
>
> try:
>   ...
> except:
>   print mem_init[234335:234339]
>
> And I think that'll work. If that print errors, you may need to try 
> printing mem_init[...].encode('utf-8') instead ...
>
>  - Bruce
>
>
> On Wed, Oct 29, 2014 at 9:44 PM, Robert Goulet <[email protected] 
> <javascript:>> wrote:
>
>> Sure I would like to debug it. I have never debugged Emscripten before so 
>> I will need advices about how to do what you just said. Can you provide 
>> tips?
>>
>> On Wednesday, October 29, 2014 10:34:37 AM UTC-4, Bruce Mitchener wrote:
>>>
>>> Someone else reported this same bug a week or two ago on this list.
>>>
>>> My suggestion to them is the same that I will make to you:
>>>
>>> Modify the code to dump some of that value around the area that it is 
>>> reporting the problem.  What's in position 234337 of mem_init? What's 
>>> around there?
>>>
>>> That should tell you something useful (and it is how I tracked down my 
>>> problem when I ran into this in the past).
>>>
>>>  - Bruce
>>>
>>>
>>> On Wed, Oct 29, 2014 at 9:31 PM, Robert Goulet <[email protected]> 
>>> wrote:
>>>
>>>> Yeah unfortunately the code is private, can't share it. I wasn't able 
>>>> to reproduce it with a simple new project. The project that reproduce it 
>>>> links with about 20 static libraries (.bc), and it seems that if I remove 
>>>> about 3/4 of them, the link works. It doesn't seems to be tied to a 
>>>> specific lib, but more about the total size of the lib payload. That's 
>>>> very 
>>>> odd indeed.
>>>>
>>>>
>>>> On Wednesday, October 29, 2014 10:20:18 AM UTC-4, Robert Goulet wrote:
>>>>>
>>>>> Nope, that didn't work...
>>>>>
>>>>> Link:
>>>>>   Traceback (most recent call last):
>>>>>     File "C:\Program Files\Emscripten\emscripten\1.25.0\emscripten.py", 
>>>>> line 1578, in <module>
>>>>>       _main(environ=os.environ)
>>>>>     File "C:\Program Files\Emscripten\emscripten\1.25.0\emscripten.py", 
>>>>> line 1566, in _main
>>>>>       temp_files.run_and_clean(lambda: main(
>>>>>     File "C:\Program 
>>>>> Files\Emscripten\emscripten\1.25.0\tools\tempfiles.py", 
>>>>> line 39, in run_and_clean
>>>>>       return func()
>>>>>     File "C:\Program Files\Emscripten\emscripten\1.25.0\emscripten.py", 
>>>>> line 1574, in <lambda>
>>>>>       DEBUG_CACHE=DEBUG_CACHE,
>>>>>     File "C:\Program Files\Emscripten\emscripten\1.25.0\emscripten.py", 
>>>>> line 1461, in main
>>>>>       jcache=jcache, temp_files=temp_files, DEBUG=DEBUG, 
>>>>> DEBUG_CACHE=DEBUG_CACHE)
>>>>>     File "C:\Program Files\Emscripten\emscripten\1.25.0\emscripten.py", 
>>>>> line 911, in emscript_fast
>>>>>       %s''' % (str(mem_init).count(',')+1, global_initializers, 
>>>>> str(mem_init))) # XXX wrong size calculation!
>>>>>   UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 
>>>>> 234337: ordinal not in range(128)
>>>>>   Traceback (most recent call last):
>>>>>     File "C:\Program Files\Emscripten\emscripten\1.25.0\\emcc", line 
>>>>> 1259, in <module>
>>>>>       final = shared.Building.emscripten(final, append_ext=False, 
>>>>> extra_args=extra_args)
>>>>>     File "C:\Program Files\Emscripten\emscripten\1.25.0\tools\shared.py", 
>>>>> line 1464, in emscripten
>>>>>       assert os.path.exists(filename + '.o.js'), 'Emscripten failed to 
>>>>> generate .js'
>>>>>   AssertionError: Emscripten failed to generate .js
>>>>> C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4
>>>>> .0\Platforms\Emscripten\Microsoft.Cpp.Emscripten.Targets(117,5): 
>>>>> error MSB6006: "C:\Program Files\Emscripten\emscripten\1.25.0\emcc.bat" 
>>>>> exited with code 1.
>>>>>
>>>>> Build FAILED.
>>>>>
>>>>> On Tuesday, October 28, 2014 4:24:45 PM UTC-4, Alon Zakai wrote:
>>>>>>
>>>>>> Hmm, never seen that before. Odd.
>>>>>>
>>>>>> If this code is open, can you provide the bitcode for testing? If 
>>>>>> not, one random guess - if you change that line (911 in emscripten.py) 
>>>>>> to 
>>>>>> replace 
>>>>>>
>>>>>> mem_init
>>>>>>
>>>>>> (in both places) with
>>>>>>
>>>>>> str(mem_init)
>>>>>>
>>>>>> , does that help?
>>>>>>
>>>>>> - Alon
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Tue, Oct 28, 2014 at 11:04 AM, Robert Goulet <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>> Hi all,
>>>>>>>
>>>>>>> I just upgraded my project to Emscripten 1.25.0 and I have a new 
>>>>>>> link error that wasn't there with Emscripten 1.22.0.
>>>>>>>
>>>>>>> Here is what the linker outputs:
>>>>>>>
>>>>>>> Link:
>>>>>>>   Traceback (most recent call last):
>>>>>>>     File "C:\Program Files\Emscripten\emscripten\1.25.0\emscripten.py", 
>>>>>>> line 1578, in <module>
>>>>>>>       _main(environ=os.environ)
>>>>>>>     File "C:\Program Files\Emscripten\emscripten\1.25.0\emscripten.py", 
>>>>>>> line 1566, in _main
>>>>>>>       temp_files.run_and_clean(lambda: main(
>>>>>>>     File "C:\Program 
>>>>>>> Files\Emscripten\emscripten\1.25.0\tools\tempfiles.py", 
>>>>>>> line 39, in run_and_clean
>>>>>>>       return func()
>>>>>>>     File "C:\Program Files\Emscripten\emscripten\1.25.0\emscripten.py", 
>>>>>>> line 1574, in <lambda>
>>>>>>>       DEBUG_CACHE=DEBUG_CACHE,
>>>>>>>     File "C:\Program Files\Emscripten\emscripten\1.25.0\emscripten.py", 
>>>>>>> line 1461, in main
>>>>>>>       jcache=jcache, temp_files=temp_files, DEBUG=DEBUG, 
>>>>>>> DEBUG_CACHE=DEBUG_CACHE)
>>>>>>>     File "C:\Program Files\Emscripten\emscripten\1.25.0\emscripten.py", 
>>>>>>> line 911, in emscript_fast
>>>>>>>       %s''' % (mem_init.count(',')+1, global_initializers, 
>>>>>>> mem_init)) # XXX wrong size calculation!
>>>>>>>   UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in 
>>>>>>> position 234337: ordinal not in range(128)
>>>>>>>   Traceback (most recent call last):
>>>>>>>     File "C:\Program Files\Emscripten\emscripten\1.25.0\\emcc", 
>>>>>>> line 1259, in <module>
>>>>>>>       final = shared.Building.emscripten(final, append_ext=False, 
>>>>>>> extra_args=extra_args)
>>>>>>>     File "C:\Program 
>>>>>>> Files\Emscripten\emscripten\1.25.0\tools\shared.py", 
>>>>>>> line 1464, in emscripten
>>>>>>>       assert os.path.exists(filename + '.o.js'), 'Emscripten failed 
>>>>>>> to generate .js'
>>>>>>>   AssertionError: Emscripten failed to generate .js
>>>>>>> C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4
>>>>>>> .0\Platforms\Emscripten\Microsoft.Cpp.Emscripten.Targets(117,5): 
>>>>>>> error MSB6006: "C:\Program Files\Emscripten\emscripten\1.25.0\emcc.bat" 
>>>>>>> exited with code 1.
>>>>>>>
>>>>>>> Here is the link command-line use:
>>>>>>>
>>>>>>> emcc -o f:/dev/build/main.html -O2 f:/dev/build/game/game.bc 
>>>>>>> -Wno-warn-absolute-paths -s NO_EXIT_RUNTIME=1 -s 
>>>>>>> TOTAL_MEMORY=64*1024*1024 
>>>>>>> --preload-file f:/dev/data/gamedata@/
>>>>>>>
>>>>>>> I did a clean/full rebuild to be sure there wasn't any previously 
>>>>>>> built files around and I always get the same results. Did anyone ever 
>>>>>>> had 
>>>>>>> this problem before? How do I debug this?
>>>>>>> Thanks!
>>>>>>>
>>>>>>> -- 
>>>>>>> You received this message because you are subscribed to the Google 
>>>>>>> Groups "emscripten-discuss" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>>> send an email to [email protected].
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>>
>>>>>>  -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "emscripten-discuss" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to [email protected].
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "emscripten-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to