bneradt commented on issue #10670:
URL: 
https://github.com/apache/trafficserver/issues/10670#issuecomment-1781797799

   I caught this again while running ATS 10 on docs via gdb. I noticed this:
   
   ```gdb
   Thread 3 "[ET_NET 0]" received signal SIGSEGV, Segmentation fault.           
                                                                                
  
   [Switching to Thread 0x7fffef9b1700 (LWP 1049893)]                           
                                                                                
  
   std::__atomic_base<long>::fetch_add (__m=std::memory_order_relaxed, __i=1, 
this=0x1) at /usr/include/c++/10/bits/atomic_base.h:548
   548           { return __atomic_fetch_add(&_M_i, __i, int(__m)); }           
                                                                                
  
   (gdb) bt                                                                     
                                                                                
  
   #0  std::__atomic_base<long>::fetch_add (__m=std::memory_order_relaxed, 
__i=1, this=0x1) at /usr/include/c++/10/bits/atomic_base.h:548
   #1  ts::Metrics::increment (metric=0x1, val=1) at 
../../include/api/Metrics.h:159
   #2  0x0000555555d43356 in CacheVC::openWriteCloseDir (this=0x7fffe80b3010) 
at CacheWrite.cc:1208
   #3  0x0000555555d439b5 in CacheVC::openWriteCloseHeadDone 
(this=0x7fffe80b3010, event=3900, e=0x7fffb4000d40) at CacheWrite.cc:1265
   #4  0x0000555555aa04ef in Continuation::handleEvent (this=0x7fffe80b3010, 
event=3900, data=0x7fffb4000d40) at 
/home/maskit/trafficserver/iocore/eventsystem/I_Continuation.h:228
   #5  0x0000555555f90677 in EThread::process_event (this=0x7ffff41aa010, 
e=0x7fffb4000d40, calling_code=3900) at UnixEThread.cc:150
   #6  0x0000555555f908c7 in EThread::process_queue (this=0x7ffff41aa010, 
NegativeQueue=0x7fffef9b0170, ev_count=0x7fffef9b0124, nq_count=0x7fffef9b0120) 
at UnixEThread.cc:185
   #7  0x0000555555f90bd6 in EThread::execute_regular (this=0x7ffff41aa010) at 
UnixEThread.cc:241
   #8  0x0000555555f90ff2 in EThread::execute (this=0x7ffff41aa010) at 
UnixEThread.cc:334
   #9  0x0000555555f8f8d6 in spawn_thread_internal (a=0x5555564790e0) at 
Thread.cc:78                                                                    
         
   #10 0x00007ffff77a8609 in start_thread (arg=<optimized out>) at 
pthread_create.c:477                                                            
               
   #11 0x00007ffff7249133 in clone () at 
../sysdeps/unix/sysv/linux/x86_64/clone.S:95
   (gdb) f 2                                                                    
                                                                                
  
   #2  0x0000555555d43356 in CacheVC::openWriteCloseDir (this=0x7fffe80b3010) 
at CacheWrite.cc:1208
   1208        
Metrics::increment(cache_rsb.fragment_document_count[std::max(fragment, 2)]);
   
   (gdb) p fragment
   $6 = 59
   (gdb) p cache_rsb.fragment_document_count[std::max(fragment, 2)]
   No symbol "max" in namespace "std".
   (gdb) p cache_rsb.fragment_document_count[59]
   $7 = (ts::Metrics::IntType *) 0x1
   (gdb) down
   #1  ts::Metrics::increment (metric=0x1, val=1) at 
../../include/api/Metrics.h:159
   159         metric->fetch_add(val, MEMORY_ORDER);
   (gdb) p metric
   $8 = (ts::Metrics::IntType *) 0x1
   ```
   
   Notice that `cache_rsb.fragment_document_count[std::max(fragment, 2)]`, 
which has a value of `0x1`, is being passed as the metric pointer in the 
`ts::Metrics::increment` code.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to