Hi!

build_msg -D msg.fdb -P ./ -F firebird.msg -L all
when msg.fdb is absent will result in infinite loop.

I have the simple fix - try to open specified file, but maybe someone
has better solution.
http://pastebin.com/YUtu8Znz

Original problem is that after preprocessing structures/variables like
   struct isc_33_struct {
          short isc_34;    /* isc_utility */
   } isc_33;
are not nulled on definition, so thay have trash contents.

>From build_msg.cpp

        bool got_one = false;
        /*FOR FIRST 1 L IN LOCALES WITH L.LOCALE = locale*/
        {
                if (!isc_29)
                   isc_compile_request2 (NULL, (FB_API_HANDLE*) &DB,
(FB_API_HANDLE*) &isc_29, (short) sizeof(isc_30), (char*) isc_30);
        isc_vtov ((const char*) locale, (char*) isc_31.isc_32, 21);
                isc_start_and_send (NULL, (FB_API_HANDLE*) &isc_29,
(FB_API_HANDLE*) &gds_trans, (short) 0, (short) 21, &isc_31, (short)
0);
        while (1)
           {
                   isc_receive (NULL, (FB_API_HANDLE*) &isc_29,
(short) 1, (short) 2, &isc_33, (short) 0);
           if (!isc_33.isc_34) break;
            got_one = true;
        /*END_FOR;*/
           }

isc_receive catches exception during interface call, so no value
assigned to isc_33.isc_34 and it is not nulled neither in isc_receive
nor before.
Then "trash check" occurs: if (!isc_33.isc_34) break; so no break at
all -> infinite loop.

---

My solution is simple and only for build_msg, but this problem
potentially still exists in other preprocessed files.


-- 
Egor Pugin

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to