I (laboriously) added print statements to find the library routine that
eventually fails and it looks like the non-asm Emscripten might indeed be
trying to call a function where there is no function. Here is a snippet of
the code that is being run, indicating where print statements are located:
fprintf(stdout, "2\n"); fflush(stdout);
if (*status == NOT_IMAGE)
*status = tstatus; /* ignore 'unknown extension type' error */
else if (*status > 0)
return(*status);
fprintf(stdout, "3\n"); fflush(stdout);
/*
the logical end of the header is 80 bytes before the current
position,
minus any trailing blank keywords just before the END keyword.
*/
(fptr->Fptr)->headend = (fptr->Fptr)->nextkey - (80 * (nspace + 1));
fprintf(stdout, "4 [%d %d]\n", (int)(fptr->Fptr)->headend,
(int)(fptr->Fptr)->nextkey); fflush(stdout);
/* the data unit begins at the beginning of the next logical block */
(fptr->Fptr)->datastart = (((fptr->Fptr)->nextkey - 80) / 2880 + 1)
* 2880;
fprintf(stdout, "5\n"); fflush(stdout);
and here is the output in the Chrome debugger for the non-wasm case:
[image: Screen Shot 2019-11-20 at 10.13.49 AM.png]
The values of 400 and 480 displayed in print statement #4 are correct for
this astronomical image, so things look right at that point. But the next
line of code should simply set datastart to the first 2880 byte block after
the image header, and it looks like it might be calling a non-existent
routine instead. So we never reach print statement #5.
Note that headend, nextkey, and datastart are all declared as long long, if
that is any hint.
For comparison, here is the Chrome debugger output from the wasm build:
[image: Screen Shot 2019-11-20 at 10.24.35 AM.png]
Let me know how I can help.
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/emscripten-discuss/39322779-c9c5-4fbc-9231-203200ffe086%40googlegroups.com.