bug-gnucobol
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [open-cobol-list] bug report: SIGSEGV in GOBACK


From: Brian Tiffin
Subject: Re: [open-cobol-list] bug report: SIGSEGV in GOBACK
Date: Wed, 27 Nov 2013 03:47:14 -0500

Excuse the ditto, but

Yeah, Sergey

Thank you!

Cheers,
Brian

On 11/26/13, Matthew Fisher <address@hidden> wrote:
> Hi Sergey,
>
> I have manually applied this patch in my local clone of the
> gnu-cobol-2.0 branch, and can confirm that it does resolve the problem.
>
> Thank you!
>
>   - Matt
>
> On 11/26/2013 3:20 AM, Sergey Kashyrin wrote:
>> Hi,
>>
>> Can't provide the patch at the moment, but
>>
>> Find the function cob_sys_copy_file in fileio.c
>>
>> Replace following 2 lines
>>      while ((i = read (fd1, fn1, sizeof(fn1))) > 0) {
>>          if (write (fd2, fn1, (size_t)i) < 0) {
>> by
>>      while ((i = read (fd1, file_open_buff, COB_FILE_BUFF)) > 0) {
>>          if (write (fd2, file_open_buff, (size_t)i) < 0) {
>>
>> This bug was there from the beginning - using memory block after "free",
>> which on some systems corrupting the heap structure.
>>
>> Regards,
>> Sergey
>>
>>
>> On 11/24/2013 8:48 AM, Matthew Fisher wrote:
>>> This report refers to the gnu-cobol-2.0 branch, checked out today from:
>>>
>>>       svn://svn.code.sf.net/p/open-cobol/code/branches/gnu-cobol-2.0
>>>
>>> Under certain conditions, a segmentation fault occurs on line 212 of
>>> libcob/common.c.
>>>
>>> A minimal test program (compiled with `cobc -xg test.cbl`):
>>>
>>>          IDENTIFICATION DIVISION.
>>>          PROGRAM-ID. test.
>>>
>>>          DATA DIVISION.
>>>          WORKING-STORAGE SECTION.
>>>          01  CALL-STATUS  BINARY-LONG.
>>>
>>>          PROCEDURE DIVISION.
>>>              CALL "C$COPY"
>>>                  USING "test.cbl" "copy.cbl" "S"
>>>                  GIVING CALL-STATUS
>>>              END-CALL
>>>
>>>              GOBACK
>>>              .
>>>
>>> The output from running the program:
>>>
>>>       test.cbl: 14 Attempt to reference unallocated memory (Signal
>>>       SIGSEGV)
>>>       Abnormal termination - File contents may be incorrect
>>>
>>> Line 14 is the GOBACK statement. When run in gdb, with a breakpoint
>>> set in cob_exit_common, it can be seen that the seg fault occurs on
>>> the free statement in line 212 of libcob/common.c:
>>>
>>>       if (cobglobptr->cob_term_buff) {
>>>           free (cobglobptr->cob_term_buff);
>>>       }
>>>
>>>
>>> ------------------------------------------------------------------------------
>>>
>>> Shape the Mobile Experience: Free Subscription
>>> Software experts and developers: Be at the forefront of tech innovation.
>>> Intel(R) Software Adrenaline delivers strategic insight and
>>> game-changing
>>> conversations that shape the rapidly evolving mobile landscape. Sign
>>> up now.
>>> http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
>>>
>>> _______________________________________________
>>> open-cobol-list mailing list
>>> address@hidden
>>> https://lists.sourceforge.net/lists/listinfo/open-cobol-list
>>
>
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics
> Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
> _______________________________________________
> open-cobol-list mailing list
> address@hidden
> https://lists.sourceforge.net/lists/listinfo/open-cobol-list
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]