When doing makedoc= to get a help file, I get a failed assertion: assert(t<80); after it reads in the one-byte length of an ID. The value comes back as 118. (The length of the id field in the structure is 81 bytes, so...) This is while formatting page 234, line 47, so its quite a ways into the document. The assertion is in the PD_GET_CONTENT case of print_doc_get_info. I added an assertion in the help compiler to assert that the length of IDs it writes out are < 80 and that assertion didn't fail. So that tells me that the help file is most likely correct, but the new fractint code is doing something wrong when reading it. I've bumped into a couple of these situations where offsets are computed from magic numbers relating to the size of 16-bit ints instead of using sizeof(int). It looks like hc.c is writing out 4-byte integers everywhere that it used to write out 2-byte integers because it uses sizeof() to compute lengths of data to be written. Any suggestions on where I should look to hunt this down? -- "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download <http://www.xmission.com/~legalize/book/download/index.html> Legalize Adulthood! <http://blogs.xmission.com/legalize/>
On Fri, 2006-12-29 at 20:20 -0700, Richard wrote:
When doing makedoc= to get a help file, I get a failed assertion:
assert(t<80);
after it reads in the one-byte length of an ID. The value comes back as 118. (The length of the id field in the structure is 81 bytes, so...) This is while formatting page 234, line 47, so its quite a ways into the document.
The assertion is in the PD_GET_CONTENT case of print_doc_get_info.
I added an assertion in the help compiler to assert that the length of IDs it writes out are < 80 and that assertion didn't fail.
Unless you've defined XFRACT, SHOW_ERROR_LINE will be defined in hc.c. This and the fact that is sounds like you have gotten way past the place where hc.exe runs, would indicate the problem isn't here.
So that tells me that the help file is most likely correct, but the new fractint code is doing something wrong when reading it. I've bumped into a couple of these situations where offsets are computed from magic numbers relating to the size of 16-bit ints instead of using sizeof(int).
The code that reads in the help file is in help.c.
It looks like hc.c is writing out 4-byte integers everywhere that it used to write out 2-byte integers because it uses sizeof() to compute lengths of data to be written.
Take a look at lines 802 and 1560 in help.c (there is a caste to different integer types on these lines). We could be asking to allocate more memory than we can physically get. Jonathan
Speaking of help, I fixed a bug on the HEAD where putc was used instead of fputc. -- "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download <http://www.xmission.com/~legalize/book/download/index.html> Legalize Adulthood! <http://blogs.xmission.com/legalize/>
In article <1167483162.3494.16.camel@linux.site>, Jonathan Osuch <osuchj@avalon.net> writes:
It looks like hc.c is writing out 4-byte integers everywhere that it used to write out 2-byte integers because it uses sizeof() to compute lengths of data to be written.
Take a look at lines 802 and 1560 in help.c (there is a caste to different integer types on these lines). We could be asking to allocate more memory than we can physically get.
OK, I looked here and this code is used during the help viewer and not in the code that is used for makedoc=, so still looking... -- "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download <http://www.xmission.com/~legalize/book/download/index.html> Legalize Adulthood! <http://blogs.xmission.com/legalize/>
On Sat, 2006-12-30 at 14:23 -0700, Richard wrote:
Take a look at lines 802 and 1560 in help.c (there is a caste to different integer types on these lines). We could be asking to allocate more memory than we can physically get.
OK, I looked here and this code is used during the help viewer and not in the code that is used for makedoc=, so still looking...
The printing to file occurs in the print_document() routine in help.c (line 1347). Jonathan
I've made some headway. It definately seems to be the result of somewhere assuming that sizeof(int) returns 2. I'm still debugging it, but I'm making progress. -- "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download <http://www.xmission.com/~legalize/book/download/index.html> Legalize Adulthood! <http://blogs.xmission.com/legalize/>
participants (2)
-
Jonathan Osuch -
Richard