Re: [PATCH v2 03/18] ref-filter: make valid_atom as function parameter

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

 



2018-01-18 17:23 GMT+03:00 Christian Couder <christian.couder@xxxxxxxxx>:
> On Thu, Jan 18, 2018 at 12:49 PM, Оля Тележная <olyatelezhnaya@xxxxxxxxx> wrote:
>> 2018-01-18 9:20 GMT+03:00 Оля Тележная <olyatelezhnaya@xxxxxxxxx>:
>>>
>>> I think it's important to finish migrating process at first. I mean,
>>> now we are preparing and collecting everything in ref-filter, but we
>>> make resulting string and print still in cat-file. And I am not sure,
>>> but maybe it will not be possible to start using new atoms in cat-file
>>> while some part of logic still differs.
>>
>> I tried to make that part here:
>> https://github.com/telezhnaya/git/commit/19a148614f1d4db1f8e628eb4e6d7c819d2da875
>> I know that the code is disgusting and there is a memory leak :) I
>> just try to reuse ref-filter logic, I will cleanup everything later.
>> At first, I try to make it work.
>> The problem is that I have segfault, and if I use gdb, I get:
>>
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x0000000000000000 in ?? ()
>
> Make sure that you compile with debug options like -g3. For example I use:
>
> $ make -j 4 DEVELOPER=1 CFLAGS="-g3"

Is it OK that I get different test results with simple make and with
make with all that flags?
Have a code: https://github.com/telezhnaya/git/commits/catfile
I do:

olya@ubuntu17-vm:~/git$ make install
olya@ubuntu17-vm:~/git$ cd t
olya@ubuntu17-vm:~/git/t$ ./t1006-cat-file.sh

And I have 17 tests broken.
Then, without any changes in code, I do:

olya@ubuntu17-vm:~/git$ make -j 4 DEVELOPER=1 CFLAGS="-g3" install
olya@ubuntu17-vm:~/git$ cd t
olya@ubuntu17-vm:~/git/t$ ./t1006-cat-file.sh

And there is 42 tests broken.
And it's really hard to search for errors in such situation.

>
>> I tried to google it, it's my first time when I get that strange
>> message, and unfortunately find nothing. So please explain me the
>> reason, why I can't find a place of segfault that way.
>
> I get the following:
>
> (gdb) run cat-file --batch < myarg.txt
> Starting program: /home/ubuntu/bin/git cat-file --batch < myarg.txt
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x00005555556ea7cf in format_ref_array_item (info=0x7fffffffd460,
> format=0x7fffffffd6e0,
>     final_buf=0x7fffffffd410) at ref-filter.c:2234
> 2234                    atomv->handler(atomv, &state);
> (gdb) bt
> #0  0x00005555556ea7cf in format_ref_array_item (info=0x7fffffffd460,
>     format=0x7fffffffd6e0, final_buf=0x7fffffffd410) at ref-filter.c:2234
> #1  0x00005555556ea91c in show_ref_array_item (info=0x7fffffffd460,
> format=0x7fffffffd6e0)
>     at ref-filter.c:2256
> #2  0x0000555555577ef7 in batch_object_write (
>     obj_name=0x555555a66770 "5e1c309dae7f45e0f39b1bf3ac3cd9db12e7d689",
>     opt=0x7fffffffd6e0, data=0x7fffffffd5e0) at builtin/cat-file.c:298




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux